mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
Modified packimage to always include the local zoneinfo time zone file
This commit is contained in:
parent
cacd973043
commit
85a5df22f5
@ -75,6 +75,7 @@ sub process_request {
|
||||
my $callback = shift;
|
||||
my $doreq = shift;
|
||||
my $installroot = xCAT::TableUtils->getInstallDir();
|
||||
my @timezone = xCAT::TableUtils->get_site_attribute("timezone");
|
||||
|
||||
my $args;
|
||||
if (defined($request->{arg})) {
|
||||
@ -343,6 +344,15 @@ sub process_request {
|
||||
}
|
||||
close($exlist);
|
||||
|
||||
# timedatectl requires /etc/localtime link to the zoneinfo in /usr/share/zoneinfo
|
||||
if ($timezone[0]) {
|
||||
unlink("$rootimg_dir/etc/localtime");
|
||||
symlink("../usr/share/zoneinfo/$timezone[0]", "$rootimg_dir/etc/localtime");
|
||||
|
||||
# Add the zoneinfo to the include list
|
||||
$excludetext .= "+./usr/share/zoneinfo/$timezone[0]\n";
|
||||
}
|
||||
|
||||
#handle the #INLCUDE# tag recursively
|
||||
my $idir = dirname($exlistlocname);
|
||||
my $doneincludes = 0;
|
||||
@ -645,7 +655,6 @@ sub copybootscript {
|
||||
my $arch = shift;
|
||||
my $profile = shift;
|
||||
my $callback = shift;
|
||||
my @timezone = xCAT::TableUtils->get_site_attribute("timezone");
|
||||
|
||||
if (-f "$installroot/postscripts/xcatdsklspost") {
|
||||
|
||||
@ -653,15 +662,6 @@ sub copybootscript {
|
||||
mkpath("$rootimg_dir/opt/xcat");
|
||||
|
||||
copy("$installroot/postscripts/xcatdsklspost", "$rootimg_dir/opt/xcat/xcatdsklspost");
|
||||
if ($timezone[0]) {
|
||||
unlink("$rootimg_dir/etc/localtime");
|
||||
# Copy timezone file to /etc and link 'localtime' to it
|
||||
mkpath(dirname("$rootimg_dir/etc/$timezone[0]"));
|
||||
copy("$rootimg_dir/usr/share/zoneinfo/$timezone[0]", "$rootimg_dir/etc/$timezone[0]");
|
||||
symlink("./$timezone[0]", "$rootimg_dir/etc/localtime");
|
||||
}
|
||||
|
||||
|
||||
chmod(0755, "$rootimg_dir/opt/xcat/xcatdsklspost");
|
||||
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user