Package: util-linux
Version: 2.12p-4sarge1
Severity: important
Tags: patch

When I tested the boot speed on my new office machine, a lot of time
is spent in hwclockfirst.sh and hwclock.sh.  Dropping these from the
boot reduced the boot time from 44 to 28 seconds.

I also notice that the kernel seem to read the hardware clock on its
own, and thus do not need hwclock to do it as part of the boot
sequence.  I asked on #debian-kernel about this, and was told by
Bastian Blank that he had checked the kernel source, and at least for
i386 and kernel 2.6.17, the system clock is read from CMOS during
boot, and written to CMOS during shutdown.  He believe this has been
the case for the entire 2.6 kernel series.

Because of this, I suggest adding code in hwclock.sh to not do
anything on i386 if the kernel is 2.6 or newer, and thus be able to
save several seconds of the normal i386 boot.  I set severity
important, and this affect the boot speed quite a lot, and slow boot
affect quite a lot of laptop users quite severely.

Here is a draft patch.  It is slightly patched, but should perhaps
list more architectures, like amd64.  I did not do that, because I do
not have the exact format of the uname -m string returned on these
archs.

--- debian/hwclock.sh.orig      2006-09-11 22:24:30.000000000 +0200
+++ debian/hwclock.sh   2006-09-11 22:38:43.000000000 +0200
@@ -153,4 +153,19 @@
     esac
 }

+# Disable for archs which do not need it, to speed up the boot.
+if [ Linux = "`uname -s`" ] ; then
+       case "`uname -m`" in
+       i*86)
+               case "`uname -r`" in
+               2.2.*|2.4.*) # No idea if 2.2 or 2.4 kernels need it
+                       ;;
+               2.6.*) # i386 2.6 kernels handle the CMOS clock internally
+                       HWCLOCKACCESS=no
+                       ;;
+               esac
+               ;;
+       esac
+fi
+
 hwclocksh "$@"

Please apply this in the next version of util-linux.  It would be
great if this change would make it into etch.

Friendly,
-- 
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to