From: Alex Yang Date: Thu, 14 Dec 2017 07:39:25 +0000 (+0800) Subject: Use deployserver's timezone in daisy VM X-Git-Tag: opnfv-6.0.0~31^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F17%2F48917%2F1;p=daisy.git Use deployserver's timezone in daisy VM Change-Id: Ie58af69f444924494d1a2949ba894ae55da7efc9 Signed-off-by: Alex Yang --- diff --git a/tools/centos-img-modify.sh b/tools/centos-img-modify.sh index 31f122fb..fe35126b 100755 --- a/tools/centos-img-modify.sh +++ b/tools/centos-img-modify.sh @@ -63,3 +63,8 @@ cat << EOF > /etc/cloud/cloud.cfg.d/default.cfg disable_root: False ssh_pwauth: True EOF + +cd /etc +if [ ! -z $localtime_file ] && [ -f $localtime_file ]; then + ln -s -f $localtime_file /etc/localtime +fi diff --git a/tools/daisy-img-modify.sh b/tools/daisy-img-modify.sh index aad29949..43fd186b 100755 --- a/tools/daisy-img-modify.sh +++ b/tools/daisy-img-modify.sh @@ -186,6 +186,12 @@ setup() { chroot $mountdir df -h cp $cmd $mountdir/$(basename $cmd) + + if [ -h /etc/localtime ]; then + export localtime_file=$(ls -l /etc/localtime | grep "^l" | awk '{print $11}') + elif [ -f /etc/localtime ]; then + cp /etc/loccaltime $mountdir/etc/ + fi } # modify image running a script using in a chrooted environment