fi
# mounting
-header "Mounting proc & sys filesystem in deployed image"
+
+header "Mounting virutal filesystems in deployed image"
+msg -n "Mounting /dev to /cloner/mnt/dev"
+mount -o bind /dev /cloner/mnt/dev
+if [ "$?" = "0" ]
+then
+ ok_msg
+else
+ fail_msg
+fi
+
msg -n "Mounting /cloner/mnt/proc"
mount -t proc none /cloner/mnt/proc
if [ "$?" = "0" ]
# fix the filesystem UUID issues
/etc/cloner3/uuid_fix.sh
+if [ "$?" != "0" ]
+then
+ clone_fatal_error "Can't fix UUIDs"
+fi
header "Installing bootloader"
if [ -e /cloner/setup/efi ]
then
+
EFIBOOTMGR=/usr/sbin/efibootmgr
header "Setting up EFI"
+ msg -n "Mounting EFIvars filesystem"
+ mount -t efivarfs none /cloner/mnt/sys/firmware/efi/efivars
+ if [ "$?" = "0" ]
+ then
+ ok_msg
+ else
+ fail_msg
+ clone_fatal_error "Can't mount efivars filesystem"
+ fi
+
EFIARGS=`cat /cloner/setup/efi`
msg -n "Running efibootmgr ${EFIARGS}"
server_log "Running efibootmgr ${EFIARGS}" "${_node}"
- chroot /cloner/mnt ${EFIBOOTMGR} ${EFIARGS} >> /tmp/stdout.log 2>> /tmp/stderr.log
+ chroot /cloner/mnt ${EFIBOOTMGR} ${EFIARGS} >> /tmp/stdout.log 2>> /tmp/stderr.log
if [ "$?" = "0" ]
then
ok_msg
clone_fatal_error "Failed to run ${EFIBOOTMGR} ${EFIARGS}"
fi
+ umount /cloner/mnt/sys/firmware/efi/efivars
+
GRUB_MKCONFIG=""
GRUB2_CONFIG="/etc/grub2-efi.cfg"
if [ -x /cloner/mnt/sbin/grub2-mkconfig ]
umount /cloner/mnt/proc
umount /cloner/mnt/sys
+umount /cloner/mnt/dev
while read line
do
if [ "${NEW_UUID}" = "" ]
then
clone_fatal_error "Can't find new UUID for ${DEVICE}"
- return 1
+ exit 1
fi
msg -n " found ${ANSI_BLUE}${NEW_UUID}${ANSI_DONE}"
ok_msg
if [ "$?" != "0" ]
then
clone_fatal_error "Can't convert UUIDs from old fstab to new."
+ exit 1
fi
if [ -e /tmp/fstab.converted ]
ok_msg
else
clone_fatal_error "Can't update initrd for ${kver} with dracut"
+ exit 1
fi
done
fi
fi
+exit 0