From: Matthew Booth Date: Fri, 4 Dec 2009 15:38:09 +0000 (+0000) Subject: appliance: Fix code which gets list of kernels. X-Git-Tag: 1.0.80~8 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=f025a9c41dca06452e03a7f0e55cda0b6764038c;p=libguestfs.git appliance: Fix code which gets list of kernels. The first 'ls' command was failing, so the second 'ls' command would never run at all. --- diff --git a/appliance/libguestfs-supermin-helper.in b/appliance/libguestfs-supermin-helper.in index 4d8fd04..ab3aad5 100755 --- a/appliance/libguestfs-supermin-helper.in +++ b/appliance/libguestfs-supermin-helper.in @@ -38,7 +38,10 @@ initrd="$3" # without arch second. arch=$(echo "@host_cpu@" | sed 's/^i.86$/i?86/') -kernels=$(ls -1dvr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen; ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen) +kernels=$( + ls -1dvr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen ||: ; + ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen +) if [ -z "$kernels" ]; then echo "$0: failed to find a suitable kernel in /boot directory" >&2