Move custom configs below recovery shell

For safety it would be better if we source any custom configs after the
recovery shell in init. That way we can recover from any config mistakes.
This commit is contained in:
Kyle Rankin 2018-12-06 16:34:47 -08:00
parent 8b8be510a2
commit ab0f9dd32e
No known key found for this signature in database
GPG Key ID: 555577116BFA74B9

View File

@ -49,18 +49,6 @@ if [ "$CONFIG_LINUXBOOT" = "y" ]; then
/bin/uefi-init
fi
combine_configs
. /tmp/config
# Add our boot devices into the /etc/fstab, if they are defined
# in the configuration file.
if [ ! -z "$CONFIG_BOOT_DEV" ]; then
echo >> /etc/fstab "$CONFIG_BOOT_DEV /boot auto defaults,ro 0 0"
fi
if [ ! -z "$CONFIG_USB_BOOT_DEV" ]; then
echo >> /etc/fstab "$CONFIG_USB_BOOT_DEV /media auto defaults,ro 0 0"
fi
/bin/key-init
# Setup recovery serial shell
@ -91,6 +79,18 @@ if [ "$boot_option" = "r" ]; then
exit
fi
combine_configs
. /tmp/config
# Add our boot devices into the /etc/fstab, if they are defined
# in the configuration file.
if [ ! -z "$CONFIG_BOOT_DEV" ]; then
echo >> /etc/fstab "$CONFIG_BOOT_DEV /boot auto defaults,ro 0 0"
fi
if [ ! -z "$CONFIG_USB_BOOT_DEV" ]; then
echo >> /etc/fstab "$CONFIG_USB_BOOT_DEV /media auto defaults,ro 0 0"
fi
if [ ! -x "$CONFIG_BOOTSCRIPT" -a ! -x "$CONFIG_BOOTSCRIPT_NETWORK" ]; then
recovery 'Boot script missing? Entering recovery shell'
else