All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] busybox: add ts72xx hwclock-default file and modify hwclock.sh
@ 2010-10-19 22:04 Petr Štetiar
  2010-10-22  8:32 ` Petr Štetiar
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Štetiar @ 2010-10-19 22:04 UTC (permalink / raw)
  To: openembedded-devel

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>
---
 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

diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
index 401f6ad..362ab9c 100644
--- a/recipes/busybox/busybox.inc
+++ b/recipes/busybox/busybox.inc
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
 SECTION = "base"
 PRIORITY = "required"
 
-INC_PR = "r35"
+INC_PR = "r36"
 
 SRC_URI = "\
   file://busybox-cron \
diff --git a/recipes/busybox/files/hwclock.sh b/recipes/busybox/files/hwclock.sh
old mode 100644
new mode 100755
index 1bc9de3..b55da2e
--- 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 0000000..8ab3fd4
--- /dev/null
+++ b/recipes/busybox/files/ts72xx/hwclock-default
@@ -0,0 +1,2 @@
+HWCLOCKACCESS=yes
+HWCLOCKDEVICE=/dev/rtc1
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] busybox: add ts72xx hwclock-default file and modify hwclock.sh
  2010-10-19 22:04 [PATCH] busybox: add ts72xx hwclock-default file and modify hwclock.sh Petr Štetiar
@ 2010-10-22  8:32 ` Petr Štetiar
  2010-10-25 23:09   ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Štetiar @ 2010-10-22  8:32 UTC (permalink / raw)
  To: Petr Štetiar; +Cc: openembedded-devel

Ping, pong?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] busybox: add ts72xx hwclock-default file and modify hwclock.sh
  2010-10-22  8:32 ` Petr Štetiar
@ 2010-10-25 23:09   ` Khem Raj
  2010-10-26 12:35     ` Petr Štetiar
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2010-10-25 23:09 UTC (permalink / raw)
  To: openembedded-devel; +Cc: openembedded-devel

On Fri, Oct 22, 2010 at 1:32 AM, Petr Štetiar <ynezz@true.cz> wrote:
> Ping, pong?
>

check with latest master or the patch status at
patchwork.openemebedded.org before you send a ping here :)

> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] busybox: add ts72xx hwclock-default file and modify hwclock.sh
  2010-10-25 23:09   ` Khem Raj
@ 2010-10-26 12:35     ` Petr Štetiar
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Štetiar @ 2010-10-26 12:35 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-devel, openembedded-devel

Khem Raj <raj.khem@gmail.com> [2010-10-25 16:09:38]:

> On Fri, Oct 22, 2010 at 1:32 AM, Petr Štetiar <ynezz@true.cz> wrote:
> > 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-26 12:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 22:04 [PATCH] busybox: add ts72xx hwclock-default file and modify hwclock.sh Petr Štetiar
2010-10-22  8:32 ` Petr Štetiar
2010-10-25 23:09   ` Khem Raj
2010-10-26 12:35     ` Petr Štetiar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.