summaryrefslogtreecommitdiffstats
path: root/meta-fri2
diff options
context:
space:
mode:
Diffstat (limited to 'meta-fri2')
-rw-r--r--meta-fri2/recipes-core/tiny-init/tiny-init.bbappend6
-rw-r--r--meta-fri2/recipes-core/tiny-init/tiny-init/init26
2 files changed, 32 insertions, 0 deletions
diff --git a/meta-fri2/recipes-core/tiny-init/tiny-init.bbappend b/meta-fri2/recipes-core/tiny-init/tiny-init.bbappend
new file mode 100644
index 00000000..89416dc2
--- /dev/null
+++ b/meta-fri2/recipes-core/tiny-init/tiny-init.bbappend
@@ -0,0 +1,6 @@
+# Update the init script for the tiny image to manually mount devtmpfs and
+# ensure the ttyPCH1 device is available for the console.
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PRINC := "${@int(PRINC) + 1}"
diff --git a/meta-fri2/recipes-core/tiny-init/tiny-init/init b/meta-fri2/recipes-core/tiny-init/tiny-init/init
new file mode 100644
index 00000000..4b78f017
--- /dev/null
+++ b/meta-fri2/recipes-core/tiny-init/tiny-init/init
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Mount the Linux kernel virtual filesystems
+mount none -t proc /proc
+mount none -t sysfs /sys
+
+# Ensure devtmpfs is mounted, it must be done manually with initramfs
+mount none -t devtmpfs /dev
+
+# Setup PTY infrastructure
+mkdir /dev/pts
+mount none -t devpts /dev/pts
+
+ifup lo
+
+# Allow for distro or local customizations
+if [ -f /etc/rc.local ] ; then
+ source /etc/rc.local
+fi
+
+# Become session leader and try to find a real tty (e.g. ttyS0)
+while true; do
+ setsid cttyhack sh
+ echo "Console sh exited with $?, respawning..."
+ sleep 1
+done