summaryrefslogtreecommitdiff
path: root/layout/initramfs
diff options
context:
space:
mode:
Diffstat (limited to 'layout/initramfs')
-rw-r--r--layout/initramfs/command/.empty0
-rw-r--r--layout/initramfs/dev/.empty0
-rw-r--r--layout/initramfs/etc/.empty0
-rwxr-xr-xlayout/initramfs/init37
-rw-r--r--layout/initramfs/proc/.empty0
-rw-r--r--layout/initramfs/rootfs/.empty0
-rw-r--r--layout/initramfs/sbin/.empty0
-rw-r--r--layout/initramfs/sys/.empty0
8 files changed, 37 insertions, 0 deletions
diff --git a/layout/initramfs/command/.empty b/layout/initramfs/command/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layout/initramfs/command/.empty
diff --git a/layout/initramfs/dev/.empty b/layout/initramfs/dev/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layout/initramfs/dev/.empty
diff --git a/layout/initramfs/etc/.empty b/layout/initramfs/etc/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layout/initramfs/etc/.empty
diff --git a/layout/initramfs/init b/layout/initramfs/init
new file mode 100755
index 0000000..0a7f2de
--- /dev/null
+++ b/layout/initramfs/init
@@ -0,0 +1,37 @@
+#!/command/execlineb -S0
+
+# This initramfs is a stub. It just performs coldplug.
+# Since our rootfs shouldn't require a coldplug to be found,
+# we could do away with the initramfs, but we leave it as an example.
+
+/command/export PATH /command
+/command/cd /
+if { s6-echo "\n initramfs (minimal)\n" }
+
+if { s6-mount -wt sysfs sys /sys }
+if { s6-mount -wt proc proc /proc }
+if { s6-mount -wt devtmpfs dev /dev }
+
+if { /sbin/mdev -s }
+
+if { s6-mount -rt ext4 /dev/%%PARTITION%%1 /rootfs }
+
+if { s6-mount -o move /sys /rootfs/sys }
+if { s6-mount -o move /proc /rootfs/proc }
+if { s6-mount -o move /dev /rootfs/dev }
+
+cd /rootfs
+./command/s6-envdir -I /etc/env
+./command/if
+{
+ ./command/pipeline { ./command/s6-ls -a -x rootfs / }
+ ./command/forstdin -p -d"\n" i
+ ./command/importas -u i i
+ ./command/s6-rmrf /${i}
+}
+./command/if { ./command/s6-mount -o move . / }
+./command/s6-chroot .
+
+./command/tryexec { /sbin/init $@ }
+./command/tryexec { /bin/init $@ }
+/etc/init $@
diff --git a/layout/initramfs/proc/.empty b/layout/initramfs/proc/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layout/initramfs/proc/.empty
diff --git a/layout/initramfs/rootfs/.empty b/layout/initramfs/rootfs/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layout/initramfs/rootfs/.empty
diff --git a/layout/initramfs/sbin/.empty b/layout/initramfs/sbin/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layout/initramfs/sbin/.empty
diff --git a/layout/initramfs/sys/.empty b/layout/initramfs/sys/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layout/initramfs/sys/.empty