Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 290208 - sys-fs/udev Incorrect create time of special files in /dev/*
Summary: sys-fs/udev Incorrect create time of special files in /dev/*
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-23 08:33 UTC by Marcin Mirosław
Modified: 2013-04-27 08:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Mirosław 2009-10-23 08:33:04 UTC
Files in /dev dir has inccorect modify time. They were created without using timezone. For example, i'm starting OS at 10:09 (localtime, in UTC it's 12:09)
and time of files looks like this:
# ls --full-time /dev/zero
crw-rw-rw- 1 root root 1, 5 2009-10-23 12:09:51.076006747 +0200 /dev/zero
# date
pią, 23 paź 2009, 10:31:03 CEST




Reproducible: Always
Comment 1 Marcin Mirosław 2009-10-23 08:59:05 UTC
Bios time is correct, it is in local time.
Comment 2 Marcin Mirosław 2009-10-23 09:35:08 UTC
Ech, one more thing, i'm not sure it's bug is more related to udev or to openrc.
Comment 3 Matthias Schwarzott gentoo-dev 2009-10-27 13:43:11 UTC
This is a system clock issue.
Up to date kernels have a rtc driver and read system time at startup.
They interprete the read time in UTC.
What you want is that openrc does fixup system time or read hwclock before udev starts.
Comment 4 Marcin Mirosław 2009-10-27 14:24:54 UTC
Problem is a little peculiar for me, i've got a second machine with similar configuration, and version of openrc/udev (ACCEPT_KEYWORDS="~x86") but problem appear only at once machine. Still i don't know which difference between them is meanignful.
Comment 5 Roy Marples 2009-11-10 20:12:25 UTC
Is /etc/localtime is a symlink and /usr is not on /?
Comment 6 Marcin Mirosław 2009-11-10 21:33:23 UTC
(In reply to comment #5)
> Is /etc/localtime is a symlink and /usr is not on /?

It would be too simple. /etc/localtime isn't symlink, it's regular file. I tried to reproduce this problem on 3 box. On the two of them problem appears (~amd64 and ~x86), but third box (~x86) behaves correctly.
Comment 7 Matthias Schwarzott gentoo-dev 2009-11-17 09:06:28 UTC
So the basic problem here is: The files have timestamps in the future.

Does it work if you do
1. Add clock to the need lines in /etc/init.d/udev.
2. Add
depend() {
  need clock
}
to /etc/init.d/udev-mount.
3. Add hwclock to runlevel sysinit.
rc-update add hwclock sysinit
Comment 8 Matthias Schwarzott gentoo-dev 2009-11-17 09:59:37 UTC
(In reply to comment #7)
> Does it work if you do
> 3. Add hwclock to runlevel sysinit.
> rc-update add hwclock sysinit
This step 3 should be enough, as depend of hwclock contains "before *".
Comment 9 Marcin Mirosław 2009-11-17 11:11:30 UTC
(In reply to comment #7)
> So the basic problem here is: The files have timestamps in the future.

Yes, but only through one hour.

(In reply to comment #8)
> (In reply to comment #7)
> > Does it work if you do
> > 3. Add hwclock to runlevel sysinit.
> > rc-update add hwclock sysinit
> This step 3 should be enough, as depend of hwclock contains "before *".

I added hwclock to runlevel. Now i'm getting:
* /mounting/proc...
hwclock |* SEtting system clock using hardware clock [Local]
hwclock |RTC_RD_TIME: Niewlasciwy ioctl dla urzadzenia
(in english: RTC_RD_TIME: Incorrect ioctl for device)
hwclock |ioctl() to /dev/rtc to read the time failed.
hwclock |* Failed to set the system clock
======================

# LC_ALL="en-US" ls -lah /dev/rtc*
ls: cannot access /dev/rtc*: No such file or directory
# mount --bind / /mnt/test/
# LC_ALL="en-US" ls -lah /mnt/test/dev/rtc*
lrwxrwxrwx 1 root root      4 Aug  4 14:17 /mnt/test/dev/rtc -> rtc0
crw-r--r-- 1 root root 254, 0 Aug  4 14:17 /mnt/test/dev/rtc0




Comment 10 SpanKY gentoo-dev 2010-03-07 15:44:56 UTC
do you have the rtc drivers built into your kernel ?
Comment 11 Marcin Mirosław 2010-03-08 20:02:58 UTC
# zgrep -i rtc /proc/config.gz |grep -v "^#"
CONFIG_HPET_EMULATE_RTC=y
CONFIG_RTC_LIB=m
CONFIG_RTC_CLASS=m
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_DRV_CMOS=m

# lsmod | grep -i rtc
rtc_cmos                9367  0
rtc_core               14801  1 rtc_cmos
rtc_lib                 2320  1 rtc_core

Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2013-01-27 14:06:07 UTC
hmm, udev's init script deps on fsck's init script which again pulls in clock before

is this any of problem with >=sys-fs/udev-197-r3 and the new sys-fs/udev-init-scripts?
Comment 13 Marcin Mirosław 2013-02-01 09:46:55 UTC
Now I have installed sys-fs/udev-197-r5 and sys-fs/udev-init-scripts-22, files in /dev/* has correct time.
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2013-02-01 09:48:32 UTC
(In reply to comment #13)
> Now I have installed sys-fs/udev-197-r5 and sys-fs/udev-init-scripts-22,
> files in /dev/* has correct time.

no reason to keep this open then, thanks for checking
Comment 15 SpanKY gentoo-dev 2013-04-27 08:41:35 UTC
honestly, i'm not sure why this ever mattered.  nothing cares about those timestamps.