[oe-commits] [openembedded-core] 05/05: initscripts: Add support for /etc/default/timestamp

git at git.openembedded.org git at git.openembedded.org
Mon Mar 4 14:59:19 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit b4de37b7176630d9585b12c50d537cd561c7aeb9
Author: Jeroen Hofstee via Openembedded-core <openembedded-core at lists.openembedded.org>
AuthorDate: Fri Mar 1 20:16:02 2019 +0000

    initscripts: Add support for /etc/default/timestamp
    
    Source /etc/default/timestamp if present. This allows the rootfs to be
    read-only / store the file in a persistant location if the whole rootfs
    is updated.
    
    Signed-off-by: Jeroen Hofstee <jhofstee at victronenergy.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 7 +++++--
 meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh | 6 +++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
index df553bc..591591f 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -8,7 +8,10 @@
 # Short-Description: Misc and other.
 ### END INIT INFO
 
+TIMESTAMP_FILE=/etc/timestamp
+
 . /etc/default/rcS
+[ -f /etc/default/timestamp ] && . /etc/default/timestamp
 #
 # Put a nologin file in /etc to prevent people from logging in before
 # system startup is complete.
@@ -64,10 +67,10 @@ fi
 # If the timestamp is more recent than the current time,
 # use the timestamp instead.
 test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start
-if test -e /etc/timestamp
+if test -e "$TIMESTAMP_FILE"
 then
 	SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S`
-	read TIMESTAMP < /etc/timestamp
+	read TIMESTAMP < "$TIMESTAMP_FILE"
 	if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
 		# format the timestamp as date expects it (2m2d2H2M4Y.2S)
 		TS_YR=${TIMESTAMP%??????????}
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
index 1632a5f..ffa1eee 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
@@ -9,5 +9,9 @@
 # Description:       
 ### END INIT INFO
 
+TIMESTAMP_FILE=/etc/timestamp
+
+[ -f /etc/default/timestamp ] && . /etc/default/timestamp
+
 # Update the timestamp
-date -u +%4Y%2m%2d%2H%2M%2S 2>/dev/null > /etc/timestamp
+date -u +%4Y%2m%2d%2H%2M%2S 2>/dev/null > "$TIMESTAMP_FILE"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list