summaryrefslogtreecommitdiffstats
path: root/liveinit
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-03-11 16:25:22 +0100
committer Eric Hameleers <alien@slackware.com>2016-03-11 16:25:22 +0100
commitb29a08b43fd682594ca23521c09e8f06bee20ddc (patch)
tree7879897f4be5c9042ba781c1d894228beeb88065 /liveinit
parentb38517c342858d6a38cc264ccf7d911b32044ff4 (diff)
downloadliveslak-b29a08b43fd682594ca23521c09e8f06bee20ddc.tar.gz
liveslak-b29a08b43fd682594ca23521c09e8f06bee20ddc.tar.xz
liveinit: put the 'rescue shell' commands into a function call.
Diffstat (limited to 'liveinit')
-rwxr-xr-xliveinit33
1 files changed, 21 insertions, 12 deletions
diff --git a/liveinit b/liveinit
index 7436cab..21bf588 100755
--- a/liveinit
+++ b/liveinit
@@ -191,6 +191,24 @@ debugit () {
return
}
+rescue() {
+ if [ "x$1" != "x" ]; then
+ echo "$1"
+ fi
+ echo
+ echo "RESCUE mode"
+ echo
+ echo " You can try to fix or rescue your system now. If you want"
+ echo " to boot into your fixed system, mount your root filesystem"
+ echo " read-only under /mnt:"
+ echo
+ echo " # mount -o ro -t filesystem root_device /mnt"
+ echo
+ echo " Type 'exit' when things are done."
+ echo
+ /bin/sh
+}
+
# If udevd is available, use it to generate block devices
# else use mdev to read sysfs and generate the needed devices
if [ -x /sbin/udevd -a -x /sbin/udevadm ]; then
@@ -428,6 +446,8 @@ if [ "$RESCUE" = "" ]; then
else
echo "${MARKER}: No live media found... trouble ahead."
echo "${MARKER}: Try adding \"rootdelay=20\" to the boot command."
+ debugit
+ rescue
fi
debugit
@@ -750,18 +770,7 @@ EOT
/bin/sh
fi
else
- echo
- echo "RESCUE mode"
- echo
- echo " You can try to fix or rescue your system now. If you want"
- echo " to boot into your fixed system, mount your root filesystem"
- echo " read-only under /mnt:"
- echo
- echo " # mount -o ro -t filesystem root_device /mnt"
- echo
- echo " Type 'exit' when things are done."
- echo
- /bin/sh
+ rescue
fi
# Need to make sure OPTIONS+="db_persist" exists for all dm devices