summaryrefslogtreecommitdiff
path: root/recipes/pivotinit/spitz/init
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/pivotinit/spitz/init')
-rw-r--r--recipes/pivotinit/spitz/init25
1 files changed, 25 insertions, 0 deletions
diff --git a/recipes/pivotinit/spitz/init b/recipes/pivotinit/spitz/init
new file mode 100644
index 0000000000..41e4aff0db
--- /dev/null
+++ b/recipes/pivotinit/spitz/init
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+mount -t proc proc /proc
+mount -o remount,rw /
+cardmgr -o
+umount /proc
+echo Mounting hda1.
+mount -t ext3 /dev/hda1 /media/hdd
+
+# For some reason the Spitz tar doesn't create the devices.
+if [ ! -b /media/hdd/dev/hda1 ]; then
+ echo Creating non existant device files.
+ /media/hdd/sbin/makedevs -D /media/hdd/etc/device_table -r /media/hdd/
+fi
+
+if [ -e /media/hdd/sbin/init -o -L /media/hdd/sbin/init ]; then
+ echo "Found /sbin/init on HD; pivoting."
+ cd /media/hdd
+ pivot_root . media/realroot
+ cd /
+ exec /sbin/init
+fi
+
+echo Dropping to a shell due to problems.
+exec /bin/sh