diff options
| author | Darren Hart <dvhart@linux.intel.com> | 2012-10-25 13:30:02 -0700 |
|---|---|---|
| committer | Darren Hart <dvhart@linux.intel.com> | 2012-10-26 20:24:53 -0700 |
| commit | 0ebdf34f9a0f023f62305bddcbc8427d36f740b4 (patch) | |
| tree | 0a8f7b2ab21a063f27d2cfd5f9ced49453a76f67 | |
| parent | 9fe538c48e6f60fde0728069c95b06671438eeaa (diff) | |
| download | meta-intel-0ebdf34f9a0f023f62305bddcbc8427d36f740b4.tar.gz | |
fri2: Add tiny-init bbappend for devtmpfs and console
When using an initramfs, the default for poky-tiny, the kernel cannot
automatically mount devtmpfs. Ensure it is mounted. This eliminates the
need to create the ptmx device.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
| -rw-r--r-- | meta-fri2/recipes-core/tiny-init/tiny-init.bbappend | 6 | ||||
| -rw-r--r-- | meta-fri2/recipes-core/tiny-init/tiny-init/init | 26 |
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 @@ | |||
| 1 | # Update the init script for the tiny image to manually mount devtmpfs and | ||
| 2 | # ensure the ttyPCH1 device is available for the console. | ||
| 3 | |||
| 4 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
| 5 | |||
| 6 | 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 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Mount the Linux kernel virtual filesystems | ||
| 4 | mount none -t proc /proc | ||
| 5 | mount none -t sysfs /sys | ||
| 6 | |||
| 7 | # Ensure devtmpfs is mounted, it must be done manually with initramfs | ||
| 8 | mount none -t devtmpfs /dev | ||
| 9 | |||
| 10 | # Setup PTY infrastructure | ||
| 11 | mkdir /dev/pts | ||
| 12 | mount none -t devpts /dev/pts | ||
| 13 | |||
| 14 | ifup lo | ||
| 15 | |||
| 16 | # Allow for distro or local customizations | ||
| 17 | if [ -f /etc/rc.local ] ; then | ||
| 18 | source /etc/rc.local | ||
| 19 | fi | ||
| 20 | |||
| 21 | # Become session leader and try to find a real tty (e.g. ttyS0) | ||
| 22 | while true; do | ||
| 23 | setsid cttyhack sh | ||
| 24 | echo "Console sh exited with $?, respawning..." | ||
| 25 | sleep 1 | ||
| 26 | done | ||
