Gentoo Archives: gentoo-embedded

From: Ed W <lists@××××××××××.com>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] Getting network time early in boot
Date: Wed, 30 Mar 2011 14:05:23
Message-Id: 4D93373A.9010605@wildgooses.com
In Reply to: Re: [gentoo-embedded] Getting network time early in boot by Mike Frysinger
1 On 30/03/2011 05:47, Mike Frysinger wrote:
2 > On Tue, Mar 29, 2011 at 10:06 PM, Joe Sapp wrote:
3 >> I've got a board with no RTC so there are some problems during boot.
4 >> Currently there's a hack in the udev init script to get the time from the
5 >> network (via ntp or rdate), but I'm wondering if somebody else has solved
6 >> this in a better way. Any ideas?
7 >
8 > add your own init.d script, mark it "before udev', and add it to boot runlevel ?
9
10 You would still have the problem that you can't run it until at least
11 after you start network of course?
12
13 Some people might not know of /etc/init.d/swclock. It writes the time
14 at shutdown and restores *that* old time on bootup. For some scenarios
15 that might get you a time close to reality... (eg if you just want to
16 check stuff like "has this file changed" and avoid "clock moved
17 backwards" kind of issues)
18
19 Good luck
20
21 Ed W

Replies

Subject Author
Re: [gentoo-embedded] Getting network time early in boot Mike Frysinger <vapier@g.o>