From af0b5c55dbd94a04ebc54cf3d119261bee383951 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 4 Jun 2011 13:40:24 -0400 Subject: rc.sysinit: kill off VERBOSE= parameter Upstream already supports this via the loglevel= parameter on the kernel cmdline, so we should support using this instead of our own homegrown solution. Signed-off-by: Dave Reisner --- rc.conf | 2 -- rc.sysinit | 7 ------- 2 files changed, 9 deletions(-) diff --git a/rc.conf b/rc.conf index 26cd695..04a93ba 100644 --- a/rc.conf +++ b/rc.conf @@ -17,7 +17,6 @@ # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US) # CONSOLEMAP: found in /usr/share/kbd/consoletrans # USECOLOR: use ANSI color sequences in startup messages -# VERBOSE: Verbose level (from 1 to 8). man 3 syslog for level info # LOCALE="en_US.UTF-8" DAEMON_LOCALE="no" @@ -27,7 +26,6 @@ KEYMAP="us" CONSOLEFONT= CONSOLEMAP= USECOLOR="yes" -VERBOSE="3" # ----------------------------------------------------------------------- # HARDWARE diff --git a/rc.sysinit b/rc.sysinit index c87e3dc..ee77959 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -43,13 +43,6 @@ status "Mounting Root Read-Only" /bin/mount -n -o remount,ro / /sbin/minilogd /sbin/bootlogd -p /run/bootlogd.pid -# Set console verbosity -for cmdarg in $(< /proc/cmdline); do - [[ "$cmdarg" == verbose ]] && VERBOSE=8 && break - [[ "$cmdarg" =~ verbose=[1-8] ]] && VERBOSE=${BASH_REMATCH[0]-8} && break -done -/bin/dmesg -n ${VERBOSE:-3} - HWCLOCK_PARAMS="--hctosys" case $HARDWARECLOCK in UTC) HWCLOCK_PARAMS+=" --utc";; -- cgit v1.2.3 From a79921851bfd93b3ac27955fa0bf191b96c22822 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 2 Jun 2011 10:24:42 -0400 Subject: rc.sysinit: allow exec in /run We already have /tmp and /dev/shm as world writeable directories with exec permissions, so it doesn't necessarily make sense to inhibit exec here. There also might be use cases where running one-off programs from /run might make sense. Signed-off-by: Dave Reisner --- rc.sysinit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc.sysinit b/rc.sysinit index ee77959..8f06a81 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -19,7 +19,7 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # mount /proc, /sys, /run, /dev, /run/lock, /dev/pts, /dev/shm (the api filesystems) /bin/mountpoint -q /proc || /bin/mount -n -t proc proc /proc -o nosuid,noexec,nodev /bin/mountpoint -q /sys || /bin/mount -n -t sysfs sysfs /sys -o nosuid,noexec,nodev -/bin/mountpoint -q /run || /bin/mount -n -t tmpfs tmpfs /run -o mode=755,size=10M,nosuid,noexec,nodev +/bin/mountpoint -q /run || /bin/mount -n -t tmpfs tmpfs /run -o mode=755,size=10M,nosuid,nodev if ! /bin/mountpoint -q /dev; then if /bin/grep -q devtmpfs /proc/filesystems &>/dev/null; then /bin/mount -n -t devtmpfs udev /dev -o mode=0755,size=10M,nosuid -- cgit v1.2.3 From 023d6584d487d1c72788429584d4f2480075c963 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 2 Jun 2011 10:28:47 -0400 Subject: rc.d/rc.sysinit: whitespace cleanup Signed-off-by: Dave Reisner --- rc.d | 4 ++-- rc.sysinit | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/rc.d b/rc.d index 772f2c6..f0c5204 100755 --- a/rc.d +++ b/rc.d @@ -56,9 +56,9 @@ case $1 in cd / for i; do if [[ -x "/etc/rc.d/$i" ]]; then - /usr/bin/env -i "${ENV[@]}" "/etc/rc.d/$i" "$action" + /usr/bin/env -i "${ENV[@]}" "/etc/rc.d/$i" "$action" else - printf "${C_OTHER}:: ${C_FAIL}Error: ${C_DONE}Daemon script $i does not exist.\n" + printf "${C_OTHER}:: ${C_FAIL}Error: ${C_DONE}Daemon script $i does not exist.\n" fi (( ret += !! $? )) # clamp exit value to 0/1 done diff --git a/rc.sysinit b/rc.sysinit index 8f06a81..f672ecc 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -36,8 +36,8 @@ fi # remount root ro to allow for fsck later on, we remount now to # make sure nothing can open files rw on root which would block a remount -/bin/findmnt / --options ro &>/dev/null || \ -status "Mounting Root Read-Only" /bin/mount -n -o remount,ro / +/bin/findmnt / --options ro &>/dev/null || + status "Mounting Root Read-Only" /bin/mount -n -o remount,ro / # start up our mini logger until syslog takes over /sbin/minilogd @@ -104,8 +104,8 @@ fi run_hook sysinit_udevsettled # bring up the loopback interface -[[ -d /sys/class/net/lo ]] && \ - status "Bringing up loopback interface" /usr/sbin/ip link set up dev lo +[[ -d /sys/class/net/lo ]] && + status "Bringing up loopback interface" /usr/sbin/ip link set up dev lo # FakeRAID devices detection if [[ $USEDMRAID =~ yes|YES && -x /sbin/dmraid ]]; then @@ -310,8 +310,9 @@ stat_busy "Removing Leftover Files" /bin/rm -rf /tmp/* /tmp/.* &>/dev/null [[ ! -L /var/lock ]] && /bin/rm -rf /var/lock/* [[ ! -L /var/run && -d /var/run ]] && /usr/bin/find /var/run/ \! -type d -delete - [[ ! -L /var/run && ! -L /var/run/daemons ]] && /bin/rm -rf /var/run/daemons \ - && /bin/ln -s /run/daemons /var/run/daemons + [[ ! -L /var/run && ! -L /var/run/daemons ]] && + /bin/rm -rf /var/run/daemons && + /bin/ln -s /run/daemons /var/run/daemons : >| /var/run/utmp /bin/chmod 0664 /var/run/utmp /bin/chown root:utmp /var/run/utmp @@ -362,9 +363,9 @@ set_consolefont # When the rules are generated before /etc is mounted rw they are saved to /run, # we therefore need to copy this from /run to /etc. This functionality is going away one day. for f in cd net; do - [[ -f /run/udev/tmp-rules--70-persistent-$f.rules ]] || continue - status "Adding persistent $f udev rules" \ - /bin/cat "/run/udev/tmp-rules--70-persistent-$f.rules" >> "/etc/udev/rules.d/70-persistent-$f.rules" + [[ -f /run/udev/tmp-rules--70-persistent-$f.rules ]] || continue + status "Adding persistent $f udev rules" \ + /bin/cat "/run/udev/tmp-rules--70-persistent-$f.rules" >> "/etc/udev/rules.d/70-persistent-$f.rules" done /bin/dmesg >| /var/log/dmesg.log -- cgit v1.2.3 From d847a204aa5ab21a6c02998846ec3216cc7f887d Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 2 Jun 2011 10:30:21 -0400 Subject: use $() instead of `` for command substitutions Signed-off-by: Dave Reisner --- rc.multi | 2 +- rc.single | 2 +- rc.sysinit | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rc.multi b/rc.multi index d8bf126..60bb835 100755 --- a/rc.multi +++ b/rc.multi @@ -27,7 +27,7 @@ fi run_hook multi_end /bin/touch /var/log/boot -kill `/bin/cat /run/bootlogd.pid` +kill $(/bin/cat /run/bootlogd.pid) /bin/rm /run/bootlogd.pid # vim: set ts=2 sw=2 noet: diff --git a/rc.single b/rc.single index d1191d2..92b8f53 100755 --- a/rc.single +++ b/rc.single @@ -49,7 +49,7 @@ if [[ $RUNLEVEL = 1 ]]; then fi /bin/touch /var/log/boot -kill `/bin/cat /run/bootlogd.pid` +kill $(/bin/cat /run/bootlogd.pid) /bin/rm /run/bootlogd.pid # End of file diff --git a/rc.sysinit b/rc.sysinit index f672ecc..febe2da 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -187,7 +187,7 @@ if [[ -f /etc/crypttab && -n $CS ]] && /bin/grep -q ^[^#] /etc/crypttab; then /bin/dd if=${ckdev} of=${ckfile} bs=1 skip=${cka} count=${ckb} >/dev/null 2>&1;; esac $CS -d ${ckfile} $4 $open "$a" "$b" >/dev/null - /bin/dd if=/dev/urandom of=${ckfile} bs=1 count=`stat -c %s ${ckfile}` conv=notrunc >/dev/null 2>&1 + /bin/dd if=/dev/urandom of=${ckfile} bs=1 count=$(stat -c %s ${ckfile}) conv=notrunc >/dev/null 2>&1 rm ${ckfile};; /*) $CS -d "$3" $4 $open "$a" "$b" >/dev/null;; -- cgit v1.2.3