Closed markprez closed 1 year ago
The problem may be that exlist
attribute is not defined for this image definition:
[root@c685csm06 xcat]# lsdef -t osimage ist.redhat.8.6.netboot.container.DL -i exlist
Object name: ist.redhat.8.6.netboot.container.DL
exlist=
[root@c685csm06 xcat]#
But the code added by #7077 handles linking of $rootimg_dir/etc/localtime
file only if we can find that file ?
:
:
335 if ($exlistloc) {
336 my @excludeslist = split ',', $exlistloc;
337 foreach my $exlistlocname (@excludeslist) {
338 my $exlist;
339 my $excludetext;
340 open($exlist, "<", $exlistlocname);
341 system("echo -n > $xcat_packimg_tmpfile");
342 while (<$exlist>) {
343 $excludetext .= $_;
344 }
345 close($exlist);
346
347 # timedatectl requires /etc/localtime link to the zoneinfo in /usr/share/zoneinfo
348 if ($timezone[0]) {
349 unlink("$rootimg_dir/etc/localtime");
350 symlink("../usr/share/zoneinfo/$timezone[0]", "$rootimg_dir/etc/localtime");
351
352 # Add the zoneinfo to the include list
353 $excludetext .= "+./usr/share/zoneinfo/$timezone[0]\n";
:
:
@gurevichmark Good analysis - possibly we can split up the existing logic from #7077 so that the symbolic link manipulation happens just before the exlist processing block so it runs with or without an exlist associated with the image and the piece that includes the timezone files in the excludetext stays inside the exlist processing block. What do you think?
Confirmation of the above. Can recreate on one of the regression VMs:
[root@f6u13k10 ~]# lsdef -t site clustersite -i timezone -c
clustersite: timezone=America/New_York
[root@f6u13k10 ~]#
[root@f6u13k10 ~]# chdef -t osimage rhels8.6.0-ppc64le-netboot-compute exlist=
1 object definitions have been created or modified.
[root@f6u13k10 ~]#
[root@f6u13k10 ~]# genimage rhels8.6.0-ppc64le-netboot-compute
:
:
the initial ramdisk for statelite is generated successfully.
[root@f6u13k10 ~]#
[root@f6u13k10 ~]# ls -l /install/netboot/rhels8.6.0/ppc64le/compute/rootimg/etc/localtime
lrwxrwxrwx 1 root root 25 Jan 27 15:03 /install/netboot/rhels8.6.0/ppc64le/compute/rootimg/etc/localtime -> ../usr/share/zoneinfo/UTC
[root@f6u13k10 ~]# packimage rhels8.6.0-ppc64le-netboot-compute
Packing contents of /install/netboot/rhels8.6.0/ppc64le/compute/rootimg
archive method:cpio
compress method:pigz
[root@f6u13k10 ~]# ls -l /install/netboot/rhels8.6.0/ppc64le/compute/rootimg/etc/localtime
lrwxrwxrwx 1 root root 25 Jan 27 15:03 /install/netboot/rhels8.6.0/ppc64le/compute/rootimg/etc/localtime -> ../usr/share/zoneinfo/UTC
[root@f6u13k10 ~]#
Running xcat 2.16.5
After running genimage/packimage on a RH86 osimage the timezone is not set. I saw this on 2 systems, tried these 2 setting: