Hello,
When hwclock --hctosys is started very early during the system startup,
with / still mounted read-only, and there was no /etc/adjtime file,
hwclock fails creating a default adjfile full of zeroes, and prints an
error message. I believe that such zero adjfile is not necessary,
because it means exactly the same as no adjfile at all.
The attached patch prevents creation of a zero adjfile, of course unless
something gets changed (this never happens during a --hctosys).
Alain.
Do not create unnecessarily an adjfile full of zeros, when the adjfile
didn't exist. This helps running --hctosys very early during system
startup, when the / filesystem is still mounted read-only.
diff -prud util-linux-ng-2.13/hwclock/hwclock.c
util-linux-ng-2.13.mod/hwclock/hwclock.c
--- util-linux-ng-2.13/hwclock/hwclock.c Mon Aug 27 15:00:34 2007
+++ util-linux-ng-2.13.mod/hwclock/hwclock.c Mon Sep 24 11:14:13 2007
@@ -257,6 +257,7 @@ read_adjtime(struct adjtime *adjtime_p)
adjtime_p->not_adjusted = 0;
adjtime_p->last_calib_time = 0;
adjtime_p->local_utc = UNKNOWN;
+ adjtime_p->dirty = FALSE; /* don't create a zero adjfile */
return 0;
}