# Sice update to ~amd64 I have a problem with the clock.[solve

## roelof

Hello, 

Since the update to ~amd64 I see this message when i boot:

```

Setting system clock using the hardware clock[localtime]

Cannot access the hardware clock via any known method.

Use the --debug option to see the details of our search for a access method.

```

I see that now the clock works 2 hours in advantage.

How can I solve this last problem ?

RoelofLast edited by roelof on Tue May 18, 2010 1:33 pm; edited 1 time in total

----------

## roelof

Hello,

Nobody who have a clue ?

Roelof

----------

## sera

Sounds either like wrong kernel setting or misconfigured openrc.

The kernel needs to expose a hardware clock device and openrc needs to know where to find it. Further details should  be obtainable by setting the --debug option as suggested in the error message itself.

----------

## roelof

Hello Sera, 

When I do  hwclock --debug I get this output :

```

hwclock from util-linux-ng 2.17.2

Using /dev interface to clock.

Last drift adjustment done at 1273938678 seconds after 1969

Last calibration done at 1273938678 seconds after 1969

Hardware clock is on UTC time

Assuming hardware clock is kept in UTC time.

Waiting for clock tick...

...got clock tick

Time read from Hardware Clock: 2010/05/17 09:55:20

Hw clock time : 2010/05/17 09:55:20 = 1274090120 seconds since 1969

Mon May 17 11:55:20 2010  -0.429122 seconds

```

My hwclock conf file looks like this :

```

# Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as

# Greenwich Mean Time).  If that clock is set to the local time, then 

# set CLOCK to "local".  Note that if you dual boot with Windows, then 

# you should set it to "local".

clock="local"

TIME_ZONE="Europe/Amsterdam"

# If you want to set the Hardware Clock to the current System Time 

# (software clock) during shutdown, then say "YES" here.

# You normally don't need to do this if you run a ntp daemon.

clock_systohc="NO"

# If you wish to pass any other arguments to hwclock during bootup,

# you may do so here. Alpha users may wish to use --arc or --srm here.

clock_args=""

```

Roelof

Edit : When I do hwclock - restart the time is allright.

Can it be that I start the udev as last in the booting.

----------

## sera

 *roelof wrote:*   

> Hello Sera, 
> 
> When I do  hwclock --debug I get this output :
> 
> ```
> ...

 

Timezone belongs in its own config file. Where it is now it has no effect. Please follow the migration guide carefully.

And yes an rtc device must be present at the time of running /etc/init.d/hwclock for this to work. Configure the kernel appropriately.

----------

## roelof

Hello Sera, 

i know. Timezone is in /etc/localtime.

And tis file is there with the Europe/Amsterdam.

Which migration guide are you talking about.

I will check my kernel config for rtc device.

Roelof

----------

## pappy_mcfae

Post the results of /var/log/dmesg so I can see if there is evidence of this issue contained in that file.

Cheers,

Pappy

----------

## roelof

Hello Pappy,

You can find it here : http://pastebin.com/6XAMWuWy

Roelof

----------

## pappy_mcfae

I have some running to do, so I'll check it out when I get back home. I'm thinking two hours max.

Cheers,

Pappy

----------

## roelof

Oke Pappy, 

I will wait for your answer.

Roelof

----------

## pappy_mcfae

Ok, I think I have an answer at this point. If you have the file /etc/conf.d/hwclock, that implies that you are using baselayout-2/openrc. If this is the case, then your /etc/conf.d/hwclock file is incorrect. This one is set correctly as the clock does update properly on the machine from which this file originates:

```
# Set CLOCK to "UTC" if your system clock is set to UTC (also known as

# Greenwich Mean Time).  If your clock is set to the local time, then 

# set CLOCK to "local".  Note that if you dual boot with Windows, then 

# you should set it to "local".

clock="local"

# If you want to set the Hardware Clock to the current System Time 

# during shutdown, then say "YES" here.

# You normally don't need to do this if you run a ntp daemon.

clock_systohc="NO"

# If you wish to pass any other arguments to hwclock during bootup,

# you may do so here. Alpha users may wish to use --arc or --srm here.

clock_args=""

```

Note the lack of any mention of a time zone.

The time zone is not provided in that file. The timezone is provided in the file /etc/timezone. For instance, on the machine that provided the above file also has this as /etc/timezone: 

```
America/Chicago
```

That is all that file contains. Fix those files, and see how things work thereafter.

Cheers,

Pappy

----------

## roelof

Hello,

I deleted the Timezone.

Localtime contains Europe/Amsterdam.

Problem stays and the boot error message also.

Roelof

----------

## sera

 *roelof wrote:*   

> Hello Sera, 
> 
> i know. Timezone is in /etc/localtime.
> 
> And tis file is there with the Europe/Amsterdam.
> ...

 

Openrc migration guide, however seems you found the file, nonetheless you should definitively read that document, and what revealed your kernel check?

As you are now a ~arch user, when configuring a kernel how can you make sure the rtc-driver is already present at startup?

----------

## pappy_mcfae

Make sure that the rtc subsystem is turned on in the kernel, and standard CMOS is turned on under it. Those are standard issue settings for the kernel seed. I've never had a clock issue with any of my machines while using them. 

Be sure your kernel is set properly in this area. If I set up the .config for you, it is set up properly unless it was changed.

Cheers,

Pappy

----------

## roelof

Hello Sera, 

Maybe rc.log="yes"

Pappy, 

I was a config made by you and I didn't change anything.

Roelof

----------

## pappy_mcfae

If it's an unchanged seed, then there should be no problem whatsoever with the kernel. 

Do you have another kernel version installed on the machine? If so, does it have issues? If not, then we are definitely looking at a baselayout issue. We may have to de-install and re-install it to clear the issue. It's a bit of an effort, but it always works to clear funky baselayout settings, and some other things, too.

Cheers,

Pappy

----------

## sera

 *roelof wrote:*   

> Hello Sera, 
> 
> Maybe rc.log="yes"
> 
> 

 

Don't build it as a module  :Wink: 

----------

## roelof

Hello, 

I have th source of a .33 kernel.

I could use your config and look if this makes any difference.

I will report back.

Roelof

----------

## roelof

Hello Pappy,

Same problem on the .33 kernel.

I have used this config : http://pastebin.com/kRxc89AZ

Can it be the problem that udev is started as last service on booting ?

Roelof

----------

## krinn

yes:

you should have that 

```
rc-update show sysinit
```

and if udev isn't there, easy

```

rc-update del udev

rc-update add udev sysinit
```

and here's the reference to the openrc upgrade guide that you should have follow  :Smile: 

http://www.gentoo.org/doc/en/openrc-migration.xml

on another note, hwclock is start by your gentoo, but gentoo doesn't start programs for fun, so if hwclock was start, then hwclock is certainly "hwclock the service" and not "hwclock the program".

So if the file ask you to try --debug, don't just assume it's hwclock the program (/sbin/hwclock) when it could be :

/etc/init.d/hwclock restart --debug or /sbin/hwclock --debug, depend who tell you that (for the knowledge, because i think too /sbin/hwclock was the one told you that)

Also, it's a good habit to take to run your programs using their pathname, specially when doing root commands (less vital if the computer is a personal desktop)

----------

## roelof

Hello Krin, 

Problem solved.

Reason was udev working on the wrong place.

Everyone thanks for the help.

Roelof

----------

## pappy_mcfae

Good to know. I' glad I joined this thread.

Cheers,

Pappy

----------

