Firefly-RK3399/Build kernel

来自Firefly wiki
跳转至: 导航搜索

Before You Star

= Get Kernel Source and Cross Compiling Toolchain

Get the source code ːgit clone

cross compile tools ː git clone

Compile Kernel

linux use the firefly_linux_defconfig as config file ,and the rk3399-firefly-linux.dts as the device tree source file.

  • compile kernel
 make ARCH=arm64 firefly_linux_defconfig
 make ARCH=arm64 rk3399-firefly-linux.img -j8

after the compilation is complete , the kernel.img and resource.img should be generated in the kernel folder.

Modify Parameter File

The root file system can reside on different partitions in different storage devices (eMMC, TF card or USB disk, etc). It must be specified in the kernel's command line. There is a CMDLINE in the paramter file:

CMDLINE:console=ttyFIQ0 ... mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),...,-@0x00394000(user)

Add one of below according to your need: (# and contents after are comments, no need to enter):

root=/dev/block/mtd/by-name/linuxroot        # flash partition named "linuxroot"
root=/dev/mmcblk0p1          # First partition of TF card
root=/dev/sda1               # First partition of USB disk
root=LABEL=linuxroot         # Partition whose label is "linuxroot"

Flash to Device

Please reference Flash image, choose the newly created boot.img and modified parameter files, flash to "boot" and "parameter" partitions respectively. Then the kernel update is done.

If the root filesystem image is not flashed yet, you can download the prebuilt image, or customize your own one, and flash it to the partition specified in parameter file.