aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro/recipes-core
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-09-13 12:31:52 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2013-09-13 12:31:52 +0300
commitc436e1709de0286a825ed80c5f254de2c1671833 (patch)
tree8021e7d5def777e9d9522cbfb659a39b64f2760d /meta-linaro/recipes-core
parent8567caf5ee378a88cd1347392e838edff338e903 (diff)
downloadmeta-linaro-c436e1709de0286a825ed80c5f254de2c1671833.tar.gz
linaro-image-minimal-rootfs: add custom init script
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'meta-linaro/recipes-core')
-rwxr-xr-xmeta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh43
-rw-r--r--meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb13
2 files changed, 56 insertions, 0 deletions
diff --git a/meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh b/meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh
new file mode 100755
index 00000000..c3f24d84
--- /dev/null
+++ b/meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+HOME=/root
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+PS1="linaro-test [rc=$(echo \$?)]# "
+export HOME PS1 PATH
+
+early_setup() {
+ mkdir /proc /sys /tmp /run
+ mount -t proc proc /proc
+ mount -t sysfs sysfs /sys
+
+ ln -s /run /var/run
+
+ mknod /dev/ttyO0 c 253 0
+ mknod /dev/ttyO2 c 253 2
+ mknod /dev/ttyAMA0 c 204 64
+ mknod /dev/ttyAMA2 c 204 66
+ mknod /dev/ttySAC2 c 204 66
+}
+
+read_args() {
+ [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
+ for arg in $CMDLINE; do
+ optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
+ case $arg in
+ console=*)
+ tty=${arg#console=}
+ tty=${tty#/dev/}
+
+ case $tty in
+ tty[a-zA-Z]* )
+ port=${tty%%,*}
+ esac ;;
+ debug) set -x ;;
+ esac
+ done
+}
+
+early_setup
+read_args
+
+exec setsid sh -l </dev/${port} >/dev/${port} 2>&1
diff --git a/meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb b/meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb
new file mode 100644
index 00000000..4e5ca09a
--- /dev/null
+++ b/meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb
@@ -0,0 +1,13 @@
+DESCRIPTION = "Simple init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "file://init-boot-linaro.sh"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-boot-linaro.sh ${D}/init
+}
+
+inherit allarch
+
+FILES_${PN} += " /init "