From: Richard Jones Date: Tue, 7 Jul 2009 16:33:47 +0000 (+0100) Subject: RHEL 5: RHEL kernels don't have $arch at the end, so look for non-arch kernels too. X-Git-Tag: 1.0.56~5 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=2e632a654f82a86c0bd29d935d1ed0b5db46113d RHEL 5: RHEL kernels don't have $arch at the end, so look for non-arch kernels too. --- diff --git a/appliance/libguestfs-supermin-helper.in b/appliance/libguestfs-supermin-helper.in index 2afd0cf..e521020 100755 --- a/appliance/libguestfs-supermin-helper.in +++ b/appliance/libguestfs-supermin-helper.in @@ -33,9 +33,13 @@ initrd="$3" # Look for the most recent kernel named vmlinuz-*.* which has a # corresponding directory in /lib/modules/. If the architecture is x86, look # for any x86 kernel. +# +# RHEL 5 didn't append the arch to the kernel name, so look for kernels +# without arch second. arch=$(echo "@host_cpu@" | sed 's/^i.86$/i?86/') -for f in $(ls -1vr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen); do +kernels=$(ls -1vr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen; ls -1vr /boot/vmlinuz-* 2>/dev/null | grep -v xen) +for f in $kernels; do b=$(basename "$f") b=$(echo "$b" | sed 's,vmlinuz-,,') modpath="/lib/modules/$b"