On Wed, Mar 30, 2011 at 9:59 AM, Ed W wrote: > On 30/03/2011 05:47, Mike Frysinger wrote: >> On Tue, Mar 29, 2011 at 10:06 PM, Joe Sapp wrote: >>> I've got a board with no RTC so there are some problems during boot. >>> Currently there's a hack in the udev init script to get the time from the >>> network (via ntp or rdate), but I'm wondering if somebody else has solved >>> this in a better way. Any ideas? >> >> add your own init.d script, mark it "before udev', and add it to boot >> runlevel ? > > You would still have the problem that you can't run it until at least > after you start network of course?
that depends on how the board comes up. if the boot loader provides network settings to the kernel (autoconfig), it might be up. or if people have an initramfs that brings things up. > Some people might not know of /etc/init.d/swclock. It writes the time > at shutdown and restores *that* old time on bootup. For some scenarios > that might get you a time close to reality... (eg if you just want to > check stuff like "has this file changed" and avoid "clock moved > backwards" kind of issues) that can be useful depending on the system needs. i tend to forget about it ;). -mike
