Custom kernel compilation


Compilation of the upstream kernel

Yes, I'm serious, the rock960 is supported mainline (without the graphics obviously). Well to be exact, all the bits are in the soc maintainer tree and will be merged for 4.21. But until then, you should use the arm-soc tree, or mmind tree with the for-next branch (Dec, 22 2018).

Build the kernel:

   make ARCH=arm64 menuconfig
   make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 12 Image dtbs

Generate the image:

Create the configuration file rock960-rk3399-kernel.its with the following content:

/dts-v1/;

/ {
description = "Mainline kernel image with one or more FDT blobs";
#address-cells = <1>;

images {
kernel@1 {
description = "Mainline kernel";
data = /incbin/("./arch/arm64/boot/Image");
type = "kernel";
arch = "arm64";
os = "linux";
/*
load = <0x2080000>;
entry = <0x2080000>;
*/
load = <0x4080000>;
entry = <0x4080000>;
compression = "none";
};
fdt@1 {
description = "RK3399-rock960";
data = /incbin/("./arch/arm64/boot/dts/rockchip/rk3399-rock960.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
fdt-version = <1>;
};
ramdisk@1 {
description = "rockchip-debian-ramdisk";
data = /incbin/("./initrd.img");
type = "ramdisk";
arch = "arm64";
os = "linux";
};
};
configurations {
default = "conf@1";
conf@1 {
kernel = "kernel@1";
fdt = "fdt@1";
ramdisk = "ramdisk@1";
};
};
};


Note I change the load/entry addressed but kept the old values commented. This is because my kernel was instrumented thus having a much bigger size, so I had to change addresses. It is ok to keep them.

Now that you have this configuration ready, run the following command and you are set:

  mkimage -f rock960-rk3399-kernel.its vmlinuz






Commentaires

Posts les plus consultés de ce blog