2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 17:30:19 +00:00

Modifed packimage timezone logic to preserve two levels of links

This commit is contained in:
besawn
2021-12-08 09:32:41 -05:00
parent 7e6303a85b
commit de7ba39286

View File

@ -352,6 +352,15 @@ sub process_request {
# Add the zoneinfo to the include list
$excludetext .= "+./usr/share/zoneinfo/$timezone[0]\n";
# /usr/share/zoneinfo can have many levels of links
# If the configured timezone is a link, also add the link target to the include list
# Note: this logic can only handle 2 levels of linking
my $realtimezonefile = Cwd::abs_path("$rootimg_dir/usr/share/zoneinfo/$timezone[0]");
if ("$rootimg_dir/usr/share/zoneinfo/$timezone[0]" ne "$realtimezonefile") {
my $relativetzpath = substr($realtimezonefile, length($rootimg_dir));
$excludetext .= "+.$relativetzpath\n";
}
if (not stat "$rootimg_dir/etc/localtime") {
$callback->({ warning => ["Unable to set timezone to \'$timezone[0]\', check this is a valid timezone"] });
}