Building Kernel Image

Perform the following steps to prepare the kernel image:

  1. Pull the kernel code:
    $ git clone https://github.com/starfive-tech/VisionFive2.git
  2. Compile code:
    1. Enter the following directory:

      /VisionFive2/linux/arch/riscv/configs

    2. Use the following file to replace starfive_visionfive2_defconfig.

      docker_config_20230215

      Note: To download this file, you need to register or login to RVspace.
    3. Run ./build_kernel_vf2.sh script under /VisionFive2/work/linux directory.
      Note:
      • Script download address: build_kernel_vf2.sh
        Note: To download this file, you need to register or login to RVspace.
      • You need to change the target path of the script file to your own file path.
      Figure 1. Example Running Process
  3. Confirm the generated files after compilation:
    • Under ./VisionFive2/work/boot path:
      • config-5.15.0-starfive-dirty
      • System.map-5.15.0-starfive-dirty
      • vmlinuz-5.15.0-starfive-dirty
      Note: To simplify the later operations, rename the generated files as the following:
      • config-5.15.0-starfive
      • System.map-5.15.0-starfive
      • vmlinuz-5.15.0-starfive
    • Under ./VisionFive2/work path:
      • linux-headers-5.15.0-starfive_5.15.0-starfive-1_riscv64.deb
      • linux-image-5.15.0-starfive_5.15.0-starfive-1_riscv64.deb
      • linux-libc-dev_5.15.0-starfive-1_riscv64.deb