]>
Commit | Line | Data |
---|---|---|
73d9a908 MT |
1 | #!/bin/sh |
2 | ######################################################################## | |
3 | # Begin $rc_base/init.d/setclock | |
4 | # | |
5 | # Description : Setting Linux Clock | |
6 | # | |
7 | # Authors : Gerard Beekmans - gerard@linuxfromscratch.org | |
8 | # | |
9 | # Version : 00.00 | |
10 | # | |
11 | # Notes : | |
12 | # | |
13 | ######################################################################## | |
14 | ||
15 | . /etc/sysconfig/rc | |
16 | . ${rc_functions} | |
73d9a908 MT |
17 | |
18 | CLOCKPARAMS= | |
19 | ||
73d9a908 MT |
20 | case ${1} in |
21 | start) | |
1313b031 | 22 | |
73d9a908 | 23 | boot_mesg "Setting system clock..." |
1313b031 AF |
24 | |
25 | # udev not create the rtc symlink if rtc is in the kernel | |
26 | if [ ! -e /dev/rtc ]; then | |
27 | ln -s rtc0 /dev/rtc | |
28 | fi | |
29 | ||
73d9a908 MT |
30 | hwclock --hctosys ${CLOCKPARAMS} &>/dev/null |
31 | evaluate_retval | |
32 | ;; | |
33 | ||
34 | stop) | |
35 | boot_mesg "Setting hardware clock..." | |
36 | hwclock --systohc ${CLOCKPARAMS} &>/dev/null | |
37 | evaluate_retval | |
38 | ;; | |
39 | ||
40 | *) | |
41 | echo "Usage: ${0} {start}" | |
42 | ;; | |
43 | ||
44 | esac |