|
| 1 | +# Build Kernel |
| 2 | + |
| 3 | +Supported Architectures: `x86_64` `riscv64` |
| 4 | + |
| 5 | +`x86_64` Supported Toolchains: |
| 6 | +* `3.2.0` Xuantie-900 Linux 6.6.0 v3.2.0 |
| 7 | +* `14` Mainline RISC-V GCC 14 Cross Compiler (default) |
| 8 | + |
| 9 | +`riscv64` Supported Toolchains: |
| 10 | +* `rv` Mainline GCC Compiler |
| 11 | + |
| 12 | +Select the compiler to use via the `TOOLCHAIN_VERSION` variable |
| 13 | + |
| 14 | +## Usage |
| 15 | + |
| 16 | +```bash |
| 17 | +git clone https://github.com/revyos/xuantie-kernel-docker |
| 18 | +cd xuantie-kernel-docker |
| 19 | +docker build --build-arg TOOLCHAIN_VERSION=14 -t xuantie900:linux14 . |
| 20 | +docker run -it --rm -v LOCAL_PATH:/output xuantie900:linux14 bash |
| 21 | +./mkkernel_x64.sh # use mkkernel_xuantie.sh or mkkernel_riscv64.sh depend on your TOOLCHAIN_VERSION |
| 22 | +``` |
| 23 | + |
| 24 | +The built kernel deb packages will be copied to the directory specified by `LOCAL_PATH`, and then you can install them using `dpkg`. |
| 25 | + |
| 26 | +The compilation process will produce several results: |
| 27 | +* linux-headers.deb (Install when compiling kernel modules or for kernel development) |
| 28 | +* linux-image-dbg.deb (Debug symbols, install when debugging the kernel) |
| 29 | +* linux-image.deb (Kernel, must install) |
| 30 | +* linux-libc-dev.deb (libc interface, generally not installed, use the generic version) |
| 31 | + |
| 32 | +## Notes |
| 33 | + |
| 34 | +1. To change the version to be compiled, you can freely modify it after entering the docker environment (input `bash`) |
| 35 | +2. The `linux-header` package cross-compiled in the `x86_64` environment may contain `x86_64` header files. If you need to develop the kernel or use DKMS modules such as `zfs`, please compile with `TOOLCHAIN_VERSION=rv` in the RISC-V environment. |
0 commit comments