compile directly on the raspberry pi 4

apt update
apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev bc
mkdir /RaspKernel_6_6_y && cd /RaspKernel_6_6_y
#is there a way to force the version 6.6.**51** ?
git clone --depth=1 --branch rpi-6.6.y https://github.com/raspberrypi/linux
cd linux

make bcm2711_defconfig
cp /boot/config-$(uname -r) /RaspKernel_6_6_y/linux/.config
KERNEL=kernel8
make menuconfig #enable the kernel option needed

make -j$((`nproc` - 2)) Image.gz modules dtbs
make -j$((`nproc` - 2)) modules_install

cp arch/arm64/boot/Image.gz /boot/firmware/$KERNEL.img
cp arch/arm64/boot/dts/broadcom/*.dtb /boot/firmware/
cp arch/arm64/boot/dts/overlays/*.dtb* /boot/firmware/overlays/
cp arch/arm64/boot/dts/overlays/README /boot/firmware/overlays/

reboot
Edit

Pub: 13 Jan 2025 12:10 UTC

Edit: 13 Jan 2025 13:40 UTC

Views: 45