kadischi/rc readonly-halt,1.6,1.7

Jasper O'neal Hartline (autopsy) fedora-extras-commits at redhat.com
Tue Aug 29 22:39:34 UTC 2006


Author: autopsy

Update of /cvs/devel/kadischi/rc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21795/kadischi/rc

Modified Files:
	readonly-halt 
Log Message:
Fix shutdown process after initramfs changes


Index: readonly-halt
===================================================================
RCS file: /cvs/devel/kadischi/rc/readonly-halt,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- readonly-halt	31 Jul 2006 02:54:15 -0000	1.6
+++ readonly-halt	29 Aug 2006 22:39:31 -0000	1.7
@@ -35,6 +35,51 @@
 chmod 600 /var/lib/random-seed
 runcmd $"Saving random seed: " dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 2>/dev/null
 
+# Sync the system clock.
+ARC=0
+SRM=0
+UTC=0
+
+if [ -f /etc/sysconfig/clock ]; then
+   . /etc/sysconfig/clock
+
+   # convert old style clock config to new values
+   if [ "${CLOCKMODE}" = "GMT" ]; then
+      UTC=true
+   elif [ "${CLOCKMODE}" = "ARC" ]; then
+      ARC=true
+   fi
+fi
+
+CLOCKDEF=""
+CLOCKFLAGS="$CLOCKFLAGS --systohc"
+
+case "$UTC" in
+   yes|true)
+        CLOCKFLAGS="$CLOCKFLAGS -u";
+        CLOCKDEF="$CLOCKDEF (utc)";
+        ;;
+   no|false)
+        CLOCKFLAGS="$CLOCKFLAGS --localtime";
+        CLOCKDEF="$CLOCKDEF (localtime)";
+        ;;
+esac
+
+case "$ARC" in
+   yes|true)
+        CLOCKFLAGS="$CLOCKFLAGS -A";
+        CLOCKDEF="$CLOCKDEF (arc)";
+        ;;
+esac
+case "$SRM" in
+   yes|true)
+        CLOCKFLAGS="$CLOCKFLAGS -S";
+        CLOCKDEF="$CLOCKDEF (srm)";
+        ;;
+esac
+
+runcmd $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
+
 # backup configs and docs
 
 # mount mtab on ramfs
@@ -44,29 +89,28 @@
 
 # See which runlevel we are in here.
 RUNLEVEL=$(/sbin/runlevel | /bin/cut -d " " -f2)
-
 ## Eject LiveCD
 ## 
 echo "0" >/proc/sys/kernel/printk 
-mount -t ext2 /dev/ram0 /initrd
-cp /etc/mtab /initrd/etc
-cd /
-pivot_root /initrd /initrd/sysroot
-mount -t proc none /proc
-mount -t sysfs none /sys
-mount -t tmpfs none /dev
-/bin/eject-live-cd
+##
+## Load reboot, halt and sleep into memory
+sleep --help >/dev/null 2>&1
+reboot --help >/dev/null 2>&1
+halt >/dev/null 2>&1
 
 if [ "$RUNLEVEL" -eq "6" ]; then
      clear
      echo "Going to reboot the system.."
-     echo "You may remove any LiveCD media from the drives"
-     reboot -d 10
+     echo "You may remove any LiveCD or LiveDVD media from the drive"
+     /sbin/eject-live-cd
+     sleep 10
+     reboot -f
 fi
 if [ "$RUNLEVEL" -eq "0" ]; then
     clear
     echo "Going to halt the system.."
-    echo "You may remove any LiveCD media from the drives"
+    echo "You may remove any LiveCD or LiveDVD media from the drive"
+    /sbin/eject-live-cd
     sleep 10
-    halt
+    halt -f -p
 fi




More information about the fedora-extras-commits mailing list