Skip to content

Instantly share code, notes, and snippets.

/init Secret

Created December 29, 2017 02:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8787dd24b6fc7e061b6637d9f61c2f8f to your computer and use it in GitHub Desktop.
Save anonymous/8787dd24b6fc7e061b6637d9f61c2f8f to your computer and use it in GitHub Desktop.
#!/bin/busybox sh
mount -t proc none /proc
mount -t sysfs none /sys
mount -t tmpfs tmpfs /mnt
mkdir /mnt/s /mnt/u /mnt/w /mnt/m
mv squash /mnt
mount -t squashfs /mnt/squash /mnt/s
mount -t overlay overlay -olowerdir=/mnt/s,upperdir=/mnt/u,workdir=/mnt/w /mnt/m
umount /proc
umount /sys
exec switch_root /mnt/m /sbin/init || exec sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment