[arch-general] [PATCH 27/48] Start tightening up rc.sysinit.

Victor Lowther victor.lowther at gmail.com
Wed Jun 30 17:47:44 EDT 2010


---
 rc.sysinit |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/rc.sysinit b/rc.sysinit
index c62ae8d..29adeca 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -17,12 +17,9 @@ printsep
 run_hook sysinit_start
 
 # mount /proc, /sys and our RAM /dev
-if ! /bin/mountpoint -q /proc; then
-  /bin/mount -n -t proc none /proc
-fi
-if ! /bin/mountpoint -q /sys; then
-  /bin/mount -n -t sysfs none /sys
-fi
+/bin/mountpoint -q /proc || /bin/mount -n -t proc none /proc
+/bin/mountpoint -q /sys  || /bin/mount -n -t sysfs none /sys
+
 if ! /bin/mountpoint -q /dev; then
   if grep -q devtmpfs /proc/filesystems 2>/dev/null; then
     /bin/mount -n -t devtmpfs udev /dev -o mode=0755,size=10M,nosuid
@@ -46,13 +43,11 @@ else
 fi
 
 HWCLOCK_PARAMS="--hctosys"
-if [ "$HARDWARECLOCK" = "UTC" ]; then
-	HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc"
-elif [ "$HARDWARECLOCK" = "localtime" ]; then
-	HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime"
-else
-	HWCLOCK_PARAMS=""
-fi
+case $HARDWARECLOCK in
+    UTC) "$HWCLOCK_PARAMS --utc";;
+    localtime) HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime";;
+    *) HWCLOCK_PARAMS="";;
+esac
 
 if [ -n "$HWCLOCK_PARAMS" ]; then
 	# enable rtc access
-- 
1.7.1



More information about the arch-general mailing list