]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut): add support for kernel name Image
authorJo Zzsi <jozzsicsataban@gmail.com>
Sun, 14 Sep 2025 16:51:06 +0000 (12:51 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Wed, 17 Sep 2025 14:57:12 +0000 (10:57 -0400)
On some architectures (arm64) the name of the kernel file
is usually Image. Add support for it instead of working around it.

dracut.sh
test/run-qemu

index 17b2513c33e3e4a07529dd05cd429b05bfc18514..79968925154650fb7a4d2c5f4bffc857fb60b157 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1710,7 +1710,8 @@ if [[ ! $print_cmdline ]]; then
 
         if ! [[ $kernel_image ]]; then
             for kernel_image in "${dracutsysrootdir-}/lib/modules/$kernel/vmlinuz" "${dracutsysrootdir-}/boot/vmlinuz-$kernel" \
-                "${dracutsysrootdir-}/lib/modules/$kernel/vmlinux" "${dracutsysrootdir-}/boot/vmlinux-$kernel"; do
+                "${dracutsysrootdir-}/lib/modules/$kernel/vmlinux" "${dracutsysrootdir-}/boot/vmlinux-$kernel" \
+                "${dracutsysrootdir-}/lib/modules/$kernel/Image"; do
                 [[ -s $kernel_image ]] || continue
                 break
             done
index 0250a8a8769767871f15016cbf868384c8a58ece..c12f72820374b13d1e0da9854acc148747575a67 100755 (executable)
@@ -14,6 +14,10 @@ set_vmlinux_env() {
             VMLINUZ="/lib/modules/${KVERSION}/vmlinux"
         fi
 
+        if ! [ -f "$VMLINUZ" ]; then
+            VMLINUZ="/lib/modules/${KVERSION}/Image"
+        fi
+
         if ! [ -f "$VMLINUZ" ]; then
             [[ -f /etc/machine-id ]] && read -r MACHINE_ID < /etc/machine-id
 
@@ -33,6 +37,7 @@ set_vmlinux_env() {
 
     ! [ -f "${VMLINUZ-}" ] && VMLINUZ=$(find /boot/vmlinuz-* -type f 2> /dev/null | tail -1)
     ! [ -f "${VMLINUZ-}" ] && VMLINUZ=$(find /lib/modules/ -type f -name vmlinuz 2> /dev/null | tail -1)
+    ! [ -f "${VMLINUZ-}" ] && VMLINUZ=$(find /lib/modules/ -type f -name Image 2> /dev/null | tail -1)
 
     if ! [ -f "$VMLINUZ" ]; then
         echo "Could not find a Linux kernel version to test with!" >&2