X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=appliance%2Flibguestfs-supermin-helper.in;h=d7c8d96bc5004847f28bf4de6ecf581f3ecb381d;hp=87fb6882c1b2b42230f0095d63f289de2ebf8170;hb=da7cf3670fe60301beeb175ff6c284b737d5b7f4;hpb=6cb84b6e94f424afb9e25b392148fe679d4c7d51 diff --git a/appliance/libguestfs-supermin-helper.in b/appliance/libguestfs-supermin-helper.in index 87fb688..d7c8d96 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"