Advertisement
SpiderLordCoder1st

Untitled

May 25th, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. # working when running as root
  2. # install build requirements
  3. apt install -y git bc bison flex libssl-dev make libncurses5-dev
  4. # clone and download kernel sources
  5. cd /opt
  6. git clone --depth=1 https://github.com/raspberrypi/linux
  7. cd linux
  8.  
  9. # create kernel config
  10. #RASPI 4: `make bcm2711_defconfig`
  11. #RASPI 5: `make bcm2712_defconfig`
  12.  
  13. # # DO OTHER TUNINGS HERE via `make menuconfig`
  14.  
  15. # set PG table size to 4 instead of default 3
  16. sed -i 's/CONFIG_PGTABLE_LEVELS=3/CONFIG_PGTABLE_LEVELS=4/' .config
  17.  
  18. # compile (requires a lot of time on raspi 4)
  19. make -j4 Image.gz modules dtbs
  20. make modules_install
  21.  
  22. # copy compiled resources
  23. cp arch/arm64/boot/dts/broadcom/*.dtb /boot/
  24. cp arch/arm64/boot/dts/overlays/*.dtb* /boot/overlays/
  25. cp arch/arm64/boot/dts/overlays/README /boot/overlays/
  26. # RASPI 4: cp arch/arm64/boot/Image.gz /boot/kernel8.img
  27. # RASPI 5: cp arch/arm64/boot/Image.gz /boot/firmware/kernel8.img
  28.  
  29. # use new kernel
  30. echo "kernel=kernel8.img" | tee -a /boot/config.txt
  31.  
  32. reboot
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement