chiark / gitweb /
Copied direct from http://whiteboard.ping.se/Android/Debian
authorJonathan Amery <jdamery+zgit@ysolde.ucam.org>
Mon, 26 Jan 2015 15:21:21 +0000 (15:21 +0000)
committerJonathan Amery <jdamery+zgit@ysolde.ucam.org>
Mon, 26 Jan 2015 15:21:21 +0000 (15:21 +0000)
debinit.sh [new file with mode: 0644]

diff --git a/debinit.sh b/debinit.sh
new file mode 100644 (file)
index 0000000..aabda59
--- /dev/null
@@ -0,0 +1,25 @@
+#!/sbin/busybox sh
+
+# initramfs pre-boot init script
+
+# Mount the /proc and /sys filesystems
+/sbin/busybox mount -t proc none /proc
+/sbin/busybox mount -t sysfs none /sys
+/sbin/busybox mount -t tmpfs none /dev
+
+# Something (what?) needs a few cycles here
+/sbin/busybox sleep 1
+
+# Populate /dev
+/sbin/busybox mdev -s
+
+# Mount the root filesystem, second partition on micro SDcard
+/sbin/busybox mount -t ext4 -o noatime,nodiratime,errors=panic /dev/mmcblk1p2 /mnt/root
+
+# Clean up
+/sbin/busybox umount /proc
+/sbin/busybox umount /sys
+/sbin/busybox umount /dev
+
+# Transfer root to SDcard
+exec /sbin/busybox switch_root /mnt/root /etc/init