+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
+ exit 1
+fi
+
+for f in $kernels; do