1. fill in the proper value in /etc/sysconfig/clock and set the timezone of the stateless/statelite node with site:timezone

2. copy lib(64)/libnss_files.so.2 into initrd 

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8-pcm@16050 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
immarvin
2013-04-24 02:55:50 +00:00
parent 2b826284bb
commit 07b4f4ed90
2 changed files with 26 additions and 7 deletions

View File

@ -301,6 +301,12 @@ sub process_request {
if ($tempfile) { $cmd .= " --tempfile $tempfile"; }
if ($driverupdatesrc) { $cmd .= " --driverupdatesrc $driverupdatesrc"; }
if($osfamily eq "sles") {
my @entries = xCAT::TableUtils->get_site_attribute("timezone");
my $tz = $entries[0];
if($tz) { $cmd .= " --timezone $tz"; }
}
if ($imagename) {
$cmd.= " $imagename";
}

View File

@ -59,6 +59,7 @@ my $permission; #the permission works only for statelite mode currently
my $krpmver;
my $tempfile;
my $prompt;
my $timezone; #the TIMEZONE of the stateless and statelite node
sub xdie {
@ -94,7 +95,8 @@ GetOptions(
'k=s' => \$kernelver,
'g=s' => \$krpmver,
'permission=s' => \$permission,
'kerneldir=s' => \$kerneldir,
'kerneldir=s' => \$kerneldir,
'timezone=s' => \$timezone,
'tempfile=s' =>\$tempfile, #internal flag
'pkglist=s' => \$pkglist, #internal flag
'srcdir=s' => \$srcdir, #internal flag
@ -1367,12 +1369,14 @@ END
}
}
if ($arch =~ /x86_64/) {
push @filestoadd,"lib64/libnss_dns.so.2";
}
else {
push @filestoadd,"lib/libnss_dns.so.2";
}
if ($arch =~ /64/) {
push @filestoadd,"lib64/libnss_dns.so.2";
push @filestoadd,"lib64/libnss_files.so.2";
}
else {
push @filestoadd,"lib/libnss_dns.so.2";
push @filestoadd,"lib/libnss_files.so.2";
}
# cross-platfrom support on power6&7 etc
# ldd can't handle such one scenario: mn is power6, the target platform is power7
@ -1502,6 +1506,15 @@ sub postscripts { # TODO: customized postscripts
sub generic_post { # This function is meant to leave the image in a state approximating a normal install
my $cfgfile;
#modify /etc/sysconfig/clock in the image:HWCLOCK="--local", TIMEZONE=site:timezone
if ($timezone) {
system("sed -i '".'s!\(TIMEZONE=\).*!\1'."\"$timezone\"!"."' $rootimg_dir/etc/sysconfig/clock");
system("chroot $rootimg_dir zic -l $timezone");
}
system("sed -i 's!\\(HWCLOCK=\\).*!\\1\"--localtime\"!' $rootimg_dir/etc/sysconfig/clock");
unlink("$rootimg_dir/dev/null");
system("mknod $rootimg_dir/dev/null c 1 3");
open($cfgfile,">","$rootimg_dir/etc/fstab");