busybox: add ts72xx hwclock-default file and modify hwclock.sh
PATCH 1/1 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 <[email protected]>
--- recipes/busybox/busybox.inc | 2 +- recipes/busybox/files/hwclock.sh | 34 +++++++------------------ recipes/busybox/files/ts72xx/hwclock-default | 2 + 3 files changed, 13 insertions(+), 25 deletions(-) mode change 100644 => 100755 recipes/busybox/files/hwclock.sh create mode 100644 recipes/busybox/files/ts72xx/hwclock-default
recipes/busybox/busybox.inc +1 -1
@@ -11,7 +11,7 @@ LICENSE = "GPLv2" SECTION = "base" PRIORITY = "required" -INC_PR = "r35" +INC_PR = "r36" SRC_URI = "\ file://busybox-cron \
recipes/busybox/files/hwclock.sh +10 -24
@@ -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 ;; *)
recipes/busybox/files/ts72xx/hwclock-default new file +2 -0
@@ -0,0 +1,2 @@ +HWCLOCKACCESS=yes +HWCLOCKDEVICE=/dev/rtc1
Signature · 1 line
1.7.0.4
Ping, pong?
Quoted 2 lines · Petr Štetiar
Ping, pong?
check with latest master or the patch status at patchwork.openemebedded.org before you send a ping here :)
Quoted 5 lines
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Khem Raj <[email protected]> [2010-10-25 16:09:38]:
Quoted 6 lines · Petr Štetiar
Quoted 2 lines
Ping, pong?
check with latest master or the patch status at patchwork.openemebedded.org before you send a ping here :)
Yea, I really should. Thanks a lot :-)
-- ynezz