All of lore.kernel.org
 help / color / mirror / Atom feed
From: <wenzong.fan@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 1/3] initscripts: Check for the existence of /etc/default/rcS
Date: Tue, 31 Oct 2017 23:04:02 -0700	[thread overview]
Message-ID: <45f029252467ce799baaaa783df2dace63fe8e0c.1509516068.git.wenzong.fan@windriver.com> (raw)
In-Reply-To: <cover.1509516068.git.wenzong.fan@windriver.com>

From: Wenzong Fan <wenzong.fan@windriver.com>

/etc/default/rcS might be missing if the init manager is not sysvinit,
we have to check for the existence of this file before sourcing it.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh              | 2 +-
 meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh               | 2 +-
 meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh             | 2 +-
 meta/recipes-core/initscripts/initscripts-1.0/mountall.sh              | 2 +-
 meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh | 2 +-
 meta/recipes-core/initscripts/initscripts-1.0/urandom                  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
index df553bc079..8f1853a667 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -8,7 +8,7 @@
 # Short-Description: Misc and other.
 ### END INIT INFO
 
-. /etc/default/rcS
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 #
 # Put a nologin file in /etc to prevent people from logging in before
 # system startup is complete.
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
index 62869451b7..d1c4d6c017 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
@@ -8,7 +8,7 @@
 # Short-Description: Check all other file systems
 ### END INIT INFO
 
-. /etc/default/rcS
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 
 #
 # Check the rest of the filesystems.
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
index 02f0351fcb..c879f9e519 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
@@ -8,7 +8,7 @@
 # Short-Description: Check to root file system.
 ### END INIT INFO
 
-. /etc/default/rcS
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 
 #
 # Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
index c719be5d9a..94c1f1a141 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
@@ -9,7 +9,7 @@
 # Description:
 ### END INIT INFO
 
-. /etc/default/rcS
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 
 #
 # Mount local filesystems in /etc/fstab. For some reason, people
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
index 1a0328d63e..c001778e18 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. /etc/default/rcS
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 
 [ "$ROOTFS_READ_ONLY" = "no" ] && exit 0
 
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/urandom b/meta/recipes-core/initscripts/initscripts-1.0/urandom
index af1625b5fd..e9b84a9d11 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/urandom
+++ b/meta/recipes-core/initscripts/initscripts-1.0/urandom
@@ -15,7 +15,7 @@ test -c /dev/urandom || exit 0
 
 RANDOM_SEED_FILE=/var/lib/urandom/random-seed
 
-. /etc/default/rcS
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 [ -f /etc/default/urandom ] && . /etc/default/urandom
 
 case "$1" in
-- 
2.11.0



  reply	other threads:[~2017-11-01  6:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01  6:04 [PATCH 0/3] initscripts: fixes for booting with busybox init wenzong.fan
2017-11-01  6:04 ` wenzong.fan [this message]
2017-11-01  6:04 ` [PATCH 2/3] initscripts: minor fixes to checkroot.sh wenzong.fan
2017-11-01  6:04 ` [PATCH 3/3] initscripts: disable mountall.sh for busybox init wenzong.fan
2017-11-01 12:51   ` Otavio Salvador
2017-11-02  2:02     ` wenzong fan
2017-11-02 11:41       ` Otavio Salvador
2017-11-03  2:51         ` wenzong fan
2017-11-02  2:24 ` [PATCH 0/3] initscripts: fixes for booting with " ChenQi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45f029252467ce799baaaa783df2dace63fe8e0c.1509516068.git.wenzong.fan@windriver.com \
    --to=wenzong.fan@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.