diff options
Diffstat (limited to 'meta-linaro/recipes-core/initrdscripts')
-rwxr-xr-x | meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh | 41 | ||||
-rw-r--r-- | meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb | 13 |
2 files changed, 54 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 0000000..2af2f92 --- /dev/null +++ b/meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | HOME=/root | ||
4 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
5 | PS1="linaro-test [rc=$(echo \$?)]# " | ||
6 | export HOME PS1 PATH | ||
7 | |||
8 | early_setup() { | ||
9 | mkdir -p /proc /sys /tmp /run | ||
10 | mount -t proc proc /proc | ||
11 | mount -t sysfs sysfs /sys | ||
12 | mount -t devtmpfs none /dev | ||
13 | |||
14 | ln -s /run /var/run | ||
15 | |||
16 | chmod 0666 /dev/tty* | ||
17 | chown root:tty /dev/tty* | ||
18 | } | ||
19 | |||
20 | read_args() { | ||
21 | [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline` | ||
22 | for arg in $CMDLINE; do | ||
23 | optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'` | ||
24 | case $arg in | ||
25 | console=*) | ||
26 | tty=${arg#console=} | ||
27 | tty=${tty#/dev/} | ||
28 | |||
29 | case $tty in | ||
30 | tty[a-zA-Z]* ) | ||
31 | port=${tty%%,*} | ||
32 | esac ;; | ||
33 | debug) set -x ;; | ||
34 | esac | ||
35 | done | ||
36 | } | ||
37 | |||
38 | early_setup | ||
39 | read_args | ||
40 | |||
41 | setsid sh </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 0000000..4e5ca09 --- /dev/null +++ b/meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb | |||
@@ -0,0 +1,13 @@ | |||
1 | DESCRIPTION = "Simple init script" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
4 | |||
5 | SRC_URI = "file://init-boot-linaro.sh" | ||
6 | |||
7 | do_install() { | ||
8 | install -m 0755 ${WORKDIR}/init-boot-linaro.sh ${D}/init | ||
9 | } | ||
10 | |||
11 | inherit allarch | ||
12 | |||
13 | FILES_${PN} += " /init " | ||