--- rc.sysinit.orig 2006-12-17 03:02:31.000000000 +0200 +++ rc.sysinit 2006-12-17 03:22:44.000000000 +0200 @@ -128,6 +128,16 @@ status "Mounting Root Read-only" /bin/mount -n -o remount,ro / +# Initial clock configuration +# Note that /usr and /var may not be available yet, so +# /etc/localtime has to be a copy rather than a symlink to /usr/share/zoneinfo/$TIMEZONE +# we skip reading /var/lib/hwclock/adjtime +if [ "$HARDWARECLOCK" = "UTC" ]; then + /sbin/hwclock --noadjfile --directisa --utc --hctosys +else + /sbin/hwclock --noadjfile --directisa --localtime --hctosys +fi + FORCEFSCK= [ -f /forcefsck ] && FORCEFSCK="-- -f" NETFS="nonfs,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,nousbfs,noshfs,nofuse" @@ -178,18 +188,20 @@ status "Activating Swap" /sbin/swapon -a +# Configure the clock again +# this is only done to take /var/lib/hwclock/adjtime into account now that it's available +# you can avoid this if you are willing to move it to /etc/adjtime (we only need read access) +# or you may skip it altogether +# also /var/lib/hwclock/adjtime was initialized after it was read stat_busy "Configuring System Clock" -if [ "$TIMEZONE" != "" ]; then - /bin/ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime +if [ ! -f /var/lib/hwclock/adjtime ]; then + echo "0.0 0 0.0" > /var/lib/hwclock/adjtime fi if [ "$HARDWARECLOCK" = "UTC" ]; then /sbin/hwclock --directisa --utc --hctosys else /sbin/hwclock --directisa --localtime --hctosys fi -if [ ! -f /var/lib/hwclock/adjtime ]; then - echo "0.0 0 0.0" > /var/lib/hwclock/adjtime -fi stat_done if [ -f /var/run/random-seed ]; then --- rc.shutdown.orig 2006-12-17 03:02:37.000000000 +0200 +++ rc.shutdown 2006-12-17 03:29:50.000000000 +0200 @@ -55,6 +55,13 @@ stat_done stat_busy "Saving System Clock" +if [ "$TIMEZONE" != "" ]; then + # remove any existing symlink to avoid surprises + /bin/rm -f /etc/localtime + /bin/cp /usr/share/zoneinfo/$TIMEZONE /etc/localtime +fi +# /var/lib/hwclock/adjtime is written here +# if you decide to disable the use of adjtime, add --noadjfile here as well if [ "$HARDWARECLOCK" = "UTC" ]; then /sbin/hwclock --directisa --utc --systohc else @@ -62,6 +69,7 @@ fi stat_done + # removing psmouse module to fix some reboot issues on newer laptops modprobe -r psmouse >/dev/null 2>&1