diff options
author | Adam Miartus <adam.miartus@softhows.eu> | 2020-05-28 15:22:42 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-06-08 13:58:03 -0700 |
commit | 03886017a97a154aa8828fc3984405505486aed9 (patch) | |
tree | 63489515cf7c950dede74fe1f224d8ffedeb460d | |
parent | 58d1f552a068f66d62328737f935285f2378fdf6 (diff) | |
download | meta-openembedded-03886017a97a154aa8828fc3984405505486aed9.tar.gz |
meta-oe toybox-inittab: toybox inittab implementation
adds lightweight inittab scripts for use with toybox
Signed-off-by: Adam Miartus <adam.miartus@softhows.eu>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-core/toybox/toybox-inittab/inittab | 26 | ||||
-rw-r--r-- | meta-oe/recipes-core/toybox/toybox-inittab/rcK | 26 | ||||
-rw-r--r-- | meta-oe/recipes-core/toybox/toybox-inittab/rcS | 27 | ||||
-rw-r--r-- | meta-oe/recipes-core/toybox/toybox-inittab_0.8.2.bb | 50 |
4 files changed, 129 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/toybox/toybox-inittab/inittab b/meta-oe/recipes-core/toybox/toybox-inittab/inittab new file mode 100644 index 0000000000..ffb2f17a66 --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox-inittab/inittab | |||
@@ -0,0 +1,26 @@ | |||
1 | # STARTUP | ||
2 | ::sysinit:/bin/mount -t proc proc /proc | ||
3 | ::sysinit:/bin/mount -t sysfs sysfs /sys | ||
4 | ::sysinit:/bin/mount -t devtmpfs devtmpfs /dev | ||
5 | ::sysinit:/bin/mount -o remount,rw / | ||
6 | ::sysinit:/bin/mkdir -p /dev/pts | ||
7 | ::sysinit:/bin/mount -t devpts devpts /dev/pts | ||
8 | ::sysinit:/bin/mount -a | ||
9 | |||
10 | ::sysinit:/bin/ln -sf /proc/self/fd /dev/fd | ||
11 | ::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin | ||
12 | ::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout | ||
13 | ::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr | ||
14 | |||
15 | ::sysinit:/bin/hostname -F /etc/hostname | ||
16 | |||
17 | ::sysinit:/etc/init.d/rcS | ||
18 | |||
19 | # REBOOT | ||
20 | ::ctrlaltdel:/sbin/reboot | ||
21 | ::shutdown:/etc/init.d/rcK | ||
22 | ::shutdown:/bin/umount -a -r | ||
23 | |||
24 | # RESTART INIT | ||
25 | ::restart:/sbin/init | ||
26 | |||
diff --git a/meta-oe/recipes-core/toybox/toybox-inittab/rcK b/meta-oe/recipes-core/toybox/toybox-inittab/rcK new file mode 100644 index 0000000000..617d3c0c3f --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox-inittab/rcK | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Stop all init scripts in /etc/rc6.d | ||
4 | # executing them in numerical order. | ||
5 | # | ||
6 | for i in /etc/rc6.d/K??*; do | ||
7 | |||
8 | # Ignore dangling symlinks (if any). | ||
9 | [ ! -f "$i" ] && continue | ||
10 | |||
11 | case "$i" in | ||
12 | *.sh) | ||
13 | # Source shell script for speed. | ||
14 | ( | ||
15 | trap - INT QUIT TSTP | ||
16 | set stop | ||
17 | . $i | ||
18 | ) | ||
19 | ;; | ||
20 | *) | ||
21 | # No sh extension, so fork subprocess. | ||
22 | $i stop | ||
23 | ;; | ||
24 | esac | ||
25 | done | ||
26 | |||
diff --git a/meta-oe/recipes-core/toybox/toybox-inittab/rcS b/meta-oe/recipes-core/toybox/toybox-inittab/rcS new file mode 100644 index 0000000000..b8e29855d4 --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox-inittab/rcS | |||
@@ -0,0 +1,27 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Start all init scripts in /etc/rcS.d and /etc/rc5.d | ||
4 | # executing them in numerical order. | ||
5 | # | ||
6 | |||
7 | for i in /etc/rcS.d/S??* /etc/rc5.d/S??* ;do | ||
8 | |||
9 | # Ignore dangling symlinks (if any). | ||
10 | [ ! -f "$i" ] && continue | ||
11 | |||
12 | case "$i" in | ||
13 | *.sh) | ||
14 | # Source shell script for speed. | ||
15 | ( | ||
16 | trap - INT QUIT TSTP | ||
17 | set start | ||
18 | . $i | ||
19 | ) | ||
20 | ;; | ||
21 | *) | ||
22 | # No sh extension, so fork subprocess. | ||
23 | $i start | ||
24 | ;; | ||
25 | esac | ||
26 | done | ||
27 | |||
diff --git a/meta-oe/recipes-core/toybox/toybox-inittab_0.8.2.bb b/meta-oe/recipes-core/toybox/toybox-inittab_0.8.2.bb new file mode 100644 index 0000000000..5e5a10b896 --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox-inittab_0.8.2.bb | |||
@@ -0,0 +1,50 @@ | |||
1 | SUMMARY = "Toybox Inittab Configuration" | ||
2 | LICENSE = "BSD-0-Clause" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-0-Clause;md5=81eeb0083e31f11ab1e33ded846d521c" | ||
4 | |||
5 | SRC_URI = "\ | ||
6 | file://inittab \ | ||
7 | file://rcK \ | ||
8 | file://rcS \ | ||
9 | " | ||
10 | |||
11 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
12 | |||
13 | RCONFLICTS_${PN} = "\ | ||
14 | busybox-inittab \ | ||
15 | sysvinit-inittab \ | ||
16 | " | ||
17 | |||
18 | do_patch[noexec] = "1" | ||
19 | |||
20 | do_configure() { | ||
21 | # copy over files now to have a fresh start on each config | ||
22 | for file in ${SRC_URI}; do | ||
23 | cp ${WORKDIR}/${file/file:\/\//} ${S} | ||
24 | done | ||
25 | |||
26 | echo "# generated by bitbake recipe ${PN}" >> ${S}/inittab | ||
27 | for console in "${SERIAL_CONSOLES}"; do | ||
28 | param=$(echo ${console} | sed s/\;/\ /g) | ||
29 | name=$(echo ${param} | cut -d' ' -f2) | ||
30 | echo "$name::respawn:${base_sbindir}/getty ${param}" >> ${S}/inittab | ||
31 | done | ||
32 | } | ||
33 | |||
34 | do_compile[noexec] = "1" | ||
35 | |||
36 | do_install() { | ||
37 | install -d ${D}${sysconfdir} | ||
38 | install -D -m 0644 ${S}/inittab ${D}${sysconfdir}/inittab | ||
39 | |||
40 | install -d ${D}${sysconfdir}/init.d | ||
41 | install -D -m 0744 ${S}/rcK ${D}${sysconfdir}/init.d/rcK | ||
42 | install -D -m 0744 ${S}/rcS ${D}${sysconfdir}/init.d/rcS | ||
43 | } | ||
44 | |||
45 | FILES_${PN} = "\ | ||
46 | ${sysconfdir}/inittab \ | ||
47 | ${sysconfdir}/init.d/rcK \ | ||
48 | ${sysconfdir}/init.d/rcS \ | ||
49 | " | ||
50 | |||