mirror of
https://git.yoctoproject.org/poky
synced 2026-04-28 06:32:34 +02:00
initscripts: Sync with OE, primarily for better /etc/timestamp handling
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2650 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
@@ -61,11 +61,18 @@ fi
|
||||
#
|
||||
/sbin/ldconfig
|
||||
|
||||
#
|
||||
# Recover the time, if there is a time file
|
||||
#
|
||||
# Set the system clock from hardware clock
|
||||
# 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/timestamp
|
||||
then
|
||||
date -s `cat /etc/timestamp`
|
||||
SYSTEMDATE=`date "+%Y%m%d"`
|
||||
TIMESTAMP=`cat /etc/timestamp | awk '{ print substr($0,9,4) substr($0,1,4);}'`
|
||||
NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE \)`
|
||||
if [ $NEEDUPDATE -eq 1 ]; then
|
||||
date `cat /etc/timestamp`
|
||||
/etc/init.d/hwclock.sh stop
|
||||
fi
|
||||
fi
|
||||
: exit 0
|
||||
|
||||
Reference in New Issue
Block a user