Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # working when running as root
- # install build requirements
- apt install -y git bc bison flex libssl-dev make libncurses5-dev
- # clone and download kernel sources
- cd /opt
- git clone --depth=1 https://github.com/raspberrypi/linux
- cd linux
- # create kernel config
- #RASPI 4: `make bcm2711_defconfig`
- #RASPI 5: `make bcm2712_defconfig`
- # # DO OTHER TUNINGS HERE via `make menuconfig`
- # set PG table size to 4 instead of default 3
- sed -i 's/CONFIG_PGTABLE_LEVELS=3/CONFIG_PGTABLE_LEVELS=4/' .config
- # compile (requires a lot of time on raspi 4)
- make -j4 Image.gz modules dtbs
- make modules_install
- # copy compiled resources
- cp arch/arm64/boot/dts/broadcom/*.dtb /boot/
- cp arch/arm64/boot/dts/overlays/*.dtb* /boot/overlays/
- cp arch/arm64/boot/dts/overlays/README /boot/overlays/
- # RASPI 4: cp arch/arm64/boot/Image.gz /boot/kernel8.img
- # RASPI 5: cp arch/arm64/boot/Image.gz /boot/firmware/kernel8.img
- # use new kernel
- echo "kernel=kernel8.img" | tee -a /boot/config.txt
- reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement