diff options
author | Matthew Booth <mbooth@redhat.com> | 2009-06-23 17:35:40 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-06-23 17:47:40 +0100 |
commit | d2c0ee0ff7a9afdcdc1605dd464760f98d1b57d7 (patch) | |
tree | 7607c27c7dff167545a1321c56c967ef10b87d7b /appliance | |
parent | bcb3fc0c3336c05e9ecbbfb25c7c31b42bd3e32e (diff) | |
download | libguestfs-d2c0ee0ff7a9afdcdc1605dd464760f98d1b57d7.tar.gz libguestfs-d2c0ee0ff7a9afdcdc1605dd464760f98d1b57d7.tar.xz libguestfs-d2c0ee0ff7a9afdcdc1605dd464760f98d1b57d7.zip |
Make the supermin helper look for any x86 kernel
If you've got a non-PAE kernel installed on an i686 machine, the kernel
architecture is i586. This change makes sure that supermin finds the
installed kernel.
Diffstat (limited to 'appliance')
-rwxr-xr-x | appliance/libguestfs-supermin-helper.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/appliance/libguestfs-supermin-helper.in b/appliance/libguestfs-supermin-helper.in index d7c8d96b..2afd0cfa 100755 --- a/appliance/libguestfs-supermin-helper.in +++ b/appliance/libguestfs-supermin-helper.in @@ -30,12 +30,12 @@ kernel="$2" initrd="$3" # Kernel: -# Look for any kernel named vmlinuz-*.$host_cpu* which has -# a corresponding /lib/modules/*.$host_cpu* directory. -# However by sorting on reverse version (ls -vr) we ensure -# we choose the newest kernels. +# Look for the most recent kernel named vmlinuz-*.<arch>* which has a +# corresponding directory in /lib/modules/. If the architecture is x86, look +# for any x86 kernel. -for f in $(ls -1vr /boot/vmlinuz-*.@host_cpu@* | grep -v xen); do +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 b=$(basename "$f") b=$(echo "$b" | sed 's,vmlinuz-,,') modpath="/lib/modules/$b" |