Gentoo Archives: gentoo-user

From: William Kenworthy <billk@×××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Makeing /dev/rtc1 accessible as soon as possible - how?
Date: Sun, 25 Aug 2013 04:28:52
Message-Id: 521987F3.20808@iinet.net.au
In Reply to: Re: [gentoo-user] Makeing /dev/rtc1 accessible as soon as possible - how? by Mark David Dumlao
1 or if you have an initramfs do it there before control is passed to the
2 OS. You may also be able to set rtc0 to the current time in the
3 initramfs as well.
4
5 BillK
6
7
8
9 On 25/08/13 12:18, Mark David Dumlao wrote:
10 > Which runlevel did you put your script on?
11 > You probably want it on sysinit, rather than default.
12 >
13 > Also, you can put rc_before= and rc_after= in the corresponding
14 > /etc/conf.d/ file and make sure it runs before your syslog but after
15 > your sysfs.
16 >
17 > On Sun, Aug 25, 2013 at 12:04 PM, <meino.cramer@×××.de> wrote:
18 >> Hi,
19 >>
20 >> There are two RTCs in my system:
21 >> /dev/rtc0 and /dev/rtc1
22 >>
23 >> rtc0 is not powered by a battery and forgets time/date
24 >> with system shutdown and rtc1 is a I2C-rtc (DS3231) which
25 >> is powered by a battery. It is extremly accurate in comparison
26 >> with rtc0.
27 >>
28 >> rtc0 is accessible with system boot - rtc1 is not (current state).
29 >>
30 >> To make rtc1 completly know to the system, I have to do a
31 >> echo ds3231 0x68 >! /sys/bus/i2c/devices/i2c-1/new_device
32 >> hwclock -f /dev/rtc1 -s
33 >> in beforehand.
34 >>
35 >> I wrote a script for /etc/init.d, which does exactly this, and
36 >> the system login screen shows the correct tome/date information
37 >> even without ntp-client (the system should become independantly
38 >> from lan/internet). The script was added to the boot service
39 >> and executed after dev and modules.
40 >>
41 >> The kernel is configured to use /dev/rtc1 and the driver for the
42 >> ds1307, which also handles the ds3231, is included into the kernel
43 >> (no module).
44 >>
45 >> But it seems, that setting the system time this way is too late,
46 >> since there are still (for example) log files under /var/log
47 >> with a timestamp of the 1.1.1970.
48 >>
49 >> Are there any other way to make rtc1 known and accessible earlier
50 >> to the system as the hack via a script in /etc/init.d ?
51 >>
52 >> Thank you very much in advance for any help!
53 >> Best regards,
54 >> mcc
55 >>
56 >>
57 >>
58 >>
59 >
60 >
61 >

Replies