Skip to contentSkip to conversation

initscripts: added save-rtc to runlevel S

PATCH ChenQi 1 participant 1 message Jan 11, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

ChenQi

author
#1 lore raw

-------- Original Message --------
Subject: Re: [poky] [PATCH] initscripts: added save-rtc to runlevel S
Date: Thu, 10 Jan 2013 11:20:16 -0800
From: Felipe Ferreri Tonello <[email protected]>
To: ChenQi <[email protected]>

Chen

Can you please send this email to the mailing list, so we can discuss there?

Thank you,
Felipe

Quoted 73 lines · ChenQi
Quoted 34 lines · Felipe Ferreri Tonello

Hi Chen,

Thank you for your answer.

Quoted 29 lines · ChenQi
Quoted 9 lines · Felipe Ferreri Tonello

Hi Chen,

Quoted 6 lines · ChenQi
Quoted 5 lines · On 01/09/2013 08:18 AM, [email protected] wrote:

From: "Felipe F. Tonello" <[email protected]>

It is necessary to add save-rtc.sh to runlevel S so the system is updated when
it boots up.

Quoted 7 lines
Quoted 2 lines

Hi ftonello,
What do you mean by "system is updated"?

I meant system clock.

What is happening now is that when you turn off the device, without system halt, the next time the device is booted up the system clock is not in sync with the rtc.

Hi Felipe,

I'm sorry, but I really don't see why this patch works. Below is my understanding for the system clock, hardware clock and /etc/timestamp.
(The file name 'save-rtc.sh' is somewhat misleading, 'save-timestamp.sh' would be a more reasonable one.)

/etc/timestamp is used to provide a reasonable reference for system time.
The initial contents in this file is the building time of the image.

Quoted 8 lines
Quoted 5 lines

The system clock should always be in sync with the rtc as long as the /etc/init.d/hwclock.sh is present, whose main purpose is to sync system clock and hardware clock.
No matter whether the system is shutdown normally or crashes, the system clock is according to the hardware clock by hwclock.sh.

Is there anything special to enable hwclock.sh?

In the current project, hwclock.sh is invoked in bootmisc.sh if /etc/init.d/hwclock.sh exists.

Although there are symlinks in /etc/rc[2345].d/ like "Sxxhwclock.sh -> ../init.d/hwclock.sh", they have no real effect! This is a bug scheduled to be solved. For more details, refer to
https://bugzilla.yoctoproject.org/show_bug.cgi?id=3612.

For a temporary workaround, change the link names from 'hwclock.sh' to 'hwclock'.

This bug will be solved soon :)

Cheers,
Chen Qi

Quoted 13 lines

I understand what you say, but here that patch was the only way to have system clock (down to minutes, also, or even seconds, don't recall) sync up with the rtc.

Btw, this patch I did few months ago. So I don't remember exactly what was happening.

Do you know by the top of your mind how is this process? Because, as I remember, save-rtc.sh was never been called. I'm not sure.

Felipe