Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] Makeing /dev/rtc1 accessible as soon as possible - how? William Kenworthy <billk@×××××××××.au>