supermin: Fix code which gets list of kernels.
authorRichard Jones <rjones@redhat.com>
Fri, 4 Dec 2009 15:39:55 +0000 (15:39 +0000)
committerRichard Jones <rjones@redhat.com>
Fri, 4 Dec 2009 15:39:55 +0000 (15:39 +0000)
(Same patch applied to libguestfs).

febootstrap-supermin-helper.sh

index 0849b1f..f6a54e6 100755 (executable)
@@ -81,7 +81,10 @@ rm -f "$kernel" "$initrd"
 # 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