Skip to content

Commit

Permalink
Normalize 'S' to 's'
Browse files Browse the repository at this point in the history
Don't ever launch plymouthd if no splash is given or in single-user mode
  • Loading branch information
Ozan Çağlayan committed May 27, 2011
1 parent 9948283 commit 1dbbfec
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions init
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ parse_cmdline() {
for x in `cat /proc/cmdline`; do
case "${x}" in
[0123456Ss])
LEVEL=${x}
# Normalize 'S' to 's'
LEVEL=`echo ${x}|tr A-Z a-z`
;;
mudur=*)
for m in `echo ${x}|cut -f2 -d=|sed 's/,/ /g'`; do
Expand Down Expand Up @@ -388,15 +389,11 @@ parse_cmdline() {
copytoram)
COPYTORAM=1
;;
single)
LEVEL="s"
;;
splash)
SPLASH=1
# Disable splash if in single-user mode
if [ "x${LEVEL}" == "xs" -o "x${LEVEL}" == "xS" ]; then
SPLASH=0
fi
;;
single)
LEVEL="s"
;;
quiet)
QUIET=1
Expand Down Expand Up @@ -426,17 +423,11 @@ info "Starting init on initramfs"
mount -n -t proc proc /proc
mount -n -t sysfs sysfs /sys

# Minimize printk log
test "x$QUIET" = "x1" && echo "1" > /proc/sys/kernel/printk

# Prepare /dev (Needs kernel >= 2.6.32)
mount -t devtmpfs devtmpfs /dev
mkdir -m 0755 /dev/pts
mount -t devpts -o gid=5,mode=620 devpts /dev/pts

# Initialize plymouth daemon if found
test -x /sbin/plymouthd && /sbin/plymouthd --attach-to-session

# First parse config file, then cmdline to allow overwriting internal config
if [ -f "$INITRAMFSCONF" ]
then
Expand All @@ -447,6 +438,15 @@ fi
# Parse command line parameters
parse_cmdline

# Minimize printk log
test "x$QUIET" = "x1" && echo "1" > /proc/sys/kernel/printk

# Initialize plymouth daemon if found and splash is true
# Don't even launch plymouthd if we're in single-user mode
if [ "$LEVEL" != "s" -a "$SPLASH" = "1" -a -x /sbin/plymouthd ]; then
/sbin/plymouthd --attach-to-session
fi

# Handle initramfs= parameter
if [ "${INITRAMFS}" == "shellnoprobe" ]
then
Expand Down Expand Up @@ -551,3 +551,4 @@ mount --move /sys /newroot/sys
info "Switching to the real root"
test -x /bin/plymouth && /bin/plymouth update-root-fs --new-root-dir=/newroot
exec /bin/switch_root -c /dev/console /newroot ${INIT} ${LEVEL}

0 comments on commit 1dbbfec

Please sign in to comment.