Procedure
-
Get 64Bit Cross Compiler by sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
-
Build according to bcmrpi3_defconfig (Raspberry Pi 3B+) make -j4 ARCH=arm64 KERNEL=kernel7 CROSS_COMPILE=aarch64-linux-gnu- bcmrpi3_defconfig
-
Do Modification of Kernel through menuconfig make -j4 ARCH=arm64 KERNEL=kernel7 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
-
Make Kernel make -j4 ARCH=arm64 KERNEL=kernel7 CROSS_COMPILE=aarch64-linux-gnu-
-
Make Module files for this Kernel make -j4 ARCH=arm64 KERNEL=kernel7 CROSS_COMPILE=aarch64-linux-gnu- modules
Reference (In Traditional Chinese Only) https://blog.gtwang.org/iot/raspberry-pi-compile-linux-kernel/