From b45dc1e85fe633bb462078ea5ab0b5179ff564dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Fri, 30 Oct 2026 12:33:48 -0300 Subject: [PATCH] fix(install): copy the kickstart pre-install log from the installer The EL8 and later kickstart templates append /tmp/pre-install.log to /var/log/xcat/xcat.log in the chroot %post. Anaconda runs that block in the installed system, whose /tmp does not hold the installer's log, so the %pre output, such as the install disk and the partition layout, never reaches the node's xcat.log. Copy the log in a %post --nochroot block before the main %post, from the installer's /tmp to the installed system at /mnt/sysimage. The EL6 and EL7 templates use %include for this and are unchanged. --- xCAT-server/share/xcat/install/centos/compute.centos8.tmpl | 6 +++++- .../share/xcat/install/openeuler/compute.openeuler.tmpl | 6 +++++- .../share/xcat/install/rh/compute.rhels10.riscv64.tmpl | 6 +++++- xCAT-server/share/xcat/install/rh/compute.rhels10.tmpl | 6 +++++- xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl | 6 +++++- xCAT-server/share/xcat/install/rh/compute.rhels9.tmpl | 6 +++++- .../share/xcat/install/rocky/service.rocky10.riscv64.tmpl | 6 +++++- 7 files changed, 35 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl b/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl index 3719fd0c6f..47883b685c 100644 --- a/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl +++ b/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl @@ -48,9 +48,13 @@ echo "Running Kickstart Pre-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels8# } &>>/tmp/pre-install.log %end +# The pre-installation log is in the installer's /tmp, which a chroot %post cannot read. +%post --nochroot --interpreter=/bin/bash +mkdir -p /mnt/sysimage/var/log/xcat/ +cat /tmp/pre-install.log >>/mnt/sysimage/var/log/xcat/xcat.log +%end %post --interpreter=/bin/bash mkdir -p /var/log/xcat/ -cat /tmp/pre-install.log >>/var/log/xcat/xcat.log { echo "Running Kickstart Post-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.ng# diff --git a/xCAT-server/share/xcat/install/openeuler/compute.openeuler.tmpl b/xCAT-server/share/xcat/install/openeuler/compute.openeuler.tmpl index a022871a5f..81693da645 100644 --- a/xCAT-server/share/xcat/install/openeuler/compute.openeuler.tmpl +++ b/xCAT-server/share/xcat/install/openeuler/compute.openeuler.tmpl @@ -27,9 +27,13 @@ echo "Running Kickstart Pre-installation script..." } &>>/tmp/pre-install.log %end +# The pre-installation log is in the installer's /tmp, which a chroot %post cannot read. +%post --nochroot --interpreter=/bin/bash +mkdir -p /mnt/sysimage/var/log/xcat/ +cat /tmp/pre-install.log >>/mnt/sysimage/var/log/xcat/xcat.log +%end %post --interpreter=/bin/bash --erroronfail mkdir -p /var/log/xcat/ -cat /tmp/pre-install.log >>/var/log/xcat/xcat.log { echo "Running Kickstart Post-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.openeuler# diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels10.riscv64.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhels10.riscv64.tmpl index 63e697b6bb..6ad5f24316 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels10.riscv64.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhels10.riscv64.tmpl @@ -55,9 +55,13 @@ echo "Running Kickstart Pre-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels10# } &>>/tmp/pre-install.log %end +# The pre-installation log is in the installer's /tmp, which a chroot %post cannot read. +%post --nochroot --interpreter=/bin/bash +mkdir -p /mnt/sysimage/var/log/xcat/ +cat /tmp/pre-install.log >>/mnt/sysimage/var/log/xcat/xcat.log +%end %post --interpreter=/bin/bash mkdir -p /var/log/xcat/ -cat /tmp/pre-install.log >>/var/log/xcat/xcat.log { echo "Running Kickstart Post-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.rhels10# diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels10.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhels10.tmpl index 3c90ba493d..8e5596971b 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels10.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhels10.tmpl @@ -42,9 +42,13 @@ echo "Running Kickstart Pre-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels10# } &>>/tmp/pre-install.log %end +# The pre-installation log is in the installer's /tmp, which a chroot %post cannot read. +%post --nochroot --interpreter=/bin/bash +mkdir -p /mnt/sysimage/var/log/xcat/ +cat /tmp/pre-install.log >>/mnt/sysimage/var/log/xcat/xcat.log +%end %post --interpreter=/bin/bash mkdir -p /var/log/xcat/ -cat /tmp/pre-install.log >>/var/log/xcat/xcat.log { echo "Running Kickstart Post-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.rhels10# diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl index 64daf4a34f..e758bc7489 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl @@ -47,9 +47,13 @@ echo "Running Kickstart Pre-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels8# } &>>/tmp/pre-install.log %end +# The pre-installation log is in the installer's /tmp, which a chroot %post cannot read. +%post --nochroot --interpreter=/bin/bash +mkdir -p /mnt/sysimage/var/log/xcat/ +cat /tmp/pre-install.log >>/mnt/sysimage/var/log/xcat/xcat.log +%end %post --interpreter=/bin/bash mkdir -p /var/log/xcat/ -cat /tmp/pre-install.log >>/var/log/xcat/xcat.log { echo "Running Kickstart Post-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.ng# diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels9.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhels9.tmpl index 6cb3a98883..bffe965899 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels9.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhels9.tmpl @@ -42,9 +42,13 @@ echo "Running Kickstart Pre-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels8# } &>>/tmp/pre-install.log %end +# The pre-installation log is in the installer's /tmp, which a chroot %post cannot read. +%post --nochroot --interpreter=/bin/bash +mkdir -p /mnt/sysimage/var/log/xcat/ +cat /tmp/pre-install.log >>/mnt/sysimage/var/log/xcat/xcat.log +%end %post --interpreter=/bin/bash mkdir -p /var/log/xcat/ -cat /tmp/pre-install.log >>/var/log/xcat/xcat.log { echo "Running Kickstart Post-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.ng# diff --git a/xCAT-server/share/xcat/install/rocky/service.rocky10.riscv64.tmpl b/xCAT-server/share/xcat/install/rocky/service.rocky10.riscv64.tmpl index bc1cc270bd..2866a3b1d3 100644 --- a/xCAT-server/share/xcat/install/rocky/service.rocky10.riscv64.tmpl +++ b/xCAT-server/share/xcat/install/rocky/service.rocky10.riscv64.tmpl @@ -55,9 +55,13 @@ echo "Running Kickstart Pre-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels8# } &>>/tmp/pre-install.log %end +# The pre-installation log is in the installer's /tmp, which a chroot %post cannot read. +%post --nochroot --interpreter=/bin/bash +mkdir -p /mnt/sysimage/var/log/xcat/ +cat /tmp/pre-install.log >>/mnt/sysimage/var/log/xcat/xcat.log +%end %post --interpreter=/bin/bash mkdir -p /var/log/xcat/ -cat /tmp/pre-install.log >>/var/log/xcat/xcat.log { echo "Running Kickstart Post-installation script..." #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.ng#