Compile Debian and Update Kernel
Execute the first 3 steps in Software Environment, and choose the compile method according to your compilation environment:
Local compile and Install
- Use
bindeb-pkgto creat kernel:cd linux/ cp arch/riscv/configs/starfive_visionfive2_defconfig .config make ARCH=riscv olddefconfig make ARCH=riscv -j$(nproc) bindeb-pkg
- After compilation, install the .deb kernel package.
dpkg -i *.deb
Cross compile and Install
Tip: Click the following link for reference:
- Execute the following command to set the default
configuration of compiling Linux
kernel:
make <Configuration_File> CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscvTip: <Configuration_File>: This file is starfive_visionfive2_defconfig on VisionFive 2. - Execute the following command to compile the kernel image and header files,
and then package them as Debian
packages:
$ nice make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- bindeb-pkg -j$(nproc) KDEB_COMPRESS=xz LOCALVERSION=’local_version’
Tip:local_versionis the version of the compiled kernel, which sets to-performancein this example, so the whole command is:$ nice make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- bindeb-pkg -j$(nproc) KDEB_COMPRESS=xz LOCALVERSION=-performance
- After compilation, the following files and dtb files will be generated in the upper directory:
Figure 1. File 
Figure 2. Dtb Files 
- Transfer the compiled Debian package and dtb files through network (SCP) or portable storage medium (USB) to VisionFive
2. The following figure shows an example output of file transfer over the network:
Figure 3. Example Output 
- Execute the following command to install Debian:
$ dpkg -i linux-headers-5.15.0-performance_5.15.0-performance-1_riscv64.deb $ dpkg -i linux-image-5.15.0-performance_5.15.0-performance-1_riscv64.deb $ dpkg -i linux-libc-dev_5.15.0-performance-1_riscv64.deb
- After installation, the files under /boot will be updated into:
Figure 4. Files under /boot 
