X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=init;h=5d24645178ab998a6d6beab929f62d4950e0788e;hb=a191bd11218f495873109b8de57814b9756d92b6;hp=e1e58d358689d411e33c0bff97135df3711b988a;hpb=a741ee7426b9870b714bd92f67b486c2d0f9b2aa;p=max%2Finitramfs.git diff --git a/init b/init index e1e58d3..5d24645 100755 --- a/init +++ b/init @@ -1,32 +1,34 @@ #!/bin/busybox sh rescue_shell() { - echo "Something went wrong. Dropping you to a shell" - busybox --install -s + /bin/busybox echo "Something went wrong. Dropping you to a shell" + /bin/busybox --install -s exec /bin/sh } # Mount filesystems -mount -t devtmpfs none /dev || rescue_shell -mount -t proc none /proc || rescue_shell -mount -t sysfs none /sys || rescue_shell -echo 0 > /proc/sys/kernel/printk +/bin/busybox mount -t devtmpfs none /dev || rescue_shell +/bin/busybox mount -t proc none /proc || rescue_shell +/bin/busybox mount -t sysfs none /sys || rescue_shell +#/bin/busybox echo 0 > /proc/sys/kernel/printk || rescue_shell # Unlock luks device -cryptsetup -T 5 luksOpen /dev/sdb3 lukssdb3 || rescue_shell +/sbin/cryptsetup -T 5 luksOpen /dev/sdb3 lukssdb3 || rescue_shell + +rescue_shell # Create LVM nodes /dev/main/root etc -lvm vgscan --mknodes || rescue_shell -lvm lvchange -a ly main/root || rescue_shell -lvm lvchange -a ly main/home || rescue_shell -lvm lvchange -a ly main/swap || rescue_shell -lvm vgscan --mknodes || rescue_shell +/sbin/lvm vgscan --mknodes || rescue_shell +/sbin/lvm lvchange -a ly main/root || rescue_shell +/sbin/lvm lvchange -a ly main/home || rescue_shell +/sbin/lvm lvchange -a ly main/swap || rescue_shell +/sbin/lvm vgscan --mknodes || rescue_shell # Mount root fs -mount -o ro /dev/main/root /mnt/root || rescue_shell +/bin/busybox mount -o ro /dev/main/root /mnt/root || rescue_shell # Unmount filesystems -unmount /dev +/bin/busybox unmount /dev # Boot system exec switch_root /mnt/root /sbin/init