1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 # T2 SDE: package/.../stone/stone_mod_hardware.sh
5 # Copyright (C) 2004 - 2020 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 # [MAIN] 20 hardware Kernel Drivers and Hardware Configuration
19 if [ -f /etc
/conf
/clock ] ; then
20 sed -e "s/clock_tz=.*/clock_tz=$clock_tz/" \
21 -e "s/clock_rtc=.*/clock_rtc=$clock_rtc/" \
22 < /etc
/conf
/clock > /etc
/conf
/clock.tmp
23 grep -q clock_tz
= /etc
/conf
/clock.tmp || \
24 echo clock_tz
=$clock_tz >> /etc
/conf
/clock.tmp
25 grep -q clock_rtc
= /etc
/conf
/clock.tmp || \
26 echo clock_rtc
=$clock_rtc >> /etc
/conf
/clock.tmp
27 mv /etc
/conf
/clock.tmp
/etc
/conf
/clock
29 echo -e "clock_tz=$clock_tz\nclock_rtc=$clock_rtc\n" \
32 if [ -w /proc
/sys
/dev
/rtc
/max-user-freq
-a "$clock_rtc" ] ; then
33 echo $clock_rtc > /proc
/sys
/dev
/rtc
/max-user-freq
39 hwclock --hctosys --$clock_tz
44 gui_input
"Set new enhanced real time clock precision" \
45 "$clock_rtc" "clock_rtc"
52 clock_rtc
="`cat /proc/sys/dev/rtc/max-user-freq 2> /dev/null`"
53 if [ -f /etc
/conf
/clock ]; then
57 cmd
="gui_menu hw 'Kernel Drivers and Hardware Configuration'"
59 if [ "$clock_tz" = localtime
] ; then
60 cmd
="$cmd '[*] Use localtime instead of utc' 'set_zone utc'"
62 cmd
="$cmd '[ ] Use localtime instead of utc' 'set_zone localtime'"
65 cmd
="$cmd 'Set enhanced real time clock precision ($clock_rtc)' set_rtc"