aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/busybox/files
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2010-10-19 12:04:07 +0000
committerKhem Raj <raj.khem@gmail.com>2010-10-20 18:30:23 -0700
commitb78d5938aafc288a8a39afec760c40fb756da7b9 (patch)
tree8cd72bfa2e918cf08bf0819a822e98a65da0b905 /recipes/busybox/files
parentcaa6106d5e60c2e5f0087abed6dabf3b570ef566 (diff)
downloadopenembedded-b78d5938aafc288a8a39afec760c40fb756da7b9.tar.gz
busybox: add ts72xx hwclock-default file and modify hwclock.sh
This patch simplifies the hwclock.sh init script and adds a possibility to fallback to default RTC device even if the device specified in HWCLOCKDEVICE doesn't exist. Signed-off-by: Petr Štetiar <ynezz@true.cz> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes/busybox/files')
-rwxr-xr-x[-rw-r--r--]recipes/busybox/files/hwclock.sh34
-rw-r--r--recipes/busybox/files/ts72xx/hwclock-default2
2 files changed, 12 insertions, 24 deletions
diff --git a/recipes/busybox/files/hwclock.sh b/recipes/busybox/files/hwclock.sh
index 1bc9de36a5..b55da2e3a4 100644..100755
--- a/recipes/busybox/files/hwclock.sh
+++ b/recipes/busybox/files/hwclock.sh
@@ -18,6 +18,12 @@
[ "$UTC" = yes ] && UTC=-u || UTC=-l
+if [ ! -z "$HWCLOCKDEVICE" ]; then
+ if [ -e $HWCLOCKDEVICE ]; then
+ DEVICE="-f $HWCLOCKDEVICE"
+ fi
+fi
+
case "$1" in
start)
if [ "$VERBOSE" != no ]
@@ -30,19 +36,9 @@ case "$1" in
then
if [ -z "$TZ" ]
then
- if [ -z "$HWCLOCKDEVICE" ]
- then
- hwclock -s $UTC
- else
- hwclock -s $UTC -f $HWCLOCKDEVICE
- fi
+ hwclock -s $UTC $DEVICE
else
- if [ -z "$HWCLOCKDEVICE" ]
- then
- TZ="$TZ" hwclock -s $UTC
- else
- TZ="$TZ" hwclock -s $UTC -f $HWCLOCKDEVICE
- fi
+ TZ="$TZ" hwclock -s $UTC $DEVICE
fi
fi
@@ -65,12 +61,7 @@ case "$1" in
fi
if [ "$HWCLOCKACCESS" != no ]
then
- if [ -z "$HWCLOCKDEVICE" ]
- then
- hwclock -w $UTC
- else
- hwclock -w $UTC -f $HWCLOCKDEVICE
- fi
+ hwclock -w $UTC $DEVICE
fi
if [ "$VERBOSE" != no ]
then
@@ -81,12 +72,7 @@ case "$1" in
show)
if [ "$HWCLOCKACCESS" != no ]
then
- if [ -z "$HWCLOCKDEVICE" ]
- then
- hwclock -r $UTC
- else
- hwclock -r $UTC -f $HWCLOCKDEVICE
- fi
+ hwclock -r $UTC $DEVICE
fi
;;
*)
diff --git a/recipes/busybox/files/ts72xx/hwclock-default b/recipes/busybox/files/ts72xx/hwclock-default
new file mode 100644
index 0000000000..8ab3fd480c
--- /dev/null
+++ b/recipes/busybox/files/ts72xx/hwclock-default
@@ -0,0 +1,2 @@
+HWCLOCKACCESS=yes
+HWCLOCKDEVICE=/dev/rtc1