diff options
author | Tom Gundersen <teg@jklm.no> | 2011-06-25 00:55:17 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2011-06-25 01:27:53 +0200 |
commit | 713213c19395fd1541cdaa025ac5f977d062108a (patch) | |
tree | ab2a78555946d3e0ee511973f8cdba0e614960bf /rc.sysinit | |
parent | ac55830ea6cfa2c130275ebd6b4f2c0fea80130e (diff) |
hwclock: show status
Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-x | rc.sysinit | 47 |
1 files changed, 26 insertions, 21 deletions
@@ -47,27 +47,32 @@ case $HARDWARECLOCK in esac if [[ $HWCLOCK_PARAMS ]]; then - # enable rtc access - modprobe -q -a rtc-cmos rtc genrtc - # If devtmpfs is used, the required RTC device already exists now - # Otherwise, create whatever device is available - if ! [[ -c /dev/rtc || -c /dev/rtc0 ]]; then - for dev in /sys/class/rtc/rtc0/dev /sys/class/misc/rtc/dev; do - [[ -e $dev ]] || continue - IFS=: read -r major minor < "$dev" - mknod /dev/rtc c $major $minor - done - fi - - # Adjust the system time for timezone offset if rtc is not in UTC - # 1. Make creation time on udev nodes sane (FS#8665) - # 2. Filesystem checks can depend on system time - # 3. This also sets the kernel time zone, used by e.g. vfat - # If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime - # is used. If HARDWARECLOCK is not set in rc.conf, the value in - # /var/lib/hwclock/adjfile is used (in this case /var can not be a separate - # partition). - TZ=$TIMEZONE && hwclock $HWCLOCK_PARAMS + stat_busy "Adjusting system time and setting kernel timezone" + # enable rtc access + modprobe -q -a rtc-cmos rtc genrtc + # If devtmpfs is used, the required RTC device already exists now + # Otherwise, create whatever device is available + if ! [[ -c /dev/rtc || -c /dev/rtc0 ]]; then + for dev in /sys/class/rtc/rtc0/dev /sys/class/misc/rtc/dev; do + [[ -e $dev ]] || continue + IFS=: read -r major minor < "$dev" + mknod /dev/rtc c $major $minor + done + fi + + # Adjust the system time for timezone offset if rtc is not in UTC + # 1. Make creation time on udev nodes sane (FS#8665) + # 2. Filesystem checks can depend on system time + # 3. This also sets the kernel time zone, used by e.g. vfat + # If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime + # is used. If HARDWARECLOCK is not set in rc.conf, the value in + # /var/lib/hwclock/adjfile is used (in this case /var can not be a separate + # partition). + if TZ=$TIMEZONE hwclock $HWCLOCK_PARAMS; then + stat_done + else + stat_fail + fi fi # Start/trigger UDev, load MODULES and settle UDev |