]> code.ossystems Code Review - openembedded-core.git/commitdiff
image.bbclass/initscripts: Make /etc/timestamp usage consistent.
authorGary Thomas <gary@mlbassoc.com>
Thu, 4 Nov 2010 11:34:12 +0000 (05:34 -0600)
committerSaul Wold <sgw@linux.intel.com>
Mon, 15 Nov 2010 05:08:22 +0000 (21:08 -0800)
 Timestamp is kept in UTC
 Remove superfluous 'create_etc_timestamp()' function
 - seems to be a duplicate of 'rootfs_update_timestamp()'
 Remove External function reference

[sgw@linux.intel.com: merged 2 patches and cleanup commit message]

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/image.bbclass
meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh

index 3db34ac1939cf83d48cc5f47bfbdc718b3afa57a..9fa0155c8a1a5e09ed508db0d32cbcfd1e77cff5 100644 (file)
@@ -182,10 +182,6 @@ zap_root_password () {
        mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd
 } 
 
-create_etc_timestamp() {
-       date +%2m%2d%2H%2M%Y >${IMAGE_ROOTFS}/etc/timestamp
-}
-
 # Turn any symbolic /sbin/init link into a file
 remove_init_link () {
        if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
@@ -217,7 +213,7 @@ set_image_autologin () {
 # Can be use to create /etc/timestamp during image construction to give a reasonably 
 # sane default time setting
 rootfs_update_timestamp () {
-       date "+%m%d%H%M%Y" >${IMAGE_ROOTFS}/etc/timestamp
+       date -u +%2m%2d%2H%2M%4Y >${IMAGE_ROOTFS}/etc/timestamp
 }
 
 # Prevent X from being started
@@ -239,7 +235,7 @@ rootfs_trim_schemas () {
 }
 
 
-# export the zap_root_password, create_etc_timestamp and remote_init_link
-EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp rootfs_no_x_startup
+# export the zap_root_password, and remote_init_link
+EXPORT_FUNCTIONS zap_root_password remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp rootfs_no_x_startup
 
 addtask rootfs before do_build after do_install
index 162df2b87ef3ce995c1121a614e6fa87a4659d10..03fd67c67e631443ac79d49b4f258b291aa8fb8a 100755 (executable)
@@ -65,13 +65,13 @@ fi
 # If the timestamp is 1 day or more recent than the current time,
 # use the timestamp instead.
 /etc/init.d/hwclock.sh start
-if test -e /etc/timestamp2
+if test -e /etc/timestamp
 then
-       SYSTEMDATE=`date "+%Y%m%d%2H%2M"`
-       read TIMESTAMP < /etc/timestamp2
+       SYSTEMDATE=`date  -u +%2m%2d%2H%2M%4Y`
+       read TIMESTAMP < /etc/timestamp
         NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE + 10000 \)`
         if [ $NEEDUPDATE -eq 1 ]; then 
-               date -s $TIMESTAMP
+               date -u $TIMESTAMP
                /etc/init.d/hwclock.sh stop
        fi
 fi
index 75e43001b8308c06c0db212bf9fa3d336e614a13..77aa11c36cce9b9255fc10f8c5693c604577880a 100644 (file)
@@ -10,4 +10,4 @@
 ### END INIT INFO
 
 # Update the timestamp
-date +%Y%m%d%2H%2M > /etc/timestamp2
+date -u +%2m%2d%2H%2M%4Y > /etc/timestamp