From 4c29c0e054485de5e178d27d9cd09dc0b21b6447 Mon Sep 17 00:00:00 2001 From: cjhardee Date: Sun, 4 Apr 2010 04:01:05 +0000 Subject: [PATCH] Stateless images were not getting the timezone from site.timezone like stateful images were. Now it's being copied to /etc/localtime. Tested with RHELS5.4. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5661 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/packimage.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index 6c5da2a6c..fa5793b58 100644 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -309,7 +309,7 @@ sub copybootscript { my $arch = shift; my $profile = shift; my $callback = shift; - + my @timezone = xCAT::Utils->get_site_attribute("timezone"); if ( -f "$installroot/postscripts/xcatdsklspost") { @@ -317,6 +317,10 @@ sub copybootscript { mkpath("$rootimg_dir/opt/xcat"); copy ("$installroot/postscripts/xcatdsklspost", "$rootimg_dir/opt/xcat/xcatdsklspost"); + if($timezone[0]) { + copy ("$rootimg_dir/usr/share/zoneinfo/$timezone[0]", "$rootimg_dir/etc/localtime"); + } + chmod(0755,"$rootimg_dir/opt/xcat/xcatdsklspost"); @@ -327,6 +331,8 @@ sub copybootscript { xCAT::MsgUtils->message("E", $rsp, $callback); return 1; } + + # the following block might need to be removed as xcatdsklspost.aix may no longer be used if ( -f "$installroot/postscripts/xcatdsklspost.aix") { copy ("$installroot/postscripts/xcatdsklspost.aix", "$rootimg_dir/opt/xcat/xcatdsklspost.aix"); chmod(0755,"$rootimg_dir/opt/xcat/xcatdsklspost.aix");