public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: meino.cramer@gmx.de
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Makeing /dev/rtc1 accessible as soon as possible - how?
Date: Sun, 25 Aug 2013 06:54:51 +0200	[thread overview]
Message-ID: <20130825045451.GA25561@solfire> (raw)
In-Reply-To: <521987F3.20808@iinet.net.au>

William Kenworthy <billk@iinet.net.au> [13-08-25 06:32]:
> or if you have an initramfs do it there before control is passed to the
> OS.  You may also be able to set rtc0 to the current time in the
> initramfs as well.
> 
> BillK
> 
> 
> 
> On 25/08/13 12:18, Mark David Dumlao wrote:
> > Which runlevel did you put your script on?
> > You probably want it on sysinit, rather than default.
> > 
> > Also, you can put rc_before= and rc_after= in the corresponding
> > /etc/conf.d/ file and make sure it runs before your syslog but after
> > your sysfs.
> > 
> > On Sun, Aug 25, 2013 at 12:04 PM,  <meino.cramer@gmx.de> wrote:
> >> Hi,
> >>
> >> There are two RTCs in my system:
> >> /dev/rtc0 and /dev/rtc1
> >>
> >> rtc0 is not powered by a battery and forgets time/date
> >> with system shutdown and rtc1 is a I2C-rtc (DS3231) which
> >> is powered by a battery. It is extremly accurate in comparison
> >> with rtc0.
> >>
> >> rtc0 is accessible with system boot - rtc1 is not (current state).
> >>
> >> To make rtc1 completly know to the system, I have to do a
> >>     echo ds3231 0x68 >! /sys/bus/i2c/devices/i2c-1/new_device
> >>     hwclock -f /dev/rtc1 -s
> >> in beforehand.
> >>
> >> I wrote a script for /etc/init.d, which does exactly this, and
> >> the system login screen shows the correct tome/date information
> >> even without ntp-client (the system should become independantly
> >> from lan/internet). The script was added to the boot service
> >> and executed after dev and modules.
> >>
> >> The kernel is configured to use /dev/rtc1 and the driver for the
> >> ds1307, which also handles the ds3231, is included into the kernel
> >> (no module).
> >>
> >> But it seems, that setting the system time this way is too late,
> >> since there are still (for example) log files under /var/log
> >> with a timestamp of the 1.1.1970.
> >>
> >> Are there any other way to make rtc1 known and accessible earlier
> >> to the system as the hack via a script in /etc/init.d ?
> >>
> >> Thank you very much in advance for any help!
> >> Best regards,
> >> mcc
> >>
> >>
> >>
> >>
> > 
> > 
> > 
> 
> 

Hi Mark, hi William,

the script ds3231 in /etc/init.d is -- according to rc-update --
set as folows:

               ds3231 | boot                         

There is no corresponding file in /etc/conf.d since the script
onlu consist of two commands (see previous posting). There is no
initramfs.

Since hwclock needs /dev/rtc1 to work, the script cannot be executed
before /dev/. is up.

Is there an text/tutorial/... or such somewhere on the net, which
shows the sequence, in which the usual services/scripts in /etc/init.d 
get started/executed while the system boots?

Best regads,
mcc






  reply	other threads:[~2013-08-25  4:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-25  4:04 [gentoo-user] Makeing /dev/rtc1 accessible as soon as possible - how? meino.cramer
2013-08-25  4:18 ` Mark David Dumlao
2013-08-25  4:28   ` William Kenworthy
2013-08-25  4:54     ` meino.cramer [this message]
2013-08-26  1:40       ` Mark David Dumlao
2013-08-26  6:03         ` Pandu Poluan
2013-08-25  9:02 ` Paul Colquhoun
2013-08-25 10:35   ` meino.cramer
2013-08-25 11:41     ` Mick
2013-08-25 12:50       ` meino.cramer
2013-08-25 13:15         ` William Kenworthy
2013-08-25 15:24           ` meino.cramer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130825045451.GA25561@solfire \
    --to=meino.cramer@gmx.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox