diff mbox

[5/5] busybox: Add use flag for using utc in busybox-hwclock

Message ID 307d8fcc95978830a664756dd62bacffdbd7e776.1406533543.git.christian.braunersorensen@prevas.dk
State Under Review
Delegated to: Kim
Headers show

Commit Message

christian.braunersorensen@prevas.dk July 28, 2014, 8:27 a.m. UTC
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

Use flag added: busybox_hwclock_utc
Is not set by default, meaning UTC is by default not used. If set, enables
use of UTC in busybox-hwclock

Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
---
 recipes/busybox/busybox-configure.inc | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/recipes/busybox/busybox-configure.inc b/recipes/busybox/busybox-configure.inc
index 9e545fb..92e616a 100644
--- a/recipes/busybox/busybox-configure.inc
+++ b/recipes/busybox/busybox-configure.inc
@@ -215,6 +215,17 @@  DEFAULT_USE_busybox_hwclock_sysvinit_stop  = "15"
 RECIPE_FLAGS += "busybox_hwclock_splashutils_progress busybox_hwclock_splashutils_msg"
 SPLASHUTILS_INITSCRIPTS:>USE_busybox_hwclock += " busybox_hwclock"
 DEFAULT_USE_busybox_hwclock_splashutils_msg = "\"Starting Busybox HWclock\""
+RECIPE_FLAGS += "busybox_hwclock_utc"
+DO_CONFIGURE_PREFUNCS += " do_configure_busybox_hwclock_use_utc"
+do_configure_busybox_hwclock_use_utc () {
+	if [ -n "$USE_busybox_hwclock" ]; then
+		if [ -z "$USE_busybox_hwclock_utc" ]; then
+			sed -i -e 's/HWCLOCK_UTC//' ${SRCDIR}/busybox-hwclock
+		else
+			sed -i -e 's/HWCLOCK_UTC/\-\-utc/' ${SRCDIR}/busybox-hwclock
+		fi
+	fi
+}
 
 RECIPE_FLAGS += "busybox_hwclock_crontab"
 # USE flag: synchronize to rtc every hour using crond