Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/busybox sh
- # Mount the /proc and /sys filesystems.
- mount -t proc none /proc
- mount -t sysfs none /sys
- mount -t devtmpfs none /dev
- # mdev support:
- echo /sbin/mdev > /proc/sys/kernel/hotplug
- mdev -s
- # Do your stuff here.
- echo "This script just mounts and boots the rootfs, nothing else!"
- rescue_shell() {
- echo "Something went wrong. Dropping to a shell."
- exec sh
- }
- # Mount the root filesystem.
- mount -o ro $(findfs UUID=1a7b58fa-e84e-43cc-8743-149f35bea830) /mnt/root || rescue_shell
- # Clean up.
- umount /dev
- umount /proc
- umount /sys
- # Boot the real thing.
- exec switch_root /mnt/root /sbin/init
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement