-
- #!/bin/busybox sh
-
- rescue_shell() {
- echo "$@"
- echo "Something went wrong. Dropping you to a shell."
- busybox --install -s
- exec /bin/sh
- }
-
- mount_root() {
- echo "scanning for btrfs filesystems.... will take about 5-10 seconds"
- /sbin/btrfs device scan
- echo "mounting /mnt/root"
- mount /mnt/root
- }
-
- mount -t proc none /proc
- mount -t sysfs none /sys
- mount -t devtmpfs none /dev
-
- echo 0 > /proc/sys/kernel/printk
- clear
- mount_root || rescue_shell "Error with uuidlabel_root"
-
- umount /proc
- umount /sys
- umount /dev
-
- exec switch_root /mnt/root /sbin/init
-