LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1685|回复: 18

启动时无法设定时钟(解决了一半)

[复制链接]
发表于 2008-1-21 14:47:05 | 显示全部楼层 |阅读模式
rt
无论我把/etc/clock里面设成“local”还是“UTC”
启动时都不能设定时间,先卡一下,然后报错。
大家有没有类似情况的,怎么解决呢?
发表于 2008-1-21 15:07:03 | 显示全部楼层
dmesg,查看一下启动日志
回复 支持 反对

使用道具 举报

发表于 2008-1-21 19:33:54 | 显示全部楼层
pls post the error message.
回复 支持 反对

使用道具 举报

发表于 2008-1-21 19:50:32 | 显示全部楼层
$ ls /dev/rtc

看看有没有,如果没有的话就是这个情况:

/dev/rtc 不存在。

这种情况是由于没加载 genrtc ,伴随的问题还会有不能修改硬件时间等。

解决方法是把 Device Drivers --->Character devices --->Enhanced Real Time Clock Support
编译进内核,或者编译成模块,并在 /etc/modules.autoload.d/kernel-2.6 中加载.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-1-21 21:18:03 | 显示全部楼层
now I'm in Gentoo,so.....
yes,the error message indeed contain the worlds "/dev/rtc"
thanks for your cue!!!
so,do you mean the only way to solve this problem is to rebuild the kernel?

I typed "ls /dev/rtc" just now,but according to the output
it seems the "rtc" device file is already exist
e,what should I do now?thank you.
回复 支持 反对

使用道具 举报

发表于 2008-1-21 21:44:10 | 显示全部楼层
vi /etc/conf.d/clock

CLOCK_OPTS="--directisa"

直接以I/O指令存取硬件时间而不通过/dev/rtc设备来存取

试试看~
回复 支持 反对

使用道具 举报

发表于 2008-1-21 22:45:02 | 显示全部楼层
或者可以试试这个:
$ hwclock --debug

hwclock 好像跟启动时检查时钟的服务用的是一样的库...
如果有问题的话,应该是 /dev/rtc 的问题
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-1-21 23:04:06 | 显示全部楼层
vivian ~ # hwclock --debug
hwclock from util-linux-ng 2.13
Using /dev interface to clock.
Last drift adjustment done at 0 seconds after 1969
Last calibration done at 0 seconds after 1969
Hardware clock is on unknown time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
select() to /dev/rtc to wait for clock tick timed out
...got clock tick
vivian ~ #

this is the result.

CLOCK_OPTS="--directisa" is work
but it will bring some extra information (begin with yellow *)
by the way,I didn't know how to get the booting log.  with "dmesg"?? it seems not.....
every time I boot the system,the information just flashed through my eyes......
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-1-22 07:37:53 | 显示全部楼层
非常感谢楼上几位的帮助,现在基本搞好了,没有错误了。

/etc/conf.d/clock的设置是 CLOCK_OPTS="--directisa"
我还改了脚本/etc/init.d/clock,用了hwclock的另一个参数
现在启动时既没有红色的错误,也没有黄色的警告,
但是时间还是不对,比正常快了8小时,
奇怪的是 在gnome面板上把时间设成UTC,时间反而和真正的localtime一样。。。

比较郁闷。不过感觉离真理又近了一步。。。
回复 支持 反对

使用道具 举报

发表于 2008-1-22 18:22:45 | 显示全部楼层
也许能有点用处?
[php]# /etc/conf.d/clock

# 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"

# Select the proper timezone.  For valid values, peek inside of the
# /usr/share/zoneinfo/ directory.  For example, some common values are
# "America/New_York" or "EST5EDT" or "Europe/Berlin".  If you want to
# manage /etc/localtime yourself, set this to "".

TIMEZONE="Asia/Shanghai"

# If you wish to pass any other arguments to hwclock during bootup,
# you may do so here.

CLOCK_OPTS="--directisa"

[/php]
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表