Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 184236 - "clock" init script fails with util-linux-2.12r-r7
Summary: "clock" init script fails with util-linux-2.12r-r7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-04 22:16 UTC by Albin Stjerna
Modified: 2007-07-20 22:02 UTC (History)
0 users

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 Albin Stjerna 2007-07-04 22:16:09 UTC
The clock init script fails to set the time at boot-up (or later). Note that it works just fine on my amd64 box witht the same version of util-linux.

Reproducible: Always

Steps to Reproduce:
run the init script /etc/init.d/clock or simply boot up the computer
Actual Results:  
pandora ~ # /etc/init.d/clock restart
 * WARNING:  you are stopping a boot service.
 * Setting system clock using the hardware clock [UTC] ...
 * hwclock: settimeofday() failed, errno=22: Invalid argument.
 * Failed to set clock You will need to set the clock yourself                                             [ !! ]


Problem present:
pandora ~ # emerge --info
Portage 2.1.3_rc6 (default-linux/ppc/ppc32/2007.0/G3, gcc-4.1.2, glibc-2.5-r4, 2.6.21-gentoo-r3 ppc)
=================================================================
System uname: 2.6.21-gentoo-r3 ppc 750CXe
Gentoo Base System release 1.12.10
Timestamp of tree: Tue, 03 Jul 2007 21:50:01 +0000
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="ppc ~ppc"
AUTOCLEAN="yes"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=G3 -mtune=G3 -fno-strict-aliasing -pipe"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -mcpu=G3 -mtune=G3 -fno-strict-aliasing -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans"
GENTOO_MIRRORS="ftp://ftp.public.fix.fi/gentoo ftp://trumpetti.atm.tut.fi/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo"
LC_ALL="en_GB.UTF-8"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aalib acl alsa apm bash-completion berkdb bitmap-fonts bzip2 cli cracklib crypt cups dbus dri dv firefox fortran gdbm gpm hal ibam iconv ipv6 isdnlog laptop libg++ logrotate midi mudflap ncurses nls nptl nptlonly opengl openmp pcmcia pcre perl ppc pppd python readline reflection session spl ssl tcpd truetype truetype-fonts type1-fonts unicode usb vim vim-syntax xorg zlib" ALSA_CARDS="powermac" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse ps2mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="r128 fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
----
Problem not present:
emerge --info
Portage 2.1.3_rc6 (default-linux/amd64/2007.0/desktop, gcc-4.1.2, glibc-2.5-r3, 2.6.21-gentoo-r3 x86_64)
=================================================================
System uname: 2.6.21-gentoo-r3 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System release 1.12.10
Timestamp of tree: Mon, 02 Jul 2007 23:50:01 +0000
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.5.1-r2
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/glftpd/etc /opt/glftpd/ftp-data /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=k8 -O2 -pipe -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans"
GENTOO_MIRRORS="http://ftp.public.fix.fi/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://213.186.33.37/gentoo-distfiles/ ftp://ftp.mneisen.org/gentoo ftp://212.219.56.139/sites/www.ibiblio.org/gentoo/ http://gentoo.mirror.solnet.ch ftp://212.219.56.133/sites/www.ibiblio.org/gentoo/ ftp://213.186.33.38/gentoo-distfiles/"
LANG="en_GB.UTF-8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/portage/local/layman/berkano /usr/portage/local/layman/drizzt-overlay /usr/portage/local/layman/zugaina /usr/portage/local/layman/mpd"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aalib acl acpi adns alsa amd64 audiofile bash-completion berkdb bitmap-fonts cairo canna cdparanoia cdr clamav cli cracklib crypt cups curl dbus dga dri dts dv dvd dvdr dvdread emacs emboss encode evo exif fam ffmpeg firefox flac foomaticdb fortran ftp gdbm gif gimp glib glut gphoto2 gpm gstreamer gtk gtk2 hal iconv iee1394 imagemagick ipod ipv6 isdnlog jabber jack jpeg jpeg2k kerberos krb4 ldap libg++ logrotate mad matroska midi mikmod mmx mmxext mono mp3 mp4 mpeg mplayer msn mudflap musepack ncurses nlp nls nptl nptlonly ogg openal opengl openmp pam pcre pdf perl png pppd python qt3 qt3support qt4 quicktime readline recode reflection samba sdl session spell spl sqlite3 sse sse2 ssl svg tcpd tetex theora tiff truetype truetype-fonts type1-fonts unicode usb vim vim-syntax vorbis x264 xine xml xorg xv xvid zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2007-07-06 20:38:49 UTC
hwclock merely operates on /dev/rtc ... if that fails, your kernel is misconfigured
Comment 2 Maarten Bressers (RETIRED) gentoo-dev 2007-07-19 22:20:40 UTC
So do you mean you were able to set the time with the previous version of util-linux (2.12r-r5) installed? 

Could you please post the following:
- your kernel .config
- your dmesg output
- the output of: cat /proc/driver/rtc
Thanks.
Comment 3 Albin Stjerna 2007-07-19 22:41:33 UTC
No I couldn't get it to work with the older version. And I can't get it to work with neither the gentoo boot CD nor the debian ppc boot CD so I think it's safe to assume it's a hardware issue. Though I'm sure it worked in the early stages of the installation. Anyone got any clues on what might be wrong?
Comment 4 Maarten Bressers (RETIRED) gentoo-dev 2007-07-20 18:31:54 UTC
Can you run the init script through strace, like so:

# strace -o clock_strace /etc/init.d/clock start

and post the output here? Thanks.
Comment 5 Maarten Bressers (RETIRED) gentoo-dev 2007-07-20 18:33:24 UTC
The output will in the file clock_strace. Sorry, forgot to mention that.
Comment 6 Albin Stjerna 2007-07-20 18:36:29 UTC
Heh, actually it was my system clock that had gone mad, I got a hint in #gentoo-ppc to run hwclock --systohc and that fixed it. Sorry for the trouble, I'm not really used to the ppc arch.
Comment 7 Daniel Drake (RETIRED) gentoo-dev 2007-07-20 18:47:23 UTC
 * Setting system clock using the hardware clock [UTC] ...
 * hwclock: settimeofday() failed, errno=22: Invalid argument.

The problem occurs when you are setting the system clock from the hardware clock. In other words, you'll probably see this problem again on next boot, even if you did manage to sync system clock to hardware (which uses a totally different codepath).

The settimeofday() system call manipulates the system clock, so it does seem like a bug that it fails, and it is unlikely to be a hardware bug.

If you are interested in pursuing further, please reopen with strace output. However, the above command won't work as it won't actually trace the hwclock process, only the init script.

You need to add the -f option i.e.

# strace -f -o clock_strace /etc/init.d/clock start
Comment 8 Albin Stjerna 2007-07-20 22:02:27 UTC
That's what's so puzzling: it *does* work next boot-up. And the boot-up after that.