spacepaste

  1.  
  2. #!/bin/busybox sh
  3. rescue_shell() {
  4. echo "$@"
  5. echo "Something went wrong. Dropping you to a shell."
  6. busybox --install -s
  7. exec /bin/sh
  8. }
  9. mount_root() {
  10. echo "scanning for btrfs filesystems.... will take about 5-10 seconds"
  11. /sbin/btrfs device scan
  12. echo "mounting /mnt/root"
  13. mount /mnt/root
  14. }
  15. mount -t proc none /proc
  16. mount -t sysfs none /sys
  17. mount -t devtmpfs none /dev
  18. echo 0 > /proc/sys/kernel/printk
  19. clear
  20. mount_root || rescue_shell "Error with uuidlabel_root"
  21. umount /proc
  22. umount /sys
  23. umount /dev
  24. exec switch_root /mnt/root /sbin/init
  25.