From fccdc3ec64acf6ad4c0adbcd46ef9242cf813a82 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:46:42 -0300 Subject: [PATCH] fix: Fix genesis-base package build Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- xCAT-genesis-builder/dracut_105/el/module-setup.sh | 7 ++----- xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh | 2 +- xCAT-genesis-builder/install | 3 --- xCAT-genesis-builder/install.ubuntu | 3 --- xCAT-genesis-builder/xcat-cmdline.sh | 2 +- xCAT-server/sbin/xcatconfig | 8 +++++--- xCAT/xCAT.spec | 6 ++++++ 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/xCAT-genesis-builder/dracut_105/el/module-setup.sh b/xCAT-genesis-builder/dracut_105/el/module-setup.sh index 572e237ea..805d70fe2 100755 --- a/xCAT-genesis-builder/dracut_105/el/module-setup.sh +++ b/xCAT-genesis-builder/dracut_105/el/module-setup.sh @@ -45,18 +45,15 @@ install() { dracut_install uniq # mellanox update requires dracut_install grep ip hostname /usr/bin/awk egrep grep dirname expr dracut_install mount.nfs sshd vi reboot lspci parted screen mkfs mkfs.ext4 mkfs.xfs xfs_db - _dracut_install_opt /usr/libexec/openssh/sshd-session - _dracut_install_opt /usr/libexec/openssh/sftp-server #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df ifenslave ssh-keygen scp clear - dracut_install /usr/sbin/dhclient lldpad + dracut_install dhclient lldpad dracut_install /lib64/libnss_dns.so.2 dracut_install poweroff hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc #dracut_install chmod /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements dracut_install chmod ip /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements - _dracut_install_opt efibootmgr - _dracut_install_opt dmidecode # uxspi prereqs, but optional on minimal EL10 hosts + dracut_install efibootmgr dmidecode #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si dracut_install lldptool dracut_install /usr/share/zoneinfo/posix/Zulu dracut_install /usr/share/zoneinfo/posix/GMT-0 diff --git a/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh b/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh index 61147cd03..c479f9e91 100755 --- a/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh +++ b/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh @@ -64,7 +64,7 @@ if [[ ${ARCH} =~ ppc64 ]]; then modprobe virtio_pci fi waittime=2 - ALL_NICS=$(ip -o link show | awk -F': ' '{print $2}' | sed -e 's/@.*$//' -e 's/:$//' | grep -v '^lo$' | sort -u) + ALL_NICS=$(ip link show | grep -v "^ " | awk '{print $2}' | sed -e 's/:$//' | grep -v lo) for tmp in $ALL_NICS; do tmp_data="$(ip link show "$tmp" | grep -v "^ " | grep "UP")" if [ "$tmp_data" == "" ]; then diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 8239043aa..9d5674c6d 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -5,9 +5,6 @@ dracut_install netstat # broadcom update requires dracut_install uniq # mellanox update requires dracut_install grep ip hostname /usr/bin/awk egrep grep dirname expr dracut_install mount.nfs sshd vi reboot lspci parted screen mkfs mkfs.ext4 mkfs.xfs xfs_db -for ssh_helper in /usr/libexec/openssh/sshd-session /usr/libexec/openssh/sftp-server; do - [ -e "$ssh_helper" ] && dracut_install "$ssh_helper" -done #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df vconfig ifenslave ssh-keygen scp clear dhclient lldpad dracut_install /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2 diff --git a/xCAT-genesis-builder/install.ubuntu b/xCAT-genesis-builder/install.ubuntu index e7803ba40..f7363212e 100755 --- a/xCAT-genesis-builder/install.ubuntu +++ b/xCAT-genesis-builder/install.ubuntu @@ -6,9 +6,6 @@ dracut_install netstat # broadcom update requires dracut_install uniq # mellanox update requires dracut_install grep ip hostname awk egrep grep dirname expr dracut_install mount.nfs sshd vi reboot lspci parted screen mkfs mkfs.ext4 mkfs.btrfs -for ssh_helper in /usr/libexec/openssh/sshd-session /usr/libexec/openssh/sftp-server; do - [ -e "$ssh_helper" ] && dracut_install "$ssh_helper" -done dracut_install efibootmgr #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad diff --git a/xCAT-genesis-builder/xcat-cmdline.sh b/xCAT-genesis-builder/xcat-cmdline.sh index 24ba807f4..15ead2175 100755 --- a/xCAT-genesis-builder/xcat-cmdline.sh +++ b/xCAT-genesis-builder/xcat-cmdline.sh @@ -64,7 +64,7 @@ if [[ ${ARCH} =~ ppc64 ]]; then modprobe virtio_pci fi waittime=2 - ALL_NICS=$(ip -o link show | awk -F': ' '{print $2}' | sed -e 's/@.*$//' -e 's/:$//' | grep -v '^lo$' | sort -u) + ALL_NICS=$(ip link show | grep -v "^ " | awk '{print $2}' | sed -e 's/:$//' | grep -v lo) for tmp in $ALL_NICS; do tmp_data="$(ip link show "$tmp" | grep -v "^ " | grep "UP")" if [ "$tmp_data" == "" ]; then diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index b3c8fb2c8..7535d91b3 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -2014,9 +2014,11 @@ sub mknb } if ($run_mknb) { foreach (qw(ppc64 x86_64)) { - # @FIXME: Disabled as part of genesis-base testing operation, I do not - # have genesis-base for ppc, yet. Remove this line after testing - next if /^ppc/; + my $genesis_base_pkg = "xCAT-genesis-base-$_"; + if (system("rpm -q $genesis_base_pkg >/dev/null 2>&1") != 0) { + xCAT::MsgUtils->message('I', "Skipping '$cmd $_' because $genesis_base_pkg is not installed."); + next; + } system("$cmd $_"); if ($? != 0) { my $rc = $? >> 8; diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 676334b0e..bb9af4f35 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -55,6 +55,12 @@ Requires: xCAT-server = 4:%{version}-%{release} %if %nots390x Requires: xCAT-probe = 4:%{version}-%{release} Requires: xCAT-genesis-scripts-%{genesistarch} = 1:%{version}-%{release} +%ifarch x86_64 +Recommends: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} +%endif +%ifarch ppc ppc64 ppc64le +Recommends: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} +%endif %endif Requires: rsync