RockPi4のカーネルビルドをメモします。
参考サイト:https://wiki.radxa.com/Rockpi4/dev/kernel-4.4
$ cd toolchain/
$ wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
$ tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
$ cd
$ mkdir RockPi4
$ cd RockPi4/
$ ls
$ git clone --depth=1 -b release-4.4-rockpi4 https://github.com/radxa/kernel.git
$ cd kernel/
$ nano mk.sh
-----
#!/bin/bash
export ARCH=arm64
export CROSS_COMPILE=~/toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
make rockchip_linux_defconfig
make -j16
-----
$ chmod +x mk.sh
$ time ./mk.sh
real 2m49.812s
user 36m29.664s
sys 3m41.707s
$ cp mk.sh mkdeb.sh
$ nano mkdeb.sh
-----
#!/bin/bash
export ARCH=arm64
export CROSS_COMPILE=~/toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export build_id="999" # make sure it's big enough so that our kernel is the newest.
export lv="-$build_id-rockchip"
export kv=$(make kernelversion)
export debv="$kv$lv"
make bindeb-pkg -j8 LOCALVERSION=$lv KDEB_PKGVERSION=$debv
-----
$ time ./mkdeb.sh
real 1m37.125s
user 9m52.951s
sys 0m31.699s
$ ls ..
kernel
linux-4.4.154-999-rockchip-gf7c3df992_4.4.154-999-rockchip_all.changes
linux-firmware-image-4.4.154-999-rockchip-gf7c3df992_4.4.154-999-rockchip_all.deb
linux-headers-4.4.154-999-rockchip-gf7c3df992_4.4.154-999-rockchip_all.deb
linux-image-4.4.154-999-rockchip-gf7c3df992-dbg_4.4.154-999-rockchip_all.deb
linux-image-4.4.154-999-rockchip-gf7c3df992_4.4.154-999-rockchip_all.deb
linux-libc-dev_4.4.154-999-rockchip_all.deb