aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <somasis@exherbo.org>2016-02-11 02:29:35 -0500
committerKylie McClain <somasis@exherbo.org>2016-02-11 02:29:42 -0500
commit9f7a028aded382040f23657f35037a87a6e6b88b (patch)
tree7a85ce9e4774a5460968d46c8d1018a2c0e95bb9
parentcbf0a9139d97e41a07c67b08c1c4dc4b337684d3 (diff)
downloadlighter-9f7a028aded382040f23657f35037a87a6e6b88b.tar.gz
lighter-9f7a028aded382040f23657f35037a87a6e6b88b.tar.xz
lighter-9f7a028aded382040f23657f35037a87a6e6b88b.zip
init: rescue
-rwxr-xr-xskel/init6
1 files changed, 4 insertions, 2 deletions
diff --git a/skel/init b/skel/init
index e3b295e..62e8b52 100755
--- a/skel/init
+++ b/skel/init
@@ -1,6 +1,5 @@
#!/bin/sh
-touch /proc/mounts
mount -t proc proc /proc
mount -t devtmpfs devtmpfs /dev
mount -t sysfs sysfs /sys
@@ -13,7 +12,8 @@ arg() {
echo "$args" | grep -q "^$1$"
}
rescue() {
- sh
+ echo "Entering rescue shell."
+ setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
}
root=$(var root)
@@ -24,6 +24,8 @@ fsck -p "$root" || rescue
mount -o ro $(findfs "$root") /mnt/root || rescue
+arg rescue && rescue
+
umount /proc /sys /dev
exec switch_root /mnt/root "$init"