* [PATCH 1/3] rcS: Define identifier for init system used
@ 2020-12-19 2:23 Khem Raj
2020-12-19 2:23 ` [PATCH v2 2/3] initscripts: Use initctl on sysvinit only Khem Raj
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Khem Raj @ 2020-12-19 2:23 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj, Sinan Kaya
This will help in defining init system specific portions of initscripts
which are shared
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Sinan Kaya <okaya@kernel.org>
---
meta/recipes-core/busybox/files/rcS.default | 3 ++-
meta/recipes-core/sysvinit/sysvinit/rcS-default | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-core/busybox/files/rcS.default b/meta/recipes-core/busybox/files/rcS.default
index 262cad7d2a..66513daf2d 100644
--- a/meta/recipes-core/busybox/files/rcS.default
+++ b/meta/recipes-core/busybox/files/rcS.default
@@ -1 +1,2 @@
-# SULOGIN = "yes"
+# Indicate init system type
+INIT_SYSTEM=busybox
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default
index 709cdf6ec5..e608a77c75 100644
--- a/meta/recipes-core/sysvinit/sysvinit/rcS-default
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -27,3 +27,6 @@ VOLATILE_ENABLE_CACHE=yes
# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
# Normally you should not change this value.
ROOTFS_READ_ONLY=no
+# rcS is also used when using busybox init and shares initscripts, some initscripts
+# need to have specific behavior depending on init system
+INIT_SYSTEM=sysvinit
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v2 2/3] initscripts: Use initctl on sysvinit only
2020-12-19 2:23 [PATCH 1/3] rcS: Define identifier for init system used Khem Raj
@ 2020-12-19 2:23 ` Khem Raj
2020-12-19 2:23 ` [PATCH 3/3] busybox: Sync rcS.default with sysvinit Khem Raj
2020-12-19 2:52 ` [PATCH 1/3] rcS: Define identifier for init system used Sinan Kaya
2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2020-12-19 2:23 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj, Sinan Kaya
Check if init system is sysvinit to recreate initctl, this ensures that
it can be used with busybox init system as well
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Sinan Kaya <okaya@kernel.org>
---
v2: Use INIT_SYSTEM to identify init system
.../initscripts/initscripts-1.0/mountall.sh | 22 ++++++++++++-------
1 file 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 @@
test "$VERBOSE" != no && echo "Mounting local filesystems..."
mount -at nonfs,nosmbfs,noncpfs 2>/dev/null
-#
-# We might have mounted something over /dev, see if /dev/initctl is there.
-#
-if test ! -p /dev/initctl
-then
- rm -f /dev/initctl
- mknod -m 600 /dev/initctl p
+
+# We might have mounted something over /run; see if
+# /dev/initctl is present. Look for
+# /sbin/init.sysvinit to verify that sysvinit (and
+# not busybox or systemd) is installed as default init).
+INITCTL="/dev/initctl"
+if [ ! -p "$INITCTL" ] && [ "${INIT_SYSTEM}" = "sysvinit" ]; then
+ # Create new control channel
+ rm -f "$INITCTL"
+ mknod -m 600 "$INITCTL" p
+
+ # Reopen control channel.
+ PID="$(pidof -s /sbin/init || echo 1)"
+ [ -n "$PID" ] && kill -s USR1 "$PID"
fi
-kill -USR1 1
#
# Execute swapon command again, in case we want to swap to
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 3/3] busybox: Sync rcS.default with sysvinit
2020-12-19 2:23 [PATCH 1/3] rcS: Define identifier for init system used Khem Raj
2020-12-19 2:23 ` [PATCH v2 2/3] initscripts: Use initctl on sysvinit only Khem Raj
@ 2020-12-19 2:23 ` Khem Raj
2020-12-19 2:52 ` [PATCH 1/3] rcS: Define identifier for init system used Sinan Kaya
2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2020-12-19 2:23 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-core/busybox/files/rcS.default | 29 +++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/meta/recipes-core/busybox/files/rcS.default b/meta/recipes-core/busybox/files/rcS.default
index 66513daf2d..44c9747e34 100644
--- a/meta/recipes-core/busybox/files/rcS.default
+++ b/meta/recipes-core/busybox/files/rcS.default
@@ -1,2 +1,31 @@
+#
+# Defaults for the boot scripts in /etc/rcS.d
+#
+
+# Time files in /tmp are kept in days.
+TMPTIME=0
+# Set to yes if you want sulogin to be spawned on bootup
+SULOGIN=no
+# Set to no if you want to be able to login over telnet/rlogin
+# before system startup is complete (as soon as inetd is started)
+DELAYLOGIN=no
+# Assume that the BIOS clock is set to UTC time (recommended)
+UTC=yes
+# Set VERBOSE to "no" if you would like a more quiet bootup.
+VERBOSE=no
+# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
+EDITMOTD=no
+# Whether to fsck root on boot
+ENABLE_ROOTFS_FSCK=no
+# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
+FSCKFIX=yes
+# Set TICKADJ to the correct tick value for this specific machine
+#TICKADJ=10000
+# Enable caching in populate-volatile.sh
+VOLATILE_ENABLE_CACHE=yes
+# Indicate whether the rootfs is intended to be read-only or not.
+# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
+# Normally you should not change this value.
+ROOTFS_READ_ONLY=no
# Indicate init system type
INIT_SYSTEM=busybox
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] rcS: Define identifier for init system used
2020-12-19 2:23 [PATCH 1/3] rcS: Define identifier for init system used Khem Raj
2020-12-19 2:23 ` [PATCH v2 2/3] initscripts: Use initctl on sysvinit only Khem Raj
2020-12-19 2:23 ` [PATCH 3/3] busybox: Sync rcS.default with sysvinit Khem Raj
@ 2020-12-19 2:52 ` Sinan Kaya
2 siblings, 0 replies; 4+ messages in thread
From: Sinan Kaya @ 2020-12-19 2:52 UTC (permalink / raw)
To: Khem Raj, openembedded-core
On 12/18/2020 9:23 PM, Khem Raj wrote:
> This will help in defining init system specific portions of initscripts
> which are shared
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Sinan Kaya <okaya@kernel.org>
Reviewed by: Sinan Kaya <okaya@kernel.org>
for Patches 1-3.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-19 2:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-19 2:23 [PATCH 1/3] rcS: Define identifier for init system used Khem Raj
2020-12-19 2:23 ` [PATCH v2 2/3] initscripts: Use initctl on sysvinit only Khem Raj
2020-12-19 2:23 ` [PATCH 3/3] busybox: Sync rcS.default with sysvinit Khem Raj
2020-12-19 2:52 ` [PATCH 1/3] rcS: Define identifier for init system used Sinan Kaya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox