diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-19 18:25:38 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-19 18:25:38 +0100 |
commit | e250646e7cc99df9bb617c28d13c327ff79ab601 (patch) | |
tree | 8b35d1c4c7987f29f7f6c98941efa003953c5610 /appliance | |
parent | b7f39224e17eecf53ea2671122d4b3176e4d202f (diff) | |
download | libguestfs-e250646e7cc99df9bb617c28d13c327ff79ab601.tar.gz libguestfs-e250646e7cc99df9bb617c28d13c327ff79ab601.tar.xz libguestfs-e250646e7cc99df9bb617c28d13c327ff79ab601.zip |
Supermin: choose newest available kernel.
Diffstat (limited to 'appliance')
-rwxr-xr-x | appliance/libguestfs-supermin-helper.in | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/appliance/libguestfs-supermin-helper.in b/appliance/libguestfs-supermin-helper.in index 87fb6882..d7c8d96b 100755 --- a/appliance/libguestfs-supermin-helper.in +++ b/appliance/libguestfs-supermin-helper.in @@ -29,11 +29,13 @@ sourcedir=$(cd "$1" > /dev/null; pwd) kernel="$2" initrd="$3" -# Look for the kernel first. This is very unsophisticated: We -# just look for any kernel named vmlinuz-*.$host_cpu which has a -# corresponding /lib/modules/*.$host_cpu directory. +# 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. -for f in /boot/vmlinuz-*.@host_cpu@; do +for f in $(ls -1vr /boot/vmlinuz-*.@host_cpu@* | grep -v xen); do b=$(basename "$f") b=$(echo "$b" | sed 's,vmlinuz-,,') modpath="/lib/modules/$b" |