diff --git a/initrd/bin/gui-init b/initrd/bin/gui-init index eecc1d01..f9f12f68 100755 --- a/initrd/bin/gui-init +++ b/initrd/bin/gui-init @@ -8,15 +8,22 @@ CONFIG_BOOT_GUI_MENU_NAME='Heads Boot Menu' mount_boot() { - # ensure default boot device is set - if [ ! -e "$CONFIG_BOOT_DEV" ]; then - if (whiptail $CONFIG_ERROR_BG_COLOR --clear --title "ERROR: $CONFIG_BOOT_DEV missing!" \ - --yesno "The /boot device $CONFIG_BOOT_DEV could not be found!\n\nYou will need to configure the correct device for /boot.\n\nWould you like to configure the /boot device now?" 30 90) then - config-gui.sh - fi + # Mount local disk if it is not already mounted - elif ! grep -q /boot /proc/mounts ; then - mount -o ro /boot + while ! grep -q /boot /proc/mounts ; do + # ensure default boot device is set + if [ ! -e "$CONFIG_BOOT_DEV" ]; then + if (whiptail $CONFIG_ERROR_BG_COLOR --clear --title "ERROR: $CONFIG_BOOT_DEV missing!" \ + --yesno "The /boot device $CONFIG_BOOT_DEV could not be found!\n\nYou will need to configure the correct device for /boot.\n\nWould you like to configure the /boot device now?" 30 90) then + config-gui.sh + else + # exit to main menu + break + fi + fi + # update CONFIG_BOOT_DEV + . /tmp/config + mount -o ro $CONFIG_BOOT_DEV /boot if [ $? -ne 0 ]; then if (whiptail $CONFIG_ERROR_BG_COLOR --clear --title 'ERROR: Cannot mount /boot' \ --yesno "The /boot partition at $CONFIG_BOOT_DEV could not be mounted!\n\nWould you like to configure the /boot device now?" 30 90) then @@ -25,7 +32,7 @@ mount_boot() recovery "Unable to mount /boot" fi fi - fi + done } verify_global_hashes() {