Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7512

Troubleshooting • Re: How to boot Raspberry pi 5 or Rpi5 with your own custom Linux kernel Image

$
0
0
# Now I just want to change 'image' file in 'boot' partition.
* I build Linux kernel with bcm2712_defconfig
* replace newly generated 'arch/arm64/boot/image' file in 'boot' partition.
* I got kernel panic.

That's not nearly sufficient.

Assuming the kernel source is located in /usr/src/linux and has been successfuly compiled, the following steps are required to properly install the new kernel:

Code:

KRNLID="2712"OLDIMG="kernel_2712.img"cd /usr/src/linuxBUILD="$(sed -n 's|^.*\s\+\(\S\+\.\S\+\.\S\+\)\s\+Kernel Configuration$|\1|p' .config)+rpt-rpi-${KRNLID}"mkdir -p /boot/firmware/overlays/mkdir -p "/lib/linux-image-${BUILD}/broadcom/"mkdir -p "/lib/linux-image-${BUILD}/overlays/"cp .config "/boot/config-${BUILD}"echo "ffffffffffffffff B The real System.map is in the linux-image-<version>-dbg package" > "/boot/System.map-${BUILD}"cp arch/arm64/boot/Image.gz "/boot/vmlinuz-${BUILD}"cp arch/arm64/boot/dts/broadcom/*.dtb "/lib/linux-image-${BUILD}/broadcom/"cp arch/arm64/boot/dts/overlays/*.dtb* "/lib/linux-image-${BUILD}/overlays/"cp arch/arm64/boot/dts/overlays/README "/lib/linux-image-${BUILD}/overlays/"cp arch/arm64/boot/Image.gz "/boot/firmware/${OLDIMG}"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/"update-initramfs -c -v -k "${BUILD}"
Instead of doing all this manually, build-kernel will download the kernel source and cross-compile it on your Ubuntu system, producing 'kernel-<version>.zip'. The included install-kernel will then install 'kernel-<version>.zip' on the target Raspberry Pi 5. No other steps needed.

Statistics: Posted by RonR — Fri Aug 01, 2025 9:07 pm



Viewing all articles
Browse latest Browse all 7512

Trending Articles