# kernel compile: Clock screw detected

## cruelnovember

Hi all

After some booting problems i had to build in my hard drive into a 

friends computer and recompile my kernel

Now I'm able to boot again. But it seems that the time of compiling the 

kernel in my friends computer is located in the future  :Wink: 

When i try to recompile my kernel now it gives some error like 

```
Warning: File `arch/i386/boot/.vmlinux.bin.cmd' has modification 

time 3.5e+08 s in the future 
```

It gives that error for several files located in /usr/src/linux

what can i do here?

thanks,

Paul

----------

## Kurse

You could sync the date using ntpdate, or you could ignore it, or you could recompile once you get your hard drive back in your box.

----------

## TinheadNed

Or you could do make clean.  That would stop all the temporary files having times set to the future.

Or some kind of crazy touch */* or ls -R | xargs -n 1 touch or something similar to get all the files to the same time.

----------

## cruelnovember

Ok thanks, make clean did it  :Wink: 

greetings and thanks,

Paul

----------

## cruelnovember

I still have the problem with one of my Clients. I tried emerge -C development-sources and remerge the sources, I tried deleting the whole /usr/src and I tried to make clean. All of them did not work. 

Any other Ideas? It really sucks that I have to remerge the whole kernel when changing just one option, which is a resultof the clock screw.

thanks and greetings,

Paul

----------

## yaneurabeya

 *cruelnovember wrote:*   

> I still have the problem with one of my Clients. I tried emerge -C development-sources and remerge the sources, I tried deleting the whole /usr/src and I tried to make clean. All of them did not work. 
> 
> Any other Ideas? It really sucks that I have to remerge the whole kernel when changing just one option, which is a resultof the clock screw.
> 
> thanks and greetings,
> ...

 

You can fix your clock skew by running date --set= . Read man date more about setting the date.

----------

## Jengu

Make sure your clock is set correctly in the BIOS too.

----------

## cruelnovember

The Bios Clock and the System Clock do not differ more than a minute. Ntp syncing needs an Internet connection doesnt it? I'm still having the same problem, clock is set to 12.15 CET, System Clock is set to 12.15

[EDIT:]

Another thing: 

When i do make clean and after that make menuconfig i get no error. But when I do make menuconfig again, a clock screw is detected.....I synced my clock via ntp now and it still doesnt work.

[/EDIT]

any ideas?

Paul

----------

## yaneurabeya

Did you set the timezone? What does ls -l /etc/localtime display for a symbolic link?

----------

## cruelnovember

My Timezone:

```

# ls -l /etc/localtime 

lrwxrwxrwx  1 root root 23 Dec 14 19:25 /etc/localtime -> /usr/share/zoneinfo/CET

```

I set all timezones in my LAN to CET, so that should not be the problem...

any other suggestions?

Paul

----------

## Hyper_Eye

I am having this problem as well.

----------

## yaneurabeya

Could you guys do a uname -a and also, which kernel sources are you using: gentoo-dev, gentoo, vanilla, vanilla-dev, ..?

----------

## [UK]Superdude

Not only check date, but also check hwclock to see if the clock is in fact in sync with the hardware clock. 

Ntpdate is a good way to sync your normal clock, then there is a way to sync your hwclock to the system clock.

I had this problem and it turned out to be the hwclock about a day out of sync. Gave me all those kernel compile errors too....

I beleive that there is some gentoo docs about syncing your clock with ntp.

----------

## cruelnovember

gentoo development sources over here...

hwclock seems to be set all right

uname -a

```

Linux zaphod 2.6.9 #4 SMP Tue Dec 14 23:21:24 CET 2004 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux

```

hope this helps you to help me  :Wink: ...

Paul

----------

## cruelnovember

*bump*

----------

## Ateo

You need to reset your date

```
# date 122810002004
```

the first set 4 numbers are month/date

the second set of 4 numbers is the actual time, in 24hr

the third set of 4 numbers is year...

So, that sets clock to Dec 28, 2004 - 10AM

All this BS about *needing* an ntpd is not the solution, rather a bandaid.

----------

## Bob P

 *[UK]Superdude wrote:*   

> Not only check date, but also check hwclock to see if the clock is in fact in sync with the hardware clock. 
> 
> Ntpdate is a good way to sync your normal clock, then there is a way to sync your hwclock to the system clock.
> 
> I had this problem and it turned out to be the hwclock about a day out of sync. Gave me all those kernel compile errors too....
> ...

 

that's funny -- ntp isn't even a bandaid for situations like this.  i also had problems with the kernel failing to compile because of files with times in the future.  my ntp daemon (which was already installed) wouldn't even load at bootup.  i kept getting errors that said,

```
* Setting the clock via the NTP client 'ntpdate' ...

ntpdate: number of samples (0) is invalid.

* Failed to set clock
```

i solved the problem with the "date" command.   :Wink: 

it turns out that my clock was mistakenly set 24 hours ahead of real time because of a typographical error earlier in the day.  the kernel compilation errors popped-up, and even NTP was borked.

so if you have time problems, don't think that NTP is a cure-all.  you need to have a sane system for it to work.

----------

## converter

I think you meant skew, not screw.  :Smile: 

----------

## Bob P

HA!  I didn't even notice it.  it must have been a Freudian slip!

----------

## Gentree

 *Bob P wrote:*   

>  *[UK]Superdude wrote:*   Not only check date, but also check hwclock to see if the clock is in fact in sync with the hardware clock. 
> 
> Ntpdate is a good way to sync your normal clock, then there is a way to sync your hwclock to the system clock.
> 
> I had this problem and it turned out to be the hwclock about a day out of sync. Gave me all those kernel compile errors too....
> ...

 

ntpd and ntp-client is probably a hammer to crack wallnut if all you want is to sync your PC clock. I use a alias for rdate:

```
alias timeck='rdate -s ntp.uio.no'
```

(select a local ntp server if you're not near Oslo!)

This does work if local time is in the future (although you should probably look a bit further before dismissing ntp so quickly, it does not make much sense if it requres the time to be "sane" before it is prepared to work. I suspect the problem was elsewhere but prevented ntp from working.)

HTH  :Cool: 

----------

## BlinkEye

easiest way to continously sync your clock is to emerge ntpdate. as root 

```
crontab -e
```

add 

```
*/10 * * * * /usr/bin/ntpdate pool.ntp.org > /dev/null 2>&1
```

which will execute every 10 minute. change that to

```
* * * * * /usr/bin/ntpdate pool.ntp.org > /dev/null 2>&
```

if you don't use a laptop and use a continous internet connection (syncs the time every stright hour)

save the crontab.

you may execute 

```
/usr/bin/ntpdate pool.ntp.org
```

on console by hand too to sync your clock. no need of configuring ntpdate, or adding ntpd or ntp-client to a runlevel

----------

## transient

This usually happens during the initial compile.

When you first set your date, most people dont also make the correct symlink to their timezone. This has the effect of (usually) shifting the time foward a few hours or so.

Once the timezone gets set after the glibc compile, after emerge system, IIRC, all files that were emerged before this suddenly have their last modified date set in the future, causing all sorts of issues, with perl as well as with the kernel.

Easiest way to fix this when youre installing gentoo is to either set your clock back deliberately when you first set it, so that when you set the time correctly, the files have an older modification date rather than a newer one. 

Or make the /etc/localtime symlink before starting bootstrap etc...

[edit]There is actually a good reason for not using a cron entry of ntpdate to do your syncronizing. 

Ntpd has extra functionality (signal processing, error checking and mitigation algorithms to be precise) that ntpdate doesnt have. 

Ntpd has an option, -q, specifically for this, which causes it to set the date and then exit immediately.

[/edit]

----------

## Decibels

Just had the 

```
make[1]: warning:  Clock skew detected.  Your build may be incomplete
```

While trying to compile the 2.6.10-r6 kernel. Been a trying week, with baselayout/sysvinit crap borking my system,...  the new localversion thing with the newer kernel screwed up nvidia until noticed it putting a 'y' on the end, got that one fixed, now trying to compile it is giving me this clock skew detected.

My time is set correct, date shows it correct, time zone is correct, /etc/localtime is linked correctly,... looking at the timestamps on the files in the kernel folder seem correct.

Well re-emerged the kernel again and same thing.

Found this on google from a debian alpha list.

http://alphalinux.org/archives/debian-alpha/October1999/0023.html

```
find /usr/src/linux-2.6.10-gentoo-r6 -mtime -0 -o -mtime +11000 | xargs touch
```

```
 -mtime -0 will catch all files modified in the future,

 -mtime +11000 will catch all files modified more than 30 years ago.

 Touch will then modify the timestamp to "now"
```

So, cd to the /usr/src/linux-2.6.8-gentoo-r6 folder and ran with the line above. Then ran 'make && make modules_install' and clock skew error gone.

Still, not sure what happened to my system cause changing the folder in 'find' to root and lot of stuff comes up, so running the thing on my whole system now.

----------

## yaneurabeya

Another note, because of the timezone difference, many Gentoo packages/ebuilds are assembled in the "future". I dunno if that has anything to do with anything.

Also... did you remember to set your clock to localtime and not GMT? This can be fixed by modifying /etc/rc.conf. It's set to GMT by default btw...

Clock skews are usually pretty large though if you're getting those errors. Not sure how large, but I know that the time difference between me, wherever some of the Gentoo packages are located/compiled, and the GMT difference initially (before I fixed my rc.conf), a lot of compiles complained, but did not fail.

----------

## Decibels

Ya, been having some weird things happening with the clock lately, stable in Gentoo now, keeps screwing up when go to window$ to work with Hammer, but at least stable in Gentoo (use ntp also).

But for several days before downloaded the new kernel clock has been correct, timezone,... Have been having problems with portage wanting to downgrade/upgrade baselayout versions with or without sysvinit. That may have been part of my problem. Did just reset my time to 'local' from 'UTC' yesterday. That got me again.

Like you, I thought it was in /etc/rc.conf. But when it put the new rc.conf while back it wasn't there. Looked in the install docs and only saw about symlinking /etc/localtime to timezone. Go to the install doc (one page) search for clock, local, utc, nothing about where that is now. You will only find about symlinking /etc/localtime. About the time, they just talk about setting it correctly with date.

Grep'ped it and found it in /etc/conf.d/clock. Set it to local there.

----------

