View previous topic :: View next topic |
Author |
Message |
Despot Despondency Apprentice
Joined: 14 Mar 2009 Posts: 176
|
Posted: Tue Mar 31, 2009 10:25 am Post subject: resetting system clock [SOLVED] |
|
|
Hi, we have just had the clock go forward one hour in my country for daylight saving so I want to update the clock on my computer appropriately. I've done this through the KMenu using KMenu -> System Administration -> Date & Time, however when I reboot the computer the clock has gone back to its previous setting. How can I change to clock permanently? Thanks in advance.
Last edited by Despot Despondency on Thu Apr 02, 2009 7:31 pm; edited 1 time in total |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Wed Apr 01, 2009 4:29 pm Post subject: |
|
|
A few things to do here:
1) Make sure you have your TIMEZONE var listed in /etc/conf.d/clock (or hwclock depending on which file is installed on your machine), for example:
Code: | TIMEZONE="America/New_York" |
2) I'm not sure if htis is still required, but I still use it, symlink /etc/localtime to your correct timezone. For my setup this is:
Code: | $ ls -l /etc/localtime
lrwxrwxrwx 1 root root 36 2009-04-01 14:11 /etc/localtime -> /usr/share/zoneinfo/America/New_York |
3) Check your /etc/conf.d/clock (or hwclock) to see if you are syncing your system clock to your hardware clock on shutdown:
Code: | CLOCK_SYSTOHC="yes" |
4) Finally, set your system time to whatever it should be, then run the following command to sync the system time to your hardware clock.
|
|
Back to top |
|
|
Despot Despondency Apprentice
Joined: 14 Mar 2009 Posts: 176
|
Posted: Wed Apr 01, 2009 8:12 pm Post subject: |
|
|
Hey, thanks for your reply.
Quote: |
1) Make sure you have your TIMEZONE var listed in /etc/conf.d/clock (or hwclock depending on which file is installed on your machine), for example:
|
I've got my timezone set properly in /etc/conf.d/clock, so that shouldn't be a problem.
Quote: |
3) Check your /etc/conf.d/clock (or hwclock) to see if you are syncing your system clock to your hardware clock on shutdown:
|
I also have this set in my /etc/conf.d/clock, so again that shouldn't be a problem.
I think it's to do with connecting with the hardware clock becuase when I run
Code: |
hwclock --systohc --debug
|
I get the following error
Code: |
hwclock from util-linux-ng 2.14.1
hwclock: Open of /dev/rtc failed, errno=2: No such file or directory.
No usable clock interface found.
Cannot access the Hardware Clock via any known method.
|
Also I get the following error everytime I reboot my computer
Code: |
Failed to set clock, you will have to set clock yourself
|
I've read about and it seems I need to add CONFIG_RTC to the kernel. Is that right, or how else to I solve this problem? I had a look for the option through genkernel but I couldn't find it. |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Wed Apr 01, 2009 9:01 pm Post subject: |
|
|
Yep, that sounds like the missing /dev/rtc is probably causing the problem. Here's the path to it in menuconfig:
Code: |
x Symbol: RTC [=m] x
x Prompt: Enhanced Real Time Clock Support (legacy PC RTC driver) x
x Defined at drivers/char/Kconfig:766 x
x Depends on: RTC_LIB=n && !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV && !ARM && !SUPERH && !S390 && x
x Location: x
x -> Device Drivers x
x -> Character devices
|
BTW - If you weren't already aware, to search menuconfig all you need to do is press the / key and then enter the text to search for (e.g. RTC). |
|
Back to top |
|
|
Despot Despondency Apprentice
Joined: 14 Mar 2009 Posts: 176
|
Posted: Wed Apr 01, 2009 10:13 pm Post subject: |
|
|
Hey, thanks for your response. I must be missing something because I've done
Code: |
cd /usr/src/linux
make menuconfig
|
but when I go to
Code: |
Device Drivers ---> Character devices
|
I can't find Enhanced Real Time Clock Support anywhere. It shows up when I search for it (I get the same message as you get). What does this mean? |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Thu Apr 02, 2009 12:52 am Post subject: |
|
|
What arch are you using? It is saying that if you use the PPC, PARISC, IA64, M68K, SPARC, FRV, ARM,SUPERH, S390 archs you can't use RTC. It also depends on having RTC_LIB=n. |
|
Back to top |
|
|
Despot Despondency Apprentice
Joined: 14 Mar 2009 Posts: 176
|
Posted: Thu Apr 02, 2009 2:33 pm Post subject: |
|
|
I'm using x86_64 so I don't think that is a problem. I disabled 'Device Drivers -> Real Time Clock', is that what you mean by having RTC_LIB=n? Now I have the option 'Device Drivers -> Character Devices -> Enhanced Real Time Clock Support (legacy PC RTC driver) ' whcih I've enabled, but now when I try to compile the kernel I get the following
Code: |
scripts/kconfig/conf -s arch/x86/Kconfig
CHK include/linux/version.h
CHK include/linux/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/linux/compile.h
CC arch/x86/kernel/hpet.o
LD arch/x86/kernel/built-in.o
GZIP kernel/config_data.gz
IKCFG kernel/config_data.h
CC kernel/configs.o
LD kernel/built-in.o
CC drivers/acpi/osl.o
LD drivers/acpi/built-in.o
LD drivers/char/built-in.o
CC [M] drivers/char/rtc.o
LD drivers/built-in.o
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD vmlinux
SYSMAP System.map
OBJCOPY arch/x86/boot/compressed/vmlinux.bin
GZIP arch/x86/boot/compressed/vmlinux.bin.gz
LD arch/x86/boot/compressed/piggy.o
LD arch/x86/boot/compressed/vmlinux
OFFSETS arch/x86/boot/offsets.h
AS arch/x86/boot/header.o
CC arch/x86/boot/version.o
LD arch/x86/boot/setup.elf
OBJCOPY arch/x86/boot/setup.bin
OBJCOPY arch/x86/boot/vmlinux.bin
BUILD arch/x86/boot/bzImage
Root device is (8, 3)
Setup is 11640 bytes (padded to 11776 bytes).
System is 2507 kB
CRC 4725fda1
Kernel: arch/x86/boot/bzImage is ready (#9)
Building modules, stage 2.
MODPOST 1184 modules
WARNING: modpost: Found 2 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
CC drivers/char/rtc.mod.o
LD [M] drivers/char/rtc.ko
|
I'm going to do 'make CONFIG_DEBUG_SECTION_MISMATCH=y' and see what happens, but I just wanted to check that this is what you meant. |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Thu Apr 02, 2009 3:15 pm Post subject: |
|
|
Yeah, it looks like you got it right. As you probably saw, RTC_LIB is selected by RTC_CLASS:
Code: | x Symbol: RTC_LIB [=n] x
x Selected by: RTC_CLASS && !S390 x
|
RTC_CLASS seems to be located at Device Drivers -> Real Time Clock:
Code: | x Symbol: RTC_CLASS [=n] x
x Prompt: Real Time Clock x
x Defined at drivers/rtc/Kconfig:8 x
x Depends on: !S390 x
x Location: x
x -> Device Drivers x
x Selects: RTC_LIB x
|
Just an FYI - I have both those vars selected as =n in my config. I'm not exactly sure why you are getting the mismatch error. I have CONFIG_DEBUG_SECTION_MISMATCH=n, but it might be worthwhile to enable it to see what is going on. I've never run into that before, but if I get a chance later I'll do some digging. |
|
Back to top |
|
|
Despot Despondency Apprentice
Joined: 14 Mar 2009 Posts: 176
|
Posted: Thu Apr 02, 2009 7:33 pm Post subject: |
|
|
Just rebooted my computer and I've managed to set the hardware clock, so everything seems to be working fine. Thanks for your help! |
|
Back to top |
|
|
|