summaryrefslogtreecommitdiffstats
path: root/share/files/init.cpio
diff options
context:
space:
mode:
Diffstat (limited to 'share/files/init.cpio')
-rw-r--r--share/files/init.cpio41
1 files changed, 41 insertions, 0 deletions
diff --git a/share/files/init.cpio b/share/files/init.cpio
new file mode 100644
index 0000000..e85a7ef
--- /dev/null
+++ b/share/files/init.cpio
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Copyright (c) 2012 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
+#
+# First script for initial ramfs for OpenSLX linux stateless clients
+#############################################################################
+
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/openslx/bin:/openslx/sbin:/openslx/usr/bin:/openslx/usr/sbin:/openslx/usr/local/bin:/openslx/usr/local/sbin
+
+mkdir -p /run /proc /dev/shm /sys
+
+mount -n -t tmpfs -o 'mode=755' run "/run"
+
+# mount the important standard directories
+[ ! -f /proc/cpuinfo ] && mount -n -t proc proc /proc
+[ ! -d /sys/class ] && mount -n -t sysfs sysfs /sys
+
+mkdir -p /dev/shm/union /dev/shm/uniontmp /rorootfs
+mount -n /mnt/openslx.sqfs /rorootfs
+
+mount -n -t tmpfs none /dev/shm/uniontmp
+
+mount -n -t aufs -o br:/dev/shm/uniontmp:/rorootfs=ro none /mnt
+mkdir -p /mnt/uniontmp
+mount -n --move /dev/shm/uniontmp /mnt/uniontmp
+
+
+for mnt in proc sys run ; do
+ umount -n $mnt
+done
+
+#/bin/sh
+exec /sbin/switch_root -c dev/console /mnt /openslx/bin/sh
+