fix wrong kernel name bug on raspberry pi 5 (#7692)

* fix wrong kernel name bug on raspberry pi 5

* improve comment formatting

* fix bug
This commit is contained in:
Taba1uga 2025-03-05 10:41:23 +01:00 committed by GitHub
parent e754fba5f9
commit 0c2e63c872
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -110,7 +110,18 @@ function post_family_tweaks_bsp__add_hooks_to_move_kernel_initrd_and_dtb() {
target=/boot/firmware
dtb_dir=/usr/lib/linux-image-$abi/
cp /boot/vmlinuz-${abi} ${target}/vmlinuz
# The kernel image can be named either "Image" (standardized for ARM platforms)
# or "vmlinuz-${abi}" (default naming convention for Linux kernels). We need
# too support both conventions.
if [[ -f /boot/Image ]]; then
cp /boot/Image ${target}/vmlinuz
elif [[ -f /boot/vmlinuz-${abi} ]]; then
cp /boot/vmlinuz-${abi} ${target}/vmlinuz
else
echo "Error: No kernel file (Image or vmlinuz-${abi}) found in /boot!"
exit 1
fi
cp ${dtb_dir}/broadcom/*.dtb ${target}/
cp -r ${dtb_dir}/overlays ${target}/
sync -f ${target}/vmlinuz || true