diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-12-18 18:23:42 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-12-20 00:03:05 +0000 |
commit | 8736019681958a42a78c91045673136e542263ac (patch) | |
tree | ea88b77c7dee3487f9fe7e930ca30ca531ab4bb4 /meta/recipes-core | |
parent | 5cb971b4fd393a5bc43b9010a77f98bd19343a3f (diff) | |
download | poky-8736019681958a42a78c91045673136e542263ac.tar.gz |
initscripts: Use initctl on sysvinit only
Check if init system is sysvinit to recreate initctl, this ensures that
it can be used with busybox init system as well
(From OE-Core rev: 15c467d0206ee30fe708f76b7d5e0033ab687475)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rwxr-xr-x | meta/recipes-core/initscripts/initscripts-1.0/mountall.sh | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh index c719be5d9a..2839d57cbe 100755 --- a/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh +++ b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh | |||
@@ -19,15 +19,21 @@ | |||
19 | test "$VERBOSE" != no && echo "Mounting local filesystems..." | 19 | test "$VERBOSE" != no && echo "Mounting local filesystems..." |
20 | mount -at nonfs,nosmbfs,noncpfs 2>/dev/null | 20 | mount -at nonfs,nosmbfs,noncpfs 2>/dev/null |
21 | 21 | ||
22 | # | 22 | |
23 | # We might have mounted something over /dev, see if /dev/initctl is there. | 23 | # We might have mounted something over /run; see if |
24 | # | 24 | # /dev/initctl is present. Look for |
25 | if test ! -p /dev/initctl | 25 | # /sbin/init.sysvinit to verify that sysvinit (and |
26 | then | 26 | # not busybox or systemd) is installed as default init). |
27 | rm -f /dev/initctl | 27 | INITCTL="/dev/initctl" |
28 | mknod -m 600 /dev/initctl p | 28 | if [ ! -p "$INITCTL" ] && [ "${INIT_SYSTEM}" = "sysvinit" ]; then |
29 | # Create new control channel | ||
30 | rm -f "$INITCTL" | ||
31 | mknod -m 600 "$INITCTL" p | ||
32 | |||
33 | # Reopen control channel. | ||
34 | PID="$(pidof -s /sbin/init || echo 1)" | ||
35 | [ -n "$PID" ] && kill -s USR1 "$PID" | ||
29 | fi | 36 | fi |
30 | kill -USR1 1 | ||
31 | 37 | ||
32 | # | 38 | # |
33 | # Execute swapon command again, in case we want to swap to | 39 | # Execute swapon command again, in case we want to swap to |