From d7e47cb492ee7564f0be44179c5222b3e5a4b62d Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sat, 8 Jul 2023 08:00:47 +0100 Subject: Add how to compile raspi4 kernel --- md/writeup/compile_linux_kernel.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/md/writeup/compile_linux_kernel.md b/md/writeup/compile_linux_kernel.md index 2724736..052155a 100644 --- a/md/writeup/compile_linux_kernel.md +++ b/md/writeup/compile_linux_kernel.md @@ -71,6 +71,8 @@ This bare minimum of command that you whant to run to start modifing your kernel ## Compiling +Compile kernel on local machine for local machine + Run to configure kernel ```sh make menuconfig @@ -83,6 +85,38 @@ compile our first kernel make ``` +### ARM64 + +Compile kernel for arm64 + +```sh +ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make defconfig +``` + +```sh +ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make +``` + +#### Raspberry Pi + +Clone the official kernel + +```sh +git clone --depth=1 https://github.com/raspberrypi/linux +``` + + +```sh +cd linux +KERNEL=kernel8 +ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make bcm2711_defconfig +``` + +```sh +ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j4 zImage modules dtbs +``` + + ## Install It depends from distro to distro expected way how to install new/fresh/clean kernel @@ -145,3 +179,4 @@ http://tomoyo.osdn.jp/ 3. https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel 4. https://fedoraproject.org/wiki/Building_a_custom_kernel 5. https://wiki.archlinux.org/index.php/Kernels/Traditional_compilation +6. https://www.raspberrypi.com/documentation/computers/linux_kernel.html \ No newline at end of file -- cgit v1.2.3