Last active
October 31, 2018 08:42
-
-
Save Gnurou/7190563 to your computer and use it in GitHub Desktop.
A minimal /init script for a Busybox initramfs that mounts a loopback device file from SHIELD's data partition as root and continue booting from it. It allows to have a non-intrusive Linux installation along with Android on SHIELD.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir /proc | |
mkdir /sys | |
mkdir /d | |
/bin/mount /proc | |
/bin/mount /sys | |
echo /sbin/mdev >/proc/sys/kernel/hotplug | |
mdev -s | |
mkdir /roothost | |
mkdir /newroot | |
# Wait for block devices to be detected | |
sleep 5 | |
mount /dev/mmcblk0p12 /roothost | |
mount -oloop /roothost/media/0/alarm-fs.img /newroot | |
mkdir -p /newroot/mnt/userdata | |
mount --move /roothost /newroot/mnt/userdata | |
exec switch_root /newroot /sbin/init |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment