From ab0f9dd32e1847d784d1cba265d8303ea90ddb7d Mon Sep 17 00:00:00 2001 From: Kyle Rankin Date: Thu, 6 Dec 2018 16:34:47 -0800 Subject: [PATCH] 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. --- initrd/init | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/initrd/init b/initrd/init index 4b4eefb2..a4477674 100755 --- a/initrd/init +++ b/initrd/init @@ -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