Better checking of when a kernel is installed for dracut creating
Kyle Sheumaker [Mon, 24 Sep 2018 23:08:16 +0000 (18:08 -0500)]
etc/cloner3/uuid_fix.sh

index 847ec31..ad49bff 100755 (executable)
@@ -114,16 +114,22 @@ then
        then
                for kver in `ls -1 /cloner/mnt/lib/modules`
                do
-                       msg -n "Updating dracut for kernel ${ANSI_BLUE}${kver}${ANSI_DONE}"
-                       chroot /cloner/mnt /usr/sbin/dracut -f --kver=${kver} \
-                               >> /tmp/stdout.log 2> /tmp/stderr.log
-
-                       if [ "$?" = "0" ]
+                       if [ -e /cloner/mnt/boot/vmlinuz-${kver} ]
                        then
-                               ok_msg
+                               msg -n "Updating dracut for kernel ${ANSI_BLUE}${kver}${ANSI_DONE}"
+                               chroot /cloner/mnt /usr/sbin/dracut -f --kver=${kver} \
+                                       >> /tmp/stdout.log 2> /tmp/stderr.log
+       
+                               if [ "$?" = "0" ]
+                               then
+                                       ok_msg
+                               else
+                                       clone_fatal_error "Can't update initrd for ${kver} with dracut"
+                                       exit 1
+                               fi
                        else
-                               clone_fatal_error "Can't update initrd for ${kver} with dracut"
-                               exit 1
+                               msg -n "Skipping ${ANSI_BLUE}${kver}${ANSI_DONE} no kernel in /boot"
+                               ok_msg
                        fi
                done
        fi