Execute the following command to switch to code branch:
cd linux
git checkout -b JH7110_VisionFive2_devel origin/JH7110_VisionFive2_devel
git pull
Execute the following command to set the default configuration of compiling Linux kernel:
make <Configuration_File> CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv
Tip:<Configuration_File>: This file is starfive_visionfive2_defconfig on VisionFive
2.
Execute the following command to set other software configuration of compiling Linux kernel:
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv menuconfig
Compile Linux Kernel:
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv -jx
Note: Here you need to change the -jx value according to the number of cores in your CPU. If your CPU has 8 cores, change this to -j8. This process will take some time and therefore please wait patiently. This process is quite time-consuming, please be patient and wait.
Result:
The system will generate the kernel image file Image.gz under linux/arch/riscv/boot directory.Figure 1. Example Output The system will generate the dtb file Image.gz under linux/arch/riscv/boot directory.Figure 2. Generating dtb When porting rootfs, dtb, and kernel to VisionFive
2, Image.gz and .dtb files will be used.