init-scripts: fix save-rtc error with date formatting on uclibc
authorPetr Štetiar <ynezz@true.cz>
Sun, 3 Oct 2010 04:54:19 +0000 (04:54 +0000)
committerKhem Raj <raj.khem@gmail.com>
Wed, 6 Oct 2010 22:23:08 +0000 (15:23 -0700)
uClibc's date does support only SUSv3 strptime[1], so the date command in
save-rtc.sh fails with 'date: invalid date '%2m%2d%2H%2M2010'.

1. http://www.opengroup.org/onlinepubs/009695399/functions/strptime.html

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
recipes/initscripts/files/save-rtc-uclibc.sh [new file with mode: 0644]
recipes/initscripts/initscripts_1.0.bb

diff --git a/recipes/initscripts/files/save-rtc-uclibc.sh b/recipes/initscripts/files/save-rtc-uclibc.sh
new file mode 100644 (file)
index 0000000..8f4e587
--- /dev/null
@@ -0,0 +1,5 @@
+#! /bin/sh
+/etc/init.d/hwclock.sh stop
+
+# Update the timestamp
+date +%m%d%H%M%Y > /etc/timestamp
index 8c38d7f..cc60624 100644 (file)
@@ -4,7 +4,7 @@ PRIORITY = "required"
 DEPENDS = "makedevs"
 RDEPENDS_${PN} = "makedevs"
 LICENSE = "GPL"
-PR = "r123"
+PR = "r124"
 
 SRC_URI = "file://functions \
            file://halt \
@@ -31,7 +31,8 @@ SRC_URI = "file://functions \
            file://device_table.txt \
            file://populate-volatile.sh \
            file://volatiles \
-           file://save-rtc.sh"
+           file://save-rtc.sh \
+           file://save-rtc-uclibc.sh"
 
 SRC_URI_append_arm = " file://alignment.sh"
 
@@ -137,3 +138,12 @@ do_install_append_angstrom () {
 do_install_append_hipox () {
        ln -sf          ../init.d/sysfs.sh      ${D}${sysconfdir}/rc6.d/S80sysfs
 }
+
+# uclibc's date does support only SUSv3 strptime()
+do_install_append_linux-uclibc() {
+       install -m 0755    ${WORKDIR}/save-rtc-uclibc.sh ${D}${sysconfdir}/init.d/save-rtc.sh
+}
+
+do_install_append_linux-uclibceabi() {
+       install -m 0755    ${WORKDIR}/save-rtc-uclibc.sh ${D}${sysconfdir}/init.d/save-rtc.sh
+}