From 85078139613cb2878ace6cf2b0d4644d28c73662 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Fri, 6 Feb 2026 15:22:13 -0300 Subject: [PATCH 01/21] fix: Add script to build xCAT-genesis-base in EL10 Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- xCAT-genesis-builder/buildrpmel10 | 88 +++ .../dracut_105/el/module-setup.sh | 666 ++++++++++++++++++ .../dracut_105/ubuntu/module-setup.sh | 1 + 3 files changed, 755 insertions(+) create mode 100755 xCAT-genesis-builder/buildrpmel10 create mode 100755 xCAT-genesis-builder/dracut_105/el/module-setup.sh create mode 120000 xCAT-genesis-builder/dracut_105/ubuntu/module-setup.sh diff --git a/xCAT-genesis-builder/buildrpmel10 b/xCAT-genesis-builder/buildrpmel10 new file mode 100755 index 000000000..ec06183e8 --- /dev/null +++ b/xCAT-genesis-builder/buildrpmel10 @@ -0,0 +1,88 @@ +#!/bin/bash +# Build the xCAT-genesis-base rpm on a host system. +# Option 1: install the xCAT-genesis-builder rpm (that includes this file) on a system installed with +# the distro you want to use to build xCAT-genesis-base. +# Option 2: untar the root file system of the distro you want to use and then chroot into it and copy +# this whole dir into it somewhere (like /tmp). +# Then run this script. The optional 1st arg should be mcp if you are building against mcp. + +# Currently, *Fedora 28* and *RedHat 8* are the only OSes supported to build genesis-base for ppc64, and Centos 6.5 for x86_64 + +DIR=`dirname $0` +#DIR=`realpath $DIR` +DIR=`readlink -f $DIR` +BUILDARCH=`uname -m` +REQUIRED_PACKAGES="rpmdevtools rpm-build screen lldpad mstflint ipmitool pciutils mdadm dosfstools usbutils bind-utils psmisc nmap-ncat ethtool kexec-tools" +DISTRO=$(perl -lane 'print $1 if /^ID="?([^\"\$]+)/' < /etc/os-release) + +# Install required packages +dnf install -y epel-release +dnf -y install $REQUIRED_PACKAGES || { + echo "ERROR: Can not install required package" + exit 1 +} + +rpmdev-setuptree + +DRACUTMODDIR=/usr/lib/dracut/modules.d/97xcat +mkdir -p $DRACUTMODDIR +case "$DISTRO" in + ubuntu) + cp -a "$DIR/dracut_105/ubuntu/module-setup.sh" $DRACUTMODDIR/ + ;; + rhel) + cp -a "$DIR/dracut_105/el/module-setup.sh" $DRACUTMODDIR/ + ;; + *) + echo "Warning: Unknown distro $DISTRO, assuming RHEL clone" + cp -a "$DIR/dracut_105/el/module-setup.sh" $DRACUTMODDIR/ + ;; +esac +dracut -m "xcat base" --no-early-microcode -N -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION + +echo Expanding the initramfs into /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs ... + +mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs +cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs +zcat /tmp/xcatgenesis.$$.rfs | cpio -dumi + +# add the perl library +# add /usr/share/ntp/lib for Fedora26 ppc64, the ntp-perl will installed libraries under it +PERL_LIB_DIR="/usr/share/perl5 /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/share/ntp/lib" +for d in `echo $PERL_LIB_DIR`; do + if [ -e $d ]; then + echo Adding perl libary "$d" + TEMP_DIR=/tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/"$d" + mkdir -p $TEMP_DIR + cp -a -t $TEMP_DIR $d/. + fi +done + +# create directory for ssh-keygen +mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/etc/ssh +mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/lib/udev/rules.d/ + +# create the predictable naming for nics +LIB_UDEV_RULES="/lib/udev/rules.d/" +if [ ! -e "$LIB_UDEV_RULES/80-net-name-slot.rules" ]; then + cp $DRACUTMODDIR/80-net-name-slot.rules /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/lib/udev/rules.d/ + if [ $? -ne 0 ]; then + echo "ERROR - expanding the initramfs, please correct the issues and try again" + exit 1 + fi +fi + +# add the kernel +echo Adding kernel /boot/vmlinuz-$BUILDARCH ... +cp /boot/vmlinuz-`uname -r` /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/kernel +cd - + +# create tar file +echo Tarring /tmp/xcatgenesis.$$/opt into ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 ... +cd /tmp/xcatgenesis.$$ +tar jcf ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 opt + +# build the rpm +echo Building xCAT-genesis-base rpm from ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 and $DIR/xCAT-genesis-base.spec ... +rpmbuild -ba $DIR/xCAT-genesis-base.spec +rm -rf $DRACUTMODDIR diff --git a/xCAT-genesis-builder/dracut_105/el/module-setup.sh b/xCAT-genesis-builder/dracut_105/el/module-setup.sh new file mode 100755 index 000000000..1e1f1158f --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/el/module-setup.sh @@ -0,0 +1,666 @@ +#!/bin/bash + +check() { + return 0; +} + +depends() { + echo "" +} + +installkernel() { + local modules_dep modfile modname + + if [[ -n "${kernel:-}" && -r "/lib/modules/$kernel/modules.dep" ]]; then + modules_dep="/lib/modules/$kernel/modules.dep" + elif [[ -n "${KERNELVERSION:-}" && -r "/lib/modules/$KERNELVERSION/modules.dep" ]]; then + modules_dep="/lib/modules/$KERNELVERSION/modules.dep" + else + modules_dep=$(ls -1 /lib/modules/*/modules.dep 2>/dev/null | head -n 1) + fi + + [[ -r "$modules_dep" ]] || return 0 + + while IFS= read -r modfile; do + modfile=${modfile%%:*} + modname=${modfile##*/} + modname=${modname%.ko*} + instmods "$modname" + done < "$modules_dep" +} + +_dracut_install_opt() { + local src="$1" + local dst=$2; + if [[ -z "$dst" ]]; then + test -e "$src" && dracut_install "$src" + else + test -e "$src" && dracut_install "$src" "$dst" + fi +} + +install() { + dracut_install wget openssl tar mstflint ipmitool cpio gzip lsmod ethtool modprobe touch echo cut wc bash + 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 + #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 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 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 + dracut_install /usr/share/zoneinfo/posix/Europe/Istanbul + dracut_install /usr/share/zoneinfo/posix/Europe/San_Marino + dracut_install /usr/share/zoneinfo/posix/Europe/Jersey + dracut_install /usr/share/zoneinfo/posix/Europe/Bucharest + dracut_install /usr/share/zoneinfo/posix/Europe/Gibraltar + dracut_install /usr/share/zoneinfo/posix/Europe/Uzhgorod + dracut_install /usr/share/zoneinfo/posix/Europe/Moscow + dracut_install /usr/share/zoneinfo/posix/Europe/Brussels + dracut_install /usr/share/zoneinfo/posix/Europe/Nicosia + dracut_install /usr/share/zoneinfo/posix/Europe/Zurich + dracut_install /usr/share/zoneinfo/posix/Europe/Berlin + dracut_install /usr/share/zoneinfo/posix/Europe/Guernsey + dracut_install /usr/share/zoneinfo/posix/Europe/Budapest + dracut_install /usr/share/zoneinfo/posix/Europe/Kiev + dracut_install /usr/share/zoneinfo/posix/Europe/Podgorica + dracut_install /usr/share/zoneinfo/posix/Europe/Isle_of_Man + dracut_install /usr/share/zoneinfo/posix/Europe/Mariehamn + dracut_install /usr/share/zoneinfo/posix/Europe/Belgrade + dracut_install /usr/share/zoneinfo/posix/Europe/Belfast + dracut_install /usr/share/zoneinfo/posix/Europe/Ljubljana + dracut_install /usr/share/zoneinfo/posix/Europe/Chisinau + dracut_install /usr/share/zoneinfo/posix/Europe/Andorra + dracut_install /usr/share/zoneinfo/posix/Europe/Athens + dracut_install /usr/share/zoneinfo/posix/Europe/Stockholm + dracut_install /usr/share/zoneinfo/posix/Europe/Vienna + dracut_install /usr/share/zoneinfo/posix/Europe/Lisbon + dracut_install /usr/share/zoneinfo/posix/Europe/London + dracut_install /usr/share/zoneinfo/posix/Europe/Paris + dracut_install /usr/share/zoneinfo/posix/Europe/Oslo + dracut_install /usr/share/zoneinfo/posix/Europe/Zagreb + dracut_install /usr/share/zoneinfo/posix/Europe/Helsinki + dracut_install /usr/share/zoneinfo/posix/Europe/Warsaw + dracut_install /usr/share/zoneinfo/posix/Europe/Copenhagen + dracut_install /usr/share/zoneinfo/posix/Europe/Riga + dracut_install /usr/share/zoneinfo/posix/Europe/Vaduz + dracut_install /usr/share/zoneinfo/posix/Europe/Vilnius + dracut_install /usr/share/zoneinfo/posix/Europe/Volgograd + dracut_install /usr/share/zoneinfo/posix/Europe/Amsterdam + dracut_install /usr/share/zoneinfo/posix/Europe/Tiraspol + dracut_install /usr/share/zoneinfo/posix/Europe/Tallinn + dracut_install /usr/share/zoneinfo/posix/Europe/Kaliningrad + dracut_install /usr/share/zoneinfo/posix/Europe/Malta + dracut_install /usr/share/zoneinfo/posix/Europe/Sarajevo + dracut_install /usr/share/zoneinfo/posix/Europe/Madrid + dracut_install /usr/share/zoneinfo/posix/Europe/Zaporozhye + dracut_install /usr/share/zoneinfo/posix/Europe/Simferopol + dracut_install /usr/share/zoneinfo/posix/Europe/Sofia + dracut_install /usr/share/zoneinfo/posix/Europe/Skopje + dracut_install /usr/share/zoneinfo/posix/Europe/Monaco + dracut_install /usr/share/zoneinfo/posix/Europe/Rome + dracut_install /usr/share/zoneinfo/posix/Europe/Prague + dracut_install /usr/share/zoneinfo/posix/Europe/Luxembourg + dracut_install /usr/share/zoneinfo/posix/Europe/Minsk + dracut_install /usr/share/zoneinfo/posix/Europe/Vatican + dracut_install /usr/share/zoneinfo/posix/Europe/Dublin + dracut_install /usr/share/zoneinfo/posix/Europe/Samara + dracut_install /usr/share/zoneinfo/posix/Europe/Tirane + dracut_install /usr/share/zoneinfo/posix/Europe/Bratislava + dracut_install /usr/share/zoneinfo/posix/Greenwich + dracut_install /usr/share/zoneinfo/posix/US/Indiana-Starke + dracut_install /usr/share/zoneinfo/posix/US/Alaska + dracut_install /usr/share/zoneinfo/posix/US/Michigan + dracut_install /usr/share/zoneinfo/posix/US/Aleutian + dracut_install /usr/share/zoneinfo/posix/US/Hawaii + dracut_install /usr/share/zoneinfo/posix/US/Central + dracut_install /usr/share/zoneinfo/posix/US/Eastern + dracut_install /usr/share/zoneinfo/posix/US/Pacific + dracut_install /usr/share/zoneinfo/posix/US/Samoa + dracut_install /usr/share/zoneinfo/posix/US/Mountain + dracut_install /usr/share/zoneinfo/posix/US/Arizona + dracut_install /usr/share/zoneinfo/posix/US/East-Indiana + dracut_install /usr/share/zoneinfo/posix/EST + dracut_install /usr/share/zoneinfo/posix/HST + dracut_install /usr/share/zoneinfo/posix/Eire + dracut_install /usr/share/zoneinfo/posix/America/Cancun + dracut_install /usr/share/zoneinfo/posix/America/Santo_Domingo + dracut_install /usr/share/zoneinfo/posix/America/Jujuy + dracut_install /usr/share/zoneinfo/posix/America/Guatemala + dracut_install /usr/share/zoneinfo/posix/America/Monterrey + dracut_install /usr/share/zoneinfo/posix/America/Ensenada + dracut_install /usr/share/zoneinfo/posix/America/Dawson_Creek + dracut_install /usr/share/zoneinfo/posix/America/Mendoza + dracut_install /usr/share/zoneinfo/posix/America/Coral_Harbour + dracut_install /usr/share/zoneinfo/posix/America/Martinique + dracut_install /usr/share/zoneinfo/posix/America/Cordoba + dracut_install /usr/share/zoneinfo/posix/America/Recife + dracut_install /usr/share/zoneinfo/posix/America/Cayman + dracut_install /usr/share/zoneinfo/posix/America/Shiprock + dracut_install /usr/share/zoneinfo/posix/America/Tortola + dracut_install /usr/share/zoneinfo/posix/America/Lima + dracut_install /usr/share/zoneinfo/posix/America/Antigua + dracut_install /usr/share/zoneinfo/posix/America/Blanc-Sablon + dracut_install /usr/share/zoneinfo/posix/America/Nipigon + dracut_install /usr/share/zoneinfo/posix/America/Nome + dracut_install /usr/share/zoneinfo/posix/America/Montserrat + dracut_install /usr/share/zoneinfo/posix/America/Atka + dracut_install /usr/share/zoneinfo/posix/America/St_Thomas + dracut_install /usr/share/zoneinfo/posix/America/Halifax + dracut_install /usr/share/zoneinfo/posix/America/Montreal + dracut_install /usr/share/zoneinfo/posix/America/Curacao + dracut_install /usr/share/zoneinfo/posix/America/Cuiaba + dracut_install /usr/share/zoneinfo/posix/America/Winnipeg + dracut_install /usr/share/zoneinfo/posix/America/North_Dakota/New_Salem + dracut_install /usr/share/zoneinfo/posix/America/North_Dakota/Center + dracut_install /usr/share/zoneinfo/posix/America/Panama + dracut_install /usr/share/zoneinfo/posix/America/Rosario + dracut_install /usr/share/zoneinfo/posix/America/Anguilla + dracut_install /usr/share/zoneinfo/posix/America/Ojinaga + dracut_install /usr/share/zoneinfo/posix/America/Guyana + dracut_install /usr/share/zoneinfo/posix/America/Eirunepe + dracut_install /usr/share/zoneinfo/posix/America/Grand_Turk + dracut_install /usr/share/zoneinfo/posix/America/Rio_Branco + dracut_install /usr/share/zoneinfo/posix/America/Santa_Isabel + dracut_install /usr/share/zoneinfo/posix/America/Scoresbysund + dracut_install /usr/share/zoneinfo/posix/America/Adak + dracut_install /usr/share/zoneinfo/posix/America/Menominee + dracut_install /usr/share/zoneinfo/posix/America/Resolute + dracut_install /usr/share/zoneinfo/posix/America/Guadeloupe + dracut_install /usr/share/zoneinfo/posix/America/Indianapolis + dracut_install /usr/share/zoneinfo/posix/America/Vancouver + dracut_install /usr/share/zoneinfo/posix/America/Glace_Bay + dracut_install /usr/share/zoneinfo/posix/America/Buenos_Aires + dracut_install /usr/share/zoneinfo/posix/America/Virgin + dracut_install /usr/share/zoneinfo/posix/America/Belem + dracut_install /usr/share/zoneinfo/posix/America/Catamarca + dracut_install /usr/share/zoneinfo/posix/America/Bahia + dracut_install /usr/share/zoneinfo/posix/America/Fort_Wayne + dracut_install /usr/share/zoneinfo/posix/America/Hermosillo + dracut_install /usr/share/zoneinfo/posix/America/Rankin_Inlet + dracut_install /usr/share/zoneinfo/posix/America/Mexico_City + dracut_install /usr/share/zoneinfo/posix/America/Belize + dracut_install /usr/share/zoneinfo/posix/America/Maceio + dracut_install /usr/share/zoneinfo/posix/America/Dominica + dracut_install /usr/share/zoneinfo/posix/America/Swift_Current + dracut_install /usr/share/zoneinfo/posix/America/St_Johns + dracut_install /usr/share/zoneinfo/posix/America/St_Barthelemy + dracut_install /usr/share/zoneinfo/posix/America/Yellowknife + dracut_install /usr/share/zoneinfo/posix/America/Costa_Rica + dracut_install /usr/share/zoneinfo/posix/America/Pangnirtung + dracut_install /usr/share/zoneinfo/posix/America/Bogota + dracut_install /usr/share/zoneinfo/posix/America/Port-au-Prince + dracut_install /usr/share/zoneinfo/posix/America/Phoenix + dracut_install /usr/share/zoneinfo/posix/America/Port_of_Spain + dracut_install /usr/share/zoneinfo/posix/America/Matamoros + dracut_install /usr/share/zoneinfo/posix/America/Puerto_Rico + dracut_install /usr/share/zoneinfo/posix/America/Detroit + dracut_install /usr/share/zoneinfo/posix/America/Edmonton + dracut_install /usr/share/zoneinfo/posix/America/Toronto + dracut_install /usr/share/zoneinfo/posix/America/Cambridge_Bay + dracut_install /usr/share/zoneinfo/posix/America/Godthab + dracut_install /usr/share/zoneinfo/posix/America/Atikokan + dracut_install /usr/share/zoneinfo/posix/America/Juneau + dracut_install /usr/share/zoneinfo/posix/America/Managua + dracut_install /usr/share/zoneinfo/posix/America/Anchorage + dracut_install /usr/share/zoneinfo/posix/America/Merida + dracut_install /usr/share/zoneinfo/posix/America/Thunder_Bay + dracut_install /usr/share/zoneinfo/posix/America/Porto_Velho + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Jujuy + dracut_install /usr/share/zoneinfo/posix/America/Argentina/La_Rioja + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Mendoza + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Cordoba + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Ushuaia + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Rio_Gallegos + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Buenos_Aires + dracut_install /usr/share/zoneinfo/posix/America/Argentina/San_Juan + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Catamarca + dracut_install /usr/share/zoneinfo/posix/America/Argentina/San_Luis + dracut_install /usr/share/zoneinfo/posix/America/Argentina/ComodRivadavia + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Salta + dracut_install /usr/share/zoneinfo/posix/America/Argentina/Tucuman + dracut_install /usr/share/zoneinfo/posix/America/Iqaluit + dracut_install /usr/share/zoneinfo/posix/America/Chicago + dracut_install /usr/share/zoneinfo/posix/America/Miquelon + dracut_install /usr/share/zoneinfo/posix/America/Havana + dracut_install /usr/share/zoneinfo/posix/America/Guayaquil + dracut_install /usr/share/zoneinfo/posix/America/St_Vincent + dracut_install /usr/share/zoneinfo/posix/America/St_Lucia + dracut_install /usr/share/zoneinfo/posix/America/Boise + dracut_install /usr/share/zoneinfo/posix/America/Yakutat + dracut_install /usr/share/zoneinfo/posix/America/Santarem + dracut_install /usr/share/zoneinfo/posix/America/Campo_Grande + dracut_install /usr/share/zoneinfo/posix/America/Santiago + dracut_install /usr/share/zoneinfo/posix/America/Porto_Acre + dracut_install /usr/share/zoneinfo/posix/America/Sao_Paulo + dracut_install /usr/share/zoneinfo/posix/America/Thule + dracut_install /usr/share/zoneinfo/posix/America/New_York + dracut_install /usr/share/zoneinfo/posix/America/Nassau + dracut_install /usr/share/zoneinfo/posix/America/Dawson + dracut_install /usr/share/zoneinfo/posix/America/Louisville + dracut_install /usr/share/zoneinfo/posix/America/Asuncion + dracut_install /usr/share/zoneinfo/posix/America/Inuvik + dracut_install /usr/share/zoneinfo/posix/America/Paramaribo + dracut_install /usr/share/zoneinfo/posix/America/Chihuahua + dracut_install /usr/share/zoneinfo/posix/America/Mazatlan + dracut_install /usr/share/zoneinfo/posix/America/Grenada + dracut_install /usr/share/zoneinfo/posix/America/Denver + dracut_install /usr/share/zoneinfo/posix/America/Los_Angeles + dracut_install /usr/share/zoneinfo/posix/America/Marigot + dracut_install /usr/share/zoneinfo/posix/America/Manaus + dracut_install /usr/share/zoneinfo/posix/America/Regina + dracut_install /usr/share/zoneinfo/posix/America/Barbados + dracut_install /usr/share/zoneinfo/posix/America/Noronha + dracut_install /usr/share/zoneinfo/posix/America/Montevideo + dracut_install /usr/share/zoneinfo/posix/America/Caracas + dracut_install /usr/share/zoneinfo/posix/America/Rainy_River + dracut_install /usr/share/zoneinfo/posix/America/La_Paz + dracut_install /usr/share/zoneinfo/posix/America/Jamaica + dracut_install /usr/share/zoneinfo/posix/America/Moncton + dracut_install /usr/share/zoneinfo/posix/America/Whitehorse + dracut_install /usr/share/zoneinfo/posix/America/Fortaleza + dracut_install /usr/share/zoneinfo/posix/America/Kentucky/Monticello + dracut_install /usr/share/zoneinfo/posix/America/Kentucky/Louisville + dracut_install /usr/share/zoneinfo/posix/America/Indiana/Marengo + dracut_install /usr/share/zoneinfo/posix/America/Indiana/Indianapolis + dracut_install /usr/share/zoneinfo/posix/America/Indiana/Knox + dracut_install /usr/share/zoneinfo/posix/America/Indiana/Tell_City + dracut_install /usr/share/zoneinfo/posix/America/Indiana/Petersburg + dracut_install /usr/share/zoneinfo/posix/America/Indiana/Winamac + dracut_install /usr/share/zoneinfo/posix/America/Indiana/Vincennes + dracut_install /usr/share/zoneinfo/posix/America/Indiana/Vevay + dracut_install /usr/share/zoneinfo/posix/America/Danmarkshavn + dracut_install /usr/share/zoneinfo/posix/America/St_Kitts + dracut_install /usr/share/zoneinfo/posix/America/Aruba + dracut_install /usr/share/zoneinfo/posix/America/Boa_Vista + dracut_install /usr/share/zoneinfo/posix/America/Bahia_Banderas + dracut_install /usr/share/zoneinfo/posix/America/Tegucigalpa + dracut_install /usr/share/zoneinfo/posix/America/Araguaina + dracut_install /usr/share/zoneinfo/posix/America/El_Salvador + dracut_install /usr/share/zoneinfo/posix/America/Cayenne + dracut_install /usr/share/zoneinfo/posix/America/Tijuana + dracut_install /usr/share/zoneinfo/posix/America/Knox_IN + dracut_install /usr/share/zoneinfo/posix/America/Goose_Bay + dracut_install /usr/share/zoneinfo/posix/EET + dracut_install /usr/share/zoneinfo/posix/EST5EDT + dracut_install /usr/share/zoneinfo/posix/MST + dracut_install /usr/share/zoneinfo/posix/Iceland + dracut_install /usr/share/zoneinfo/posix/Atlantic/Faeroe + dracut_install /usr/share/zoneinfo/posix/Atlantic/Stanley + dracut_install /usr/share/zoneinfo/posix/Atlantic/Reykjavik + dracut_install /usr/share/zoneinfo/posix/Atlantic/St_Helena + dracut_install /usr/share/zoneinfo/posix/Atlantic/Faroe + dracut_install /usr/share/zoneinfo/posix/Atlantic/South_Georgia + dracut_install /usr/share/zoneinfo/posix/Atlantic/Jan_Mayen + dracut_install /usr/share/zoneinfo/posix/Atlantic/Azores + dracut_install /usr/share/zoneinfo/posix/Atlantic/Cape_Verde + dracut_install /usr/share/zoneinfo/posix/Atlantic/Madeira + dracut_install /usr/share/zoneinfo/posix/Atlantic/Bermuda + dracut_install /usr/share/zoneinfo/posix/Atlantic/Canary + dracut_install /usr/share/zoneinfo/posix/GMT0 + dracut_install /usr/share/zoneinfo/posix/Poland + dracut_install /usr/share/zoneinfo/posix/Indian/Chagos + dracut_install /usr/share/zoneinfo/posix/Indian/Maldives + dracut_install /usr/share/zoneinfo/posix/Indian/Comoro + dracut_install /usr/share/zoneinfo/posix/Indian/Mauritius + dracut_install /usr/share/zoneinfo/posix/Indian/Mayotte + dracut_install /usr/share/zoneinfo/posix/Indian/Christmas + dracut_install /usr/share/zoneinfo/posix/Indian/Antananarivo + dracut_install /usr/share/zoneinfo/posix/Indian/Kerguelen + dracut_install /usr/share/zoneinfo/posix/Indian/Mahe + dracut_install /usr/share/zoneinfo/posix/Indian/Cocos + dracut_install /usr/share/zoneinfo/posix/Indian/Reunion + dracut_install /usr/share/zoneinfo/posix/Mexico/BajaNorte + dracut_install /usr/share/zoneinfo/posix/Mexico/BajaSur + dracut_install /usr/share/zoneinfo/posix/Mexico/General + dracut_install /usr/share/zoneinfo/posix/Turkey + dracut_install /usr/share/zoneinfo/posix/Egypt + dracut_install /usr/share/zoneinfo/posix/Hongkong + dracut_install /usr/share/zoneinfo/posix/GB + dracut_install /usr/share/zoneinfo/posix/GMT+0 + dracut_install /usr/share/zoneinfo/posix/ROK + dracut_install /usr/share/zoneinfo/posix/Antarctica/Mawson + dracut_install /usr/share/zoneinfo/posix/Antarctica/Macquarie + dracut_install /usr/share/zoneinfo/posix/Antarctica/South_Pole + dracut_install /usr/share/zoneinfo/posix/Antarctica/Rothera + dracut_install /usr/share/zoneinfo/posix/Antarctica/Davis + dracut_install /usr/share/zoneinfo/posix/Antarctica/DumontDUrville + dracut_install /usr/share/zoneinfo/posix/Antarctica/McMurdo + dracut_install /usr/share/zoneinfo/posix/Antarctica/Casey + dracut_install /usr/share/zoneinfo/posix/Antarctica/Vostok + dracut_install /usr/share/zoneinfo/posix/Antarctica/Palmer + dracut_install /usr/share/zoneinfo/posix/Antarctica/Syowa + dracut_install /usr/share/zoneinfo/posix/Universal + dracut_install /usr/share/zoneinfo/posix/CET + dracut_install /usr/share/zoneinfo/posix/WET + dracut_install /usr/share/zoneinfo/posix/Navajo + dracut_install /usr/share/zoneinfo/posix/UTC + dracut_install /usr/share/zoneinfo/posix/Pacific/Enderbury + dracut_install /usr/share/zoneinfo/posix/Pacific/Johnston + dracut_install /usr/share/zoneinfo/posix/Pacific/Pago_Pago + dracut_install /usr/share/zoneinfo/posix/Pacific/Saipan + dracut_install /usr/share/zoneinfo/posix/Pacific/Norfolk + dracut_install /usr/share/zoneinfo/posix/Pacific/Chuuk + dracut_install /usr/share/zoneinfo/posix/Pacific/Galapagos + dracut_install /usr/share/zoneinfo/posix/Pacific/Palau + dracut_install /usr/share/zoneinfo/posix/Pacific/Tarawa + dracut_install /usr/share/zoneinfo/posix/Pacific/Fakaofo + dracut_install /usr/share/zoneinfo/posix/Pacific/Rarotonga + dracut_install /usr/share/zoneinfo/posix/Pacific/Wake + dracut_install /usr/share/zoneinfo/posix/Pacific/Kosrae + dracut_install /usr/share/zoneinfo/posix/Pacific/Tahiti + dracut_install /usr/share/zoneinfo/posix/Pacific/Fiji + dracut_install /usr/share/zoneinfo/posix/Pacific/Ponape + dracut_install /usr/share/zoneinfo/posix/Pacific/Tongatapu + dracut_install /usr/share/zoneinfo/posix/Pacific/Efate + dracut_install /usr/share/zoneinfo/posix/Pacific/Honolulu + dracut_install /usr/share/zoneinfo/posix/Pacific/Niue + dracut_install /usr/share/zoneinfo/posix/Pacific/Kwajalein + dracut_install /usr/share/zoneinfo/posix/Pacific/Guam + dracut_install /usr/share/zoneinfo/posix/Pacific/Funafuti + dracut_install /usr/share/zoneinfo/posix/Pacific/Majuro + dracut_install /usr/share/zoneinfo/posix/Pacific/Midway + dracut_install /usr/share/zoneinfo/posix/Pacific/Nauru + dracut_install /usr/share/zoneinfo/posix/Pacific/Samoa + dracut_install /usr/share/zoneinfo/posix/Pacific/Marquesas + dracut_install /usr/share/zoneinfo/posix/Pacific/Kiritimati + dracut_install /usr/share/zoneinfo/posix/Pacific/Noumea + dracut_install /usr/share/zoneinfo/posix/Pacific/Truk + dracut_install /usr/share/zoneinfo/posix/Pacific/Guadalcanal + dracut_install /usr/share/zoneinfo/posix/Pacific/Pohnpei + dracut_install /usr/share/zoneinfo/posix/Pacific/Pitcairn + dracut_install /usr/share/zoneinfo/posix/Pacific/Port_Moresby + dracut_install /usr/share/zoneinfo/posix/Pacific/Yap + dracut_install /usr/share/zoneinfo/posix/Pacific/Easter + dracut_install /usr/share/zoneinfo/posix/Pacific/Wallis + dracut_install /usr/share/zoneinfo/posix/Pacific/Apia + dracut_install /usr/share/zoneinfo/posix/Pacific/Auckland + dracut_install /usr/share/zoneinfo/posix/Pacific/Gambier + dracut_install /usr/share/zoneinfo/posix/Pacific/Chatham + dracut_install /usr/share/zoneinfo/posix/Japan + dracut_install /usr/share/zoneinfo/posix/Libya + dracut_install /usr/share/zoneinfo/posix/ROC + dracut_install /usr/share/zoneinfo/posix/Iran + dracut_install /usr/share/zoneinfo/posix/Brazil/West + dracut_install /usr/share/zoneinfo/posix/Brazil/East + dracut_install /usr/share/zoneinfo/posix/Brazil/Acre + dracut_install /usr/share/zoneinfo/posix/Brazil/DeNoronha + dracut_install /usr/share/zoneinfo/posix/Arctic/Longyearbyen + dracut_install /usr/share/zoneinfo/posix/Portugal + dracut_install /usr/share/zoneinfo/posix/MET + dracut_install /usr/share/zoneinfo/posix/W-SU + dracut_install /usr/share/zoneinfo/posix/Kwajalein + dracut_install /usr/share/zoneinfo/posix/CST6CDT + dracut_install /usr/share/zoneinfo/posix/GB-Eire + dracut_install /usr/share/zoneinfo/posix/Australia/Melbourne + dracut_install /usr/share/zoneinfo/posix/Australia/Broken_Hill + dracut_install /usr/share/zoneinfo/posix/Australia/Queensland + dracut_install /usr/share/zoneinfo/posix/Australia/South + dracut_install /usr/share/zoneinfo/posix/Australia/Eucla + dracut_install /usr/share/zoneinfo/posix/Australia/Yancowinna + dracut_install /usr/share/zoneinfo/posix/Australia/Lord_Howe + dracut_install /usr/share/zoneinfo/posix/Australia/Hobart + dracut_install /usr/share/zoneinfo/posix/Australia/NSW + dracut_install /usr/share/zoneinfo/posix/Australia/West + dracut_install /usr/share/zoneinfo/posix/Australia/LHI + dracut_install /usr/share/zoneinfo/posix/Australia/Perth + dracut_install /usr/share/zoneinfo/posix/Australia/ACT + dracut_install /usr/share/zoneinfo/posix/Australia/Darwin + dracut_install /usr/share/zoneinfo/posix/Australia/Lindeman + dracut_install /usr/share/zoneinfo/posix/Australia/Sydney + dracut_install /usr/share/zoneinfo/posix/Australia/North + dracut_install /usr/share/zoneinfo/posix/Australia/Canberra + dracut_install /usr/share/zoneinfo/posix/Australia/Adelaide + dracut_install /usr/share/zoneinfo/posix/Australia/Brisbane + dracut_install /usr/share/zoneinfo/posix/Australia/Victoria + dracut_install /usr/share/zoneinfo/posix/Australia/Tasmania + dracut_install /usr/share/zoneinfo/posix/Australia/Currie + dracut_install /usr/share/zoneinfo/posix/UCT + dracut_install /usr/share/zoneinfo/posix/Cuba + dracut_install /usr/share/zoneinfo/posix/Singapore + dracut_install /usr/share/zoneinfo/posix/GMT + dracut_install /usr/share/zoneinfo/posix/NZ-CHAT + dracut_install /usr/share/zoneinfo/posix/Asia/Istanbul + dracut_install /usr/share/zoneinfo/posix/Asia/Kuwait + dracut_install /usr/share/zoneinfo/posix/Asia/Saigon + dracut_install /usr/share/zoneinfo/posix/Asia/Urumqi + dracut_install /usr/share/zoneinfo/posix/Asia/Brunei + dracut_install /usr/share/zoneinfo/posix/Asia/Ujung_Pandang + dracut_install /usr/share/zoneinfo/posix/Asia/Muscat + dracut_install /usr/share/zoneinfo/posix/Asia/Kashgar + dracut_install /usr/share/zoneinfo/posix/Asia/Kamchatka + dracut_install /usr/share/zoneinfo/posix/Asia/Manila + dracut_install /usr/share/zoneinfo/posix/Asia/Vladivostok + dracut_install /usr/share/zoneinfo/posix/Asia/Jayapura + dracut_install /usr/share/zoneinfo/posix/Asia/Magadan + dracut_install /usr/share/zoneinfo/posix/Asia/Almaty + dracut_install /usr/share/zoneinfo/posix/Asia/Qyzylorda + dracut_install /usr/share/zoneinfo/posix/Asia/Anadyr + dracut_install /usr/share/zoneinfo/posix/Asia/Nicosia + dracut_install /usr/share/zoneinfo/posix/Asia/Kathmandu + dracut_install /usr/share/zoneinfo/posix/Asia/Qatar + dracut_install /usr/share/zoneinfo/posix/Asia/Jerusalem + dracut_install /usr/share/zoneinfo/posix/Asia/Yakutsk + dracut_install /usr/share/zoneinfo/posix/Asia/Karachi + dracut_install /usr/share/zoneinfo/posix/Asia/Samarkand + dracut_install /usr/share/zoneinfo/posix/Asia/Kolkata + dracut_install /usr/share/zoneinfo/posix/Asia/Ulaanbaatar + dracut_install /usr/share/zoneinfo/posix/Asia/Irkutsk + dracut_install /usr/share/zoneinfo/posix/Asia/Baku + dracut_install /usr/share/zoneinfo/posix/Asia/Gaza + dracut_install /usr/share/zoneinfo/posix/Asia/Seoul + dracut_install /usr/share/zoneinfo/posix/Asia/Chungking + dracut_install /usr/share/zoneinfo/posix/Asia/Amman + dracut_install /usr/share/zoneinfo/posix/Asia/Kuala_Lumpur + dracut_install /usr/share/zoneinfo/posix/Asia/Aqtobe + dracut_install /usr/share/zoneinfo/posix/Asia/Katmandu + dracut_install /usr/share/zoneinfo/posix/Asia/Tashkent + dracut_install /usr/share/zoneinfo/posix/Asia/Oral + dracut_install /usr/share/zoneinfo/posix/Asia/Dhaka + dracut_install /usr/share/zoneinfo/posix/Asia/Hovd + dracut_install /usr/share/zoneinfo/posix/Asia/Makassar + dracut_install /usr/share/zoneinfo/posix/Asia/Bangkok + dracut_install /usr/share/zoneinfo/posix/Asia/Tokyo + dracut_install /usr/share/zoneinfo/posix/Asia/Macao + dracut_install /usr/share/zoneinfo/posix/Asia/Riyadh + dracut_install /usr/share/zoneinfo/posix/Asia/Rangoon + dracut_install /usr/share/zoneinfo/posix/Asia/Jakarta + dracut_install /usr/share/zoneinfo/posix/Asia/Aden + dracut_install /usr/share/zoneinfo/posix/Asia/Calcutta + dracut_install /usr/share/zoneinfo/posix/Asia/Ashkhabad + dracut_install /usr/share/zoneinfo/posix/Asia/Beirut + dracut_install /usr/share/zoneinfo/posix/Asia/Harbin + dracut_install /usr/share/zoneinfo/posix/Asia/Novosibirsk + dracut_install /usr/share/zoneinfo/posix/Asia/Omsk + dracut_install /usr/share/zoneinfo/posix/Asia/Aqtau + dracut_install /usr/share/zoneinfo/posix/Asia/Bahrain + dracut_install /usr/share/zoneinfo/posix/Asia/Dili + dracut_install /usr/share/zoneinfo/posix/Asia/Pontianak + dracut_install /usr/share/zoneinfo/posix/Asia/Singapore + dracut_install /usr/share/zoneinfo/posix/Asia/Baghdad + dracut_install /usr/share/zoneinfo/posix/Asia/Novokuznetsk + dracut_install /usr/share/zoneinfo/posix/Asia/Dubai + dracut_install /usr/share/zoneinfo/posix/Asia/Dushanbe + dracut_install /usr/share/zoneinfo/posix/Asia/Damascus + dracut_install /usr/share/zoneinfo/posix/Asia/Krasnoyarsk + dracut_install /usr/share/zoneinfo/posix/Asia/Tbilisi + dracut_install /usr/share/zoneinfo/posix/Asia/Yerevan + dracut_install /usr/share/zoneinfo/posix/Asia/Pyongyang + dracut_install /usr/share/zoneinfo/posix/Asia/Bishkek + dracut_install /usr/share/zoneinfo/posix/Asia/Colombo + dracut_install /usr/share/zoneinfo/posix/Asia/Yekaterinburg + dracut_install /usr/share/zoneinfo/posix/Asia/Chongqing + dracut_install /usr/share/zoneinfo/posix/Asia/Ho_Chi_Minh + dracut_install /usr/share/zoneinfo/posix/Asia/Hong_Kong + dracut_install /usr/share/zoneinfo/posix/Asia/Thimbu + dracut_install /usr/share/zoneinfo/posix/Asia/Thimphu + dracut_install /usr/share/zoneinfo/posix/Asia/Ashgabat + dracut_install /usr/share/zoneinfo/posix/Asia/Shanghai + dracut_install /usr/share/zoneinfo/posix/Asia/Tehran + dracut_install /usr/share/zoneinfo/posix/Asia/Tel_Aviv + dracut_install /usr/share/zoneinfo/posix/Asia/Taipei + dracut_install /usr/share/zoneinfo/posix/Asia/Kabul + dracut_install /usr/share/zoneinfo/posix/Asia/Macau + dracut_install /usr/share/zoneinfo/posix/Asia/Choibalsan + dracut_install /usr/share/zoneinfo/posix/Asia/Vientiane + dracut_install /usr/share/zoneinfo/posix/Asia/Dacca + dracut_install /usr/share/zoneinfo/posix/Asia/Kuching + dracut_install /usr/share/zoneinfo/posix/Asia/Phnom_Penh + dracut_install /usr/share/zoneinfo/posix/Asia/Ulan_Bator + dracut_install /usr/share/zoneinfo/posix/Asia/Sakhalin + dracut_install /usr/share/zoneinfo/posix/MST7MDT + dracut_install /usr/share/zoneinfo/posix/Canada/Atlantic + dracut_install /usr/share/zoneinfo/posix/Canada/Central + dracut_install /usr/share/zoneinfo/posix/Canada/Eastern + dracut_install /usr/share/zoneinfo/posix/Canada/Yukon + dracut_install /usr/share/zoneinfo/posix/Canada/Pacific + dracut_install /usr/share/zoneinfo/posix/Canada/Saskatchewan + dracut_install /usr/share/zoneinfo/posix/Canada/Mountain + dracut_install /usr/share/zoneinfo/posix/Canada/Newfoundland + dracut_install /usr/share/zoneinfo/posix/Israel + dracut_install /usr/share/zoneinfo/posix/Africa/Lagos + dracut_install /usr/share/zoneinfo/posix/Africa/Kigali + dracut_install /usr/share/zoneinfo/posix/Africa/Lome + dracut_install /usr/share/zoneinfo/posix/Africa/Niamey + dracut_install /usr/share/zoneinfo/posix/Africa/Conakry + dracut_install /usr/share/zoneinfo/posix/Africa/Asmera + dracut_install /usr/share/zoneinfo/posix/Africa/Banjul + dracut_install /usr/share/zoneinfo/posix/Africa/Abidjan + dracut_install /usr/share/zoneinfo/posix/Africa/Bujumbura + dracut_install /usr/share/zoneinfo/posix/Africa/Luanda + dracut_install /usr/share/zoneinfo/posix/Africa/Kampala + dracut_install /usr/share/zoneinfo/posix/Africa/Ouagadougou + dracut_install /usr/share/zoneinfo/posix/Africa/Libreville + dracut_install /usr/share/zoneinfo/posix/Africa/Lubumbashi + dracut_install /usr/share/zoneinfo/posix/Africa/Dakar + dracut_install /usr/share/zoneinfo/posix/Africa/Bamako + dracut_install /usr/share/zoneinfo/posix/Africa/Nairobi + dracut_install /usr/share/zoneinfo/posix/Africa/Bangui + dracut_install /usr/share/zoneinfo/posix/Africa/Johannesburg + dracut_install /usr/share/zoneinfo/posix/Africa/Accra + dracut_install /usr/share/zoneinfo/posix/Africa/Bissau + dracut_install /usr/share/zoneinfo/posix/Africa/Timbuktu + dracut_install /usr/share/zoneinfo/posix/Africa/Nouakchott + dracut_install /usr/share/zoneinfo/posix/Africa/Maputo + dracut_install /usr/share/zoneinfo/posix/Africa/Ndjamena + dracut_install /usr/share/zoneinfo/posix/Africa/Maseru + dracut_install /usr/share/zoneinfo/posix/Africa/Tripoli + dracut_install /usr/share/zoneinfo/posix/Africa/Blantyre + dracut_install /usr/share/zoneinfo/posix/Africa/Gaborone + dracut_install /usr/share/zoneinfo/posix/Africa/Addis_Ababa + dracut_install /usr/share/zoneinfo/posix/Africa/Porto-Novo + dracut_install /usr/share/zoneinfo/posix/Africa/Kinshasa + dracut_install /usr/share/zoneinfo/posix/Africa/Dar_es_Salaam + dracut_install /usr/share/zoneinfo/posix/Africa/Douala + dracut_install /usr/share/zoneinfo/posix/Africa/Mogadishu + dracut_install /usr/share/zoneinfo/posix/Africa/Monrovia + dracut_install /usr/share/zoneinfo/posix/Africa/Mbabane + dracut_install /usr/share/zoneinfo/posix/Africa/Algiers + dracut_install /usr/share/zoneinfo/posix/Africa/Lusaka + dracut_install /usr/share/zoneinfo/posix/Africa/Khartoum + dracut_install /usr/share/zoneinfo/posix/Africa/Asmara + dracut_install /usr/share/zoneinfo/posix/Africa/Tunis + dracut_install /usr/share/zoneinfo/posix/Africa/Casablanca + dracut_install /usr/share/zoneinfo/posix/Africa/Sao_Tome + dracut_install /usr/share/zoneinfo/posix/Africa/Ceuta + dracut_install /usr/share/zoneinfo/posix/Africa/El_Aaiun + dracut_install /usr/share/zoneinfo/posix/Africa/Harare + dracut_install /usr/share/zoneinfo/posix/Africa/Freetown + dracut_install /usr/share/zoneinfo/posix/Africa/Windhoek + dracut_install /usr/share/zoneinfo/posix/Africa/Djibouti + dracut_install /usr/share/zoneinfo/posix/Africa/Malabo + dracut_install /usr/share/zoneinfo/posix/Africa/Cairo + dracut_install /usr/share/zoneinfo/posix/Africa/Brazzaville + dracut_install /usr/share/zoneinfo/posix/Etc/Zulu + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-0 + dracut_install /usr/share/zoneinfo/posix/Etc/Greenwich + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+6 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+9 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-9 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+5 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT0 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-10 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+0 + dracut_install /usr/share/zoneinfo/posix/Etc/Universal + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+12 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-5 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+2 + dracut_install /usr/share/zoneinfo/posix/Etc/UTC + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+8 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-11 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-4 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-12 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+11 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+3 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+4 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+1 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-14 + dracut_install /usr/share/zoneinfo/posix/Etc/UCT + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+7 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-6 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-2 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-3 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-8 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-7 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-13 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT-1 + dracut_install /usr/share/zoneinfo/posix/Etc/GMT+10 + dracut_install /usr/share/zoneinfo/posix/PST8PDT + dracut_install /usr/share/zoneinfo/posix/Jamaica + dracut_install /usr/share/zoneinfo/posix/NZ + dracut_install /usr/share/zoneinfo/posix/PRC + dracut_install /usr/share/zoneinfo/posix/Chile/EasterIsland + dracut_install /usr/share/zoneinfo/posix/Chile/Continental + inst "$moddir/xcatroot" "/sbin/xcatroot" + inst "$moddir/dhclient.conf" "/etc/dhclient.conf" + inst "$moddir/dhclient-script" "/sbin/dhclient-script" + inst "$moddir/rsyslog.conf" "/etc/rsyslog.conf" + dracut_install chronyc chronyd rpcbind systemd-tmpfiles + dracut_install /etc/ssh + dracut_install /etc/chrony.conf + _dracut_install_opt /etc/chrony.keys + dracut_install /run/rpcbind + _dracut_install_opt /etc/systemd/system.conf /usr/lib/systemd/system.conf + dracut_install /sbin/rpc.statd /usr/sbin/sm-notify /etc/netconfig rpcbind /etc/host.conf /usr/sbin/rpc.idmapd + dracut_install ps free find #debug + inst_dir /var/lib/nfs + inst_dir /var/lib/nfs/statd/sm + inst_dir /var/lib/nfs/statd/sm.bak + inst_dir /var/lib/nfs/rpc_pipefs/nfs + inst "/bin/bash" "/bin/sh" + inst "/usr/share/terminfo/l/linux" + inst "/usr/share/terminfo/v/vt100" + inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" + dracut_install /lib64/rsyslog/lmtcpclt.so + dracut_install /lib64/rsyslog/omtesting.so + dracut_install /lib64/rsyslog/lmnetstrms.so + dracut_install /lib64/rsyslog/imfile.so + dracut_install /lib64/rsyslog/imklog.so + dracut_install /lib64/rsyslog/lmzlibw.so + dracut_install /lib64/rsyslog/immark.so + dracut_install /lib64/rsyslog/imudp.so + dracut_install /lib64/rsyslog/lmregexp.so + dracut_install /lib64/rsyslog/lmtcpsrv.so + dracut_install /lib64/rsyslog/lmnsd_ptcp.so + dracut_install /lib64/rsyslog/imtcp.so + dracut_install /lib64/rsyslog/lmnet.so + dracut_install /lib64/rsyslog/imuxsock.so + dracut_install /usr/lib64/libnfsidmap/nsswitch.so + dracut_install killall logger nc nslookup bc chown chroot dd expr kill mkdosfs parted rsync shutdown sort ssh-keygen tr blockdev findfs insmod kexec lvm mdadm mke2fs pivot_root sshd swapon tune2fs pvcreate lvremove vgremove vgcreate lvcreate lvscan lvchange vgchange pvdisplay lvdisplay vgdisplay blkid dmsetup sfdisk # for sysclone + dracut_install /lib/udev/rules.d/10-dm.rules + dracut_install /lib/udev/rules.d/11-dm-lvm.rules + dracut_install /lib/udev/rules.d/13-dm-disk.rules + dracut_install /lib/udev/rules.d/95-dm-notify.rules + # The DB files for lspci + dracut_install /usr/share/hwdata/pci.ids + # The DB files for udevadm + dracut_install /etc/udev/hwdb.bin +} diff --git a/xCAT-genesis-builder/dracut_105/ubuntu/module-setup.sh b/xCAT-genesis-builder/dracut_105/ubuntu/module-setup.sh new file mode 120000 index 000000000..9c490d80b --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/ubuntu/module-setup.sh @@ -0,0 +1 @@ +../el/module-setup.sh \ No newline at end of file From 3e657daee8e115c658f882e8f8e1e9aa1278d28b Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Mon, 9 Feb 2026 12:57:54 -0300 Subject: [PATCH 02/21] fix: Add xCAT-genesis-scripts to build list doc: Document a GPG error solution in buildrpm.pl manual. Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/buildrpms.pl b/buildrpms.pl index 8cf7b5361..b18a7d401 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -33,6 +33,7 @@ my @PACKAGES = qw( xCAT-probe xCAT-rmc xCAT-server + xCAT-genesis-scripts xCAT-test xCAT-vlan); @@ -96,6 +97,14 @@ sub sed (&$) { write_text($path, $content); } +sub is_in { + my $needle = shift; + for (@_) { + return 1 if $_ eq $needle; + } + return 0; +} + # product(\@A, \@B) returns the catersian product of \@A and \@B sub product { my ($a, $b) = @_; @@ -141,6 +150,8 @@ sub buildsources { cp xcat.conf.apach24 $SOURCES cp xCATMN $SOURCES '}; + } elsif ($pkg eq "xCAT-genesis-scripts") { + `tar -cjf "$SOURCES/$pkg.tar.bz2" $pkg`; } else { `tar -czf "$SOURCES/$pkg-$VERSION.tar.gz" $pkg`; } @@ -177,8 +188,14 @@ sub buildpkgs { my $optsref = \%opts; my $chroot = "$pkg-$target"; + my @native_pkgs = qw( + xCAT + xCAT-genesis-scripts + ); + + # get x86_64 from rhel+epel-9-x86_64 my $targetarch = (split /-/, $target, 3)[2]; - my $arch = $pkg eq "xCAT" ? $targetarch : "noarch"; + my $arch = is_in($pkg, @native_pkgs) ? $targetarch : "noarch"; my $diskcache = "dist/$target/rpms/$pkg-$VERSION-$RELEASE.$arch.rpm"; return if -f $diskcache and not $opts{force}; @@ -186,7 +203,14 @@ sub buildpkgs { my @opts; push @opts, "--quiet" unless $opts{verbose}; - say "Building $diskcache"; + my $spkgname = sub { + return "${pkg}-${arch}-${VERSION}-${RELEASE}.src.rpm" + if $pkg eq 'xCAT-genesis-scripts'; + + return "$pkg-${VERSION}-${RELEASE}.src.rpm"; + }->(); + + say "Building $pkg $diskcache"; sh(<<"EOF"); mock -r $chroot \\ @@ -196,7 +220,7 @@ mock -r $chroot \\ --define "release $RELEASE" \\ --define "gitinfo $GITINFO" \\ --resultdir "dist/$target/rpms/" \\ - --rebuild dist/$target/srpms/$pkg-${VERSION}-${RELEASE}.src.rpm + --rebuild dist/$target/srpms/$spkgname EOF } @@ -312,3 +336,17 @@ sub main { main(); +__END__; + +=head1 SYNOPSIS + +Build all xCAT RPM packages in parallel using mock for isolation + +=head1 KNOWN ERRORS + +=over 4 + + 1. Error : GPG error during mock cache creation/update + Cause : Out-dated distribution-gpg-keys in host machine + Solution : Run `dnf update -y distribution-gpg-keys` in the host. +=back From d691c5ccdaf4a24170ea5c1cbd47d56ce4923dc7 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Wed, 11 Feb 2026 14:47:58 -0300 Subject: [PATCH 03/21] fix: [WIP] Build xCAT-genesis-base source package in buildrpms.pl Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 208 ++++++++++++++---- xCAT-genesis-builder/dracut_105/README | 9 + .../dracut_105/el/dhclient-script | 60 +++++ .../dracut_105/el/dhclient.conf | 2 + .../dracut_105/el/module-setup.sh | 3 +- .../dracut_105/el/rsyslog.conf | 4 + .../dracut_105/el/xcat-cmdline.sh | 88 ++++++++ xCAT-genesis-builder/dracut_105/el/xcatroot | 8 + xCAT-genesis-builder/dracut_105/ubuntu | 1 + .../dracut_105/ubuntu/module-setup.sh | 1 - xCAT-genesis-builder/install | 3 +- xCAT-genesis-builder/install.ubuntu | 3 +- xCAT-genesis-builder/xCAT-genesis-base.spec | 7 +- xCAT-genesis-scripts/etc/init.d/functions | 53 ++++- 14 files changed, 396 insertions(+), 54 deletions(-) create mode 100644 xCAT-genesis-builder/dracut_105/README create mode 100755 xCAT-genesis-builder/dracut_105/el/dhclient-script create mode 100644 xCAT-genesis-builder/dracut_105/el/dhclient.conf create mode 100644 xCAT-genesis-builder/dracut_105/el/rsyslog.conf create mode 100755 xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh create mode 100755 xCAT-genesis-builder/dracut_105/el/xcatroot create mode 120000 xCAT-genesis-builder/dracut_105/ubuntu delete mode 120000 xCAT-genesis-builder/dracut_105/ubuntu/module-setup.sh diff --git a/buildrpms.pl b/buildrpms.pl index b18a7d401..1301d55a1 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -5,12 +5,18 @@ use warnings; use feature 'say'; -use Data::Dumper; -use File::Copy (); -use File::Slurper qw(read_text write_text); -use Parallel::ForkManager; -use Getopt::Long qw(GetOptions); +use Carp; use Cwd qw(); +use Data::Dumper; +use File::Copy qw(cp); +use File::Path qw(make_path); +use File::Slurper qw(read_text write_text); +use FindBin qw($Bin); +use Getopt::Long qw(GetOptions); +use Parallel::ForkManager; + +use autodie; +use autodie qw(cp); my $SOURCES = "$ENV{HOME}/rpmbuild/SOURCES"; my $VERSION = read_text("Version"); @@ -29,13 +35,15 @@ my @PACKAGES = qw( xCAT-buildkit xCAT-client xCAT-confluent + xCAT-genesis-base + xCAT-genesis-scripts xCAT-openbmc-py xCAT-probe xCAT-rmc xCAT-server - xCAT-genesis-scripts xCAT-test - xCAT-vlan); + xCAT-vlan +); my @TARGETS = qw( rhel+epel-8-x86_64 @@ -44,47 +52,35 @@ my @TARGETS = qw( my %opts = ( - targets => \@TARGETS, - packages => \@PACKAGES, - nproc => int(`nproc --all`), - force => 0, - verbose => 0, - xcat_dep_path => "$PWD/../xcat-dep/", configure_nginx => 0, + force => 0, help => 0, nginx_port => 8080, + nproc => int(`nproc --all`), + packages => \@PACKAGES, + targets => \@TARGETS, + verbose => 0, + xcat_dep_path => "$PWD/../xcat-dep/", ); GetOptions( - "target=s@" => \$opts{targets}, - "package=s@" => \$opts{packages}, - "nproc=i" => \$opts{nproc}, - "verbose" => \$opts{verbose}, - "force" => \$opts{force}, - "xcat_dep_path=s" => \$opts{xcat_dep_path}, "configure_nginx" => \$opts{configure_nginx}, + "force" => \$opts{force}, "help" => \$opts{help}, "nginx_port" => \$opts{nginx_port}, + "nproc=i" => \$opts{nproc}, + "package=s@" => \$opts{packages}, + "target=s@" => \$opts{targets}, + "verbose" => \$opts{verbose}, + "xcat_dep_path=s" => \$opts{xcat_dep_path}, ) or usage(); sub sh { my ($cmd) = @_; say "Running: $cmd" if $opts{verbose}; - open my $fh, "-|", "bash -lc '$cmd'" or die "cannot run $cmd: $!"; - - while (my $line = <$fh>) { - print $line - if $opts{verbose}; - } - close $fh; - return $? >> 8; -} - -# cp $src, $dst copies $src to $dst or aborts with an error message -sub cp { - my ($src, $dst) = @_; - File::Copy::copy($src, $dst) or die "copy $src, $dst failed: $!"; + system($cmd); + $? >> 8; } # sed { s/foo/bar/ } $filepath applies s/foo/bar/ to the file at $filepath @@ -102,7 +98,7 @@ sub is_in { for (@_) { return 1 if $_ eq $needle; } - return 0; + 0; } # product(\@A, \@B) returns the catersian product of \@A and \@B @@ -124,12 +120,124 @@ sub createmockconfig { $contents =~ s/config_opts\['root'\]\s+=.*/config_opts['root'] = \"$chroot\"/; if ($pkg eq "perl-xCAT") { # perl-generators is required for having perl(xCAT::...) symbols - # exported by the RPM + # exported by the RPM $contents .= "config_opts['chroot_additional_packages'] = 'perl-generators'\n"; } write_text($cfgfile, $contents); } +sub buildsources_genesis_base() { + die "Assertion failed! No directory xCAT-genesis-builder in the current directory" + unless -d "./xCAT-genesis-builder"; + + my @deps = qw( + bind-utils + dosfstools + ethtool + ipmitool + kexec-tools + lldpad + mdadm + mstflint + nmap-ncat + net-tools + pciutils + psmisc + rpm-build + rpmdevtools + screen + usbutils + ); + sh("dnf install -y " . join " ", @deps) + and die "Error installing packages $?"; + + my $dracutmoddir = "/usr/lib/dracut/modules.d/97xcat/"; + + my $buildarch = `uname -m`; + my $kernelversion = `uname -r`; + chomp $buildarch; + chomp $kernelversion; + + my $genesispath = "/tmp/xcatgenesis.$$"; + my $buildpath = "$genesispath/opt/xcat/share/xcat/netboot/genesis/$buildarch"; + + make_path $dracutmoddir; + make_path "$buildpath/fs/etc/ssh/"; + + my @files = map { "$Bin/xCAT-genesis-builder/dracut_105/el/$_" } + qw( + module-setup.sh + xcat-cmdline.sh + xcatroot + dhclient.conf + dhclient-script + rsyslog.conf + ); + # copy @files to $dracutmoddir + cp $_, $dracutmoddir for @files; + + # The dependents of these must be updated + # * netstat + # * /sbin/route + # * /sbin/ifconfig -> net-tool + # * nslookup + + + + my $opts = $opts{verbose} ? "set -x" : ""; + sh(<<"EOF"); +$opts +dracut --compress gzip -m "xcat base" --no-early-microcode -N -f $genesispath.rfs; +rm -rf $buildpath/fs || : +mkdir -p $buildpath/fs || : +cd $buildpath/fs +zcat $genesispath.rfs | cpio -dumi +EOF + + my @perl_lib_dir = qw( + /usr/share/perl5 + /usr/lib64/perl5 + /usr/local/lib64/perl5 + /usr/local/share/perl5 + /usr/share/ntp/lib + ); + + for my $d (@perl_lib_dir) { + next unless -d $d; + my $temp_dir = "$buildpath/fs/$d"; + make_path $temp_dir; + # cp function does not copy directories recursively + `cp -a -t $temp_dir $d/.`; + } + + make_path "$buildpath/fs/lib/udev/rules.d/"; + my $oldcwd = Cwd::cwd(); + my $lib_udev_rules="/lib/udev/rules.d/"; + cp "$lib_udev_rules/80-net-name-slot.rules", "$buildpath/fs/lib/udev/rules.d/" + if -e "$lib_udev_rules/80-net-name-slot.rules"; + + make_path("$buildpath/kernel/"); + cp "/boot/vmlinuz-$kernelversion", "$buildpath/kernel/"; + + # Create the targz + # + # Note: + # + # Deletes character devices from the genesis-base + # image filesystem prior to tarball creation. The installation + # of the package fails in vanilla containers with "Operation not + # permited" during the creation of + # + # /opt/xcat/../genesis/../fs/dev/{console,random,...} + # + # otherwise. + sh(<<"EOF") +cd $genesispath +find . -type c -delete +tar jcf $SOURCES/xCAT-genesis-base-$buildarch.tar.bz2 opt +EOF +} + sub buildsources { my ($pkg, $target) = @_; @@ -139,7 +247,7 @@ sub buildsources { cp "xCAT-genesis-scripts/usr/bin/$f", "$pkg/postscripts/$f"; sed { s/xcat.genesis.$f/$f/ } "${pkg}/postscripts/$f"; } - qx {bash -c ' + sh(<<'EOF'); cd xCAT tar --exclude upflag -czf $SOURCES/postscripts.tar.gz postscripts LICENSE.html tar -czf $SOURCES/prescripts.tar.gz prescripts @@ -149,21 +257,30 @@ sub buildsources { cp xcat.conf $SOURCES cp xcat.conf.apach24 $SOURCES cp xCATMN $SOURCES - '}; +EOF } elsif ($pkg eq "xCAT-genesis-scripts") { - `tar -cjf "$SOURCES/$pkg.tar.bz2" $pkg`; + sh qq(tar -cjf "$SOURCES/$pkg.tar.bz2" $pkg); + } elsif ($pkg eq "xCAT-genesis-base") { + buildsources_genesis_base(); } else { - `tar -czf "$SOURCES/$pkg-$VERSION.tar.gz" $pkg`; + sh qq(tar -czf "$SOURCES/$pkg-$VERSION.tar.gz" $pkg); } } sub buildspkgs { my ($pkg, $target) = @_; + my $chroot = "$pkg-$target"; my $diskcache = "dist/$target/srpms/$pkg-$VERSION-$RELEASE.src.rpm"; return if -f $diskcache and not $opts{force}; + my $dir = sub { + return "xCAT-genesis-builder" + if $pkg eq "xCAT-genesis-base"; + $pkg; + }->(); + my @opts; push @opts, "--quiet" unless $opts{verbose}; @@ -177,7 +294,7 @@ mock -r $chroot \\ --define "release $RELEASE" \\ --define "gitinfo $GITINFO" \\ --buildsrpm \\ - --spec $pkg/$pkg.spec \\ + --spec $dir/$pkg.spec \\ --sources $SOURCES \\ --resultdir "dist/$target/srpms/" EOF @@ -195,6 +312,11 @@ sub buildpkgs { # get x86_64 from rhel+epel-9-x86_64 my $targetarch = (split /-/, $target, 3)[2]; + + # get the builder arch, xCAT-genesis-base include it in its package name + my $nativearch = `uname -m`; + chomp $nativearch; + $nativearch = "ppc64" if $nativearch =~ /^ppc/; my $arch = is_in($pkg, @native_pkgs) ? $targetarch : "noarch"; my $diskcache = "dist/$target/rpms/$pkg-$VERSION-$RELEASE.$arch.rpm"; @@ -206,6 +328,8 @@ sub buildpkgs { my $spkgname = sub { return "${pkg}-${arch}-${VERSION}-${RELEASE}.src.rpm" if $pkg eq 'xCAT-genesis-scripts'; + return "xCAT-genesis-base-${nativearch}-${VERSION}-${RELEASE}.src.rpm" + if $pkg eq 'xCAT-genesis-base'; return "$pkg-${VERSION}-${RELEASE}.src.rpm"; }->(); @@ -247,7 +371,7 @@ EOF my $fullpath = "$PWD/dist/$target/rpms"; $conf .= <<"EOF"; location /$target/ { - alias $fullpath/; + alias $fullpath/; autoindex on; index off; allow all; @@ -257,7 +381,7 @@ EOF # TODO:I need one xcat-dep for each target $conf .= <<"EOF"; location /xcat-dep/ { - alias $xcat_dep_path; + alias $xcat_dep_path; autoindex on; index off; allow all; diff --git a/xCAT-genesis-builder/dracut_105/README b/xCAT-genesis-builder/dracut_105/README new file mode 100644 index 000000000..24d5433e7 --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/README @@ -0,0 +1,9 @@ +Dracut modules for EL10 + + +Notes: + +* For now `ubuntu` is just a symlink to EL module, we + may or may not need to diverge later. +* These files were copied from ../ so we can adapt they + without breaking old behavior diff --git a/xCAT-genesis-builder/dracut_105/el/dhclient-script b/xCAT-genesis-builder/dracut_105/el/dhclient-script new file mode 100755 index 000000000..a1987fc1c --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/el/dhclient-script @@ -0,0 +1,60 @@ +#!/bin/sh +PATH=/bin:/sbin:/usr/bin:/usr/sbin +if [ $reason = "PREINIT" -o $reason = "PREINIT6" ]; then + ip link set $interface up + tries=50 + while ! (ip link show $interface|grep LOWER_UP > /dev/null 2>&1); do + sleep 0.1 + if [ $tries = 0 ]; then + break + fi + tries=$((tries-1)) + done +elif [ $reason = "BOUND" ]; then + if [ ! -z "$old_ip_address" ]; then + ip addr del dev $interface $old_ip_address/$old_subnet_mask + fi + for oldip in `ip -o addr show dev $interface|awk '{print $4}'`; do + ip addr del dev $interface $oldip + done + if [ ! -z "$new_ip_address" -a ! -z "$new_subnet_mask" ]; then + ip addr add dev $interface $new_ip_address/$new_subnet_mask + fi + if [ ! -z "$new_host_name" ]; then + hostname $new_host_name + lldptool -T -i $interface -V 5 enableTx=yes >& /dev/null + fi + if [ ! -z "$new_domain_name" ]; then + echo search $new_domain_name >> /etc/resolv.conf + fi + for ns in $new_domain_name_servers; do + echo nameserver $ns >> /etc/resolv.conf + done + for ntp in $new_ntp_servers; do + echo server $ntp iburst >> /etc/ntp.conf + done + for gw in $new_routers; do + ip route add default via $gw + done + + if [ ! -z "$new_tcode" -a -r "/usr/share/zoneinfo/posix/$new_tcode" ]; then + cp "/usr/share/zoneinfo/posix/$new_tcode" /etc/localtime + rm -rf /usr/share/zoneinfo #free up ramdisk + fi +elif [ $reason = "BOUND6" ]; then + if [ ! -z "$old_ip6_address" ]; then + ip addr del dev $interface $old_ip6_address/$old_ip6_prefixlen + fi + if [ ! -z "$new_ip6_address" ]; then + ip addr add dev $interface $new_ip6_address/$new_ip6_prefixlen + fi +elif [ $reason = "RELEASE" ]; then + if [ ! -z "$old_ip_address" ]; then + ip addr del dev $interface $old_ip_address/$old_subnet_mask + fi +elif [ $reason = "RELEASE6" ]; then + if [ ! -z "$old_ip6_address" ]; then + ip addr del dev $interface $old_ip6_address/$old_ip6_prefixlen + fi +fi +exit 0 diff --git a/xCAT-genesis-builder/dracut_105/el/dhclient.conf b/xCAT-genesis-builder/dracut_105/el/dhclient.conf new file mode 100644 index 000000000..53e8b1a74 --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/el/dhclient.conf @@ -0,0 +1,2 @@ +option tcode code 101 = text; +request subnet-mask, routers, domain-name, domain-search, domain-name-servers, host-name, ntp-servers, interface-mtu, tcode, log-servers; diff --git a/xCAT-genesis-builder/dracut_105/el/module-setup.sh b/xCAT-genesis-builder/dracut_105/el/module-setup.sh index 1e1f1158f..ddf3409a6 100755 --- a/xCAT-genesis-builder/dracut_105/el/module-setup.sh +++ b/xCAT-genesis-builder/dracut_105/el/module-setup.sh @@ -51,7 +51,8 @@ install() { 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 /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 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 diff --git a/xCAT-genesis-builder/dracut_105/el/rsyslog.conf b/xCAT-genesis-builder/dracut_105/el/rsyslog.conf new file mode 100644 index 000000000..82ecc3260 --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/el/rsyslog.conf @@ -0,0 +1,4 @@ +$ModLoad imuxsock +$ModLoad immark +$MarkMessagePeriod 1200 +*.* /var/log/xcat.genesis diff --git a/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh b/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh new file mode 100755 index 000000000..15ead2175 --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh @@ -0,0 +1,88 @@ +#!/bin/bash +root=1 +rootok=1 +netroot=xcat +clear +echo PS1="'"'[xCAT Genesis running on \H \w]\$ '"'" > /.bashrc +echo PS1="'"'[xCAT Genesis running on \H \w]\$ '"'" > /.bash_profile +mkdir -p /etc/ssh +mkdir -p /var/tmp/ +mkdir -p /var/empty/sshd +sed -i '/^root:x/d' /etc/passwd +cat >>/etc/passwd <<"__ENDL" +root:x:0:0::/:/bin/bash +sshd:x:30:30:SSH User:/var/empty/sshd:/sbin/nologin +rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/sbin/nologin +rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin +qemu:x:107:107:qemu user:/:/sbin/nologin +chrony:x:995:991::/var/lib/chrony:/sbin/nologin +__ENDL +# Fedora 20 ppc64 uses /lib/dracut/hooks/initqueue/finished +# CentOS 7 probably uses /lib/dracut/hooks/initqueue/finished also +if [ -d "/initqueue-finished" ]; then + echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh +else + #echo 'if [ -e /proc ]; then /bin/doxcat; fi' > /lib/dracut/hooks/initqueue/finished/xcatroot.sh + echo '[ -e /proc ]' > /lib/dracut/hooks/initqueue/finished/xcatroot.sh +fi +mkdir /dev/cgroup +mount -t cgroup -o cpu,memory,devices cgroup /dev/cgroup +# Fedora 20 ppc64 does not udevd +# CentOS 7 probably does not have udevd either +if [ -f "/sbin/udevd" ]; then + udevd --daemon +else + /usr/lib/systemd/systemd-udevd --daemon +fi +udevadm trigger +mkdir -p /var/lib/dhclient/ +mkdir -p /var/log +ip link set lo up +echo '127.0.0.1 localhost' >> /etc/hosts +if grep -q console=ttyS /proc/cmdline; then + while :; do sleep 1; screen -S console -ln screen -x doxcat /dev/tty1; clear &>/dev/tty1 ; done & +fi +while :; do screen -ln < /dev/tty2 &> /dev/tty2 ; done & + +# The section below is just for System P LE hardware discovery + +# Need to wait for NIC initialization +sleep 20 +ARCH="$(uname -m)" + +if [[ ${ARCH} =~ ppc64 ]]; then + # load all network driver modules listed in /lib/modules//modules.dep file + KERVER=`uname -r` + for line in `cat /lib/modules/$KERVER/modules.dep | awk -F: '{print \$1}' | sed -e "s/\(.*\)\.ko.*/\1/"`; do + if [[ $line =~ "kernel/drivers/net" ]]; then + modprobe `basename $line` + fi + done + # Check if running on a VM, and load "virtio_pci" module + cat /proc/cpuinfo | grep "machine" | grep "emulated" + if [ $? -eq 0 ]; then + modprobe virtio_pci + fi + waittime=2 + 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 + ip link set "$tmp" up + fi + tmp_data="UP" + waittime=$((waittime+1)) + done + # wait 2+number_of_nics seconds for all the LINKed NICs to be UP + sleep $waittime +elif [[ ${ARCH} =~ x86_64 ]]; then + # load all network driver modules listed in /lib/modules//modules.dep file + KERVER=`uname -r` + for line in `cat /lib/modules/$KERVER/modules.dep |grep -vE 'tunnel|ieee|ifb|bond|dummy|fjes|hv_netvsc|ntb_netdev|xen-netfront|hdlc_fr|dlci'| awk -F: '{print \$1}' | sed -e "s/\(.*\)\.ko.*/\1/"`; do + if [[ $line =~ "kernel/drivers/net" ]]; then + modprobe `basename $line` + fi + done +fi + +while :; do screen -dr doxcat || screen -S doxcat -L -ln doxcat; done diff --git a/xCAT-genesis-builder/dracut_105/el/xcatroot b/xCAT-genesis-builder/dracut_105/el/xcatroot new file mode 100755 index 000000000..3eeec2bf0 --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/el/xcatroot @@ -0,0 +1,8 @@ +#!/bin/sh +echo "Starting xCAT mini-environment" +NEWROOT=$3 +XCATMASTER=$XCAT +while : +do + /bin/sh +done diff --git a/xCAT-genesis-builder/dracut_105/ubuntu b/xCAT-genesis-builder/dracut_105/ubuntu new file mode 120000 index 000000000..234126bdd --- /dev/null +++ b/xCAT-genesis-builder/dracut_105/ubuntu @@ -0,0 +1 @@ +el \ No newline at end of file diff --git a/xCAT-genesis-builder/dracut_105/ubuntu/module-setup.sh b/xCAT-genesis-builder/dracut_105/ubuntu/module-setup.sh deleted file mode 120000 index 9c490d80b..000000000 --- a/xCAT-genesis-builder/dracut_105/ubuntu/module-setup.sh +++ /dev/null @@ -1 +0,0 @@ -../el/module-setup.sh \ No newline at end of file diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 9a4ac3f0a..9d5674c6d 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -10,7 +10,8 @@ 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 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 /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 efibootmgr lldptool dmidecode #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si dracut_install /usr/share/zoneinfo/posix/Zulu dracut_install /usr/share/zoneinfo/posix/GMT-0 diff --git a/xCAT-genesis-builder/install.ubuntu b/xCAT-genesis-builder/install.ubuntu index 685f00c7c..f7363212e 100755 --- a/xCAT-genesis-builder/install.ubuntu +++ b/xCAT-genesis-builder/install.ubuntu @@ -29,7 +29,8 @@ else dracut_install /usr/lib/libldap-2.4.so.2 /usr/lib/liblber-2.4.so.2 /usr/lib64/libsasl2.so.2 #uxspi has incurred these... dracut_install /lib/libc.so.6 fi -dracut_install chmod /lib/ld-linux.so.2 /sbin/route /sbin/ifconfig /usr/bin/head /etc/debian_version /etc/lsb-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements +#dracut_install chmod /lib/ld-linux.so.2 /sbin/route /sbin/ifconfig /usr/bin/head /etc/debian_version /etc/lsb-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements +dracut_install chmod /lib/ld-linux.so.2 ip /usr/bin/head /etc/debian_version /etc/lsb-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements dracut_install /usr/share/zoneinfo/posix/Zulu dracut_install /usr/share/zoneinfo/posix/GMT-0 dracut_install /usr/share/zoneinfo/posix/Europe/Istanbul diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index 54f157017..b92568a5b 100644 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -1,6 +1,5 @@ -%global version %(rpm -q xCAT --qf "%{VERSION}" 2>/dev/null | grep -Po '[0-9\.]+' || echo "2.17.0") -Version: %{version} -Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Version: %{?version:%{version}}%{!?version:%(cat Version)} +Release: %{?release:%{release}}%{!?release:%(cat Release)} %ifarch i386 i586 i686 x86 %define tarch x86 %endif @@ -57,7 +56,7 @@ cd - %pretrans -p -- Lua block of code for removing a directory recursively -- The Lua function remove_directory_deep should be called --- with a directory name or, in a spec file, also with +-- with a directory name in a spec file, also with -- a rpm macro defined to a directory name. This function -- is a possible lua equivalent of the shell command "rm -rf" -- using the lua posix extension embedded in rpm diff --git a/xCAT-genesis-scripts/etc/init.d/functions b/xCAT-genesis-scripts/etc/init.d/functions index 481fbab08..61769faea 100644 --- a/xCAT-genesis-scripts/etc/init.d/functions +++ b/xCAT-genesis-scripts/etc/init.d/functions @@ -789,7 +789,34 @@ start_udevd() { ifconfig_loopback() { logmsg logmsg ifconfig_loopback - ifconfig lo 127.0.0.1 + #ifconfig lo 127.0.0.1 + ip link set lo up + ip addr replace 127.0.0.1/8 dev lo +} +# +################################################################################ +# +# Convert netmask to prefix length (e.g. 255.255.255.0 -> 24) +mask2prefix() { + nbits=0 + old_ifs=$IFS + IFS=. + for dec in $1 ; do + case $dec in + 255) nbits=$((nbits+8));; + 254) nbits=$((nbits+7));; + 252) nbits=$((nbits+6));; + 248) nbits=$((nbits+5));; + 240) nbits=$((nbits+4));; + 224) nbits=$((nbits+3));; + 192) nbits=$((nbits+2));; + 128) nbits=$((nbits+1));; + 0);; + *) IFS=$old_ifs; return 1;; + esac + done + IFS=$old_ifs + echo "$nbits" } # ################################################################################ @@ -920,7 +947,23 @@ start_network() { if [ ! -z $IPADDR ]; then # configure interface and add default gateway - ifconfig $DEVICE $IPADDR netmask $NETMASK broadcast $BROADCAST + #ifconfig $DEVICE $IPADDR netmask $NETMASK broadcast $BROADCAST + if [ -z "$NETMASK" ]; then + logmsg + logmsg "Invalid netmask: $NETMASK" + shellout + fi + numbits=$(mask2prefix $NETMASK) + if [ $? != 0 -o -z "$numbits" ]; then + logmsg + logmsg "Invalid netmask: $NETMASK" + shellout + fi + if [ -n "$BROADCAST" ]; then + ip link set $DEVICE up && ip addr replace $IPADDR/$numbits brd $BROADCAST dev $DEVICE + else + ip link set $DEVICE up && ip addr replace $IPADDR/$numbits dev $DEVICE + fi if [ $? != 0 ]; then logmsg logmsg "I couldn't configure the network interface using your pre-boot settings:" @@ -933,10 +976,12 @@ start_network() { fi if [ ! -z $GATEWAY ]; then - route add default gw $GATEWAY + #route add default gw $GATEWAY + ip route add default via $GATEWAY if [ $? != 0 ]; then logmsg - logmsg "The command \"route add default gw $GATEWAY\" failed." + #logmsg "The command \"route add default gw $GATEWAY\" failed." + logmsg "The command \"ip route add default via $GATEWAY\" failed." logmsg "Check your pre-boot network settings." logmsg shellout From 7c01777fd572f75cf9d04b0c2c0375265254a0a0 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Fri, 20 Feb 2026 10:27:33 -0300 Subject: [PATCH 04/21] fix: Add install_deps to buildrpm.pl to automate deps installation Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/buildrpms.pl b/buildrpms.pl index 1301d55a1..9be677b57 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -5,6 +5,33 @@ use warnings; use feature 'say'; +sub install_deps { + system(<<"EOF"); + set -x + source /etc/os-release + case "\$ID" in + rhel) + subscription-manager repos --enable codeready-builder-for-rhel-10-\$(arch)-rpms + ;; + *) + dnf config-manager --set-enabled crb + ;; + esac + dnf install -y perl-generators https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm + dnf install -y \$(/usr/lib/rpm/perl.req $0) + dnf install -y tar mock nginx createrepo podman rpmdevtools + + rpmdev-setuptree +EOF + $? >> 8; +} + +BEGIN { + + exit(install_deps()) + if grep { "--install_deps" eq $_ } @ARGV; +} + use Carp; use Cwd qw(); use Data::Dumper; @@ -247,7 +274,7 @@ sub buildsources { cp "xCAT-genesis-scripts/usr/bin/$f", "$pkg/postscripts/$f"; sed { s/xcat.genesis.$f/$f/ } "${pkg}/postscripts/$f"; } - sh(<<'EOF'); + sh(<<"EOF"); cd xCAT tar --exclude upflag -czf $SOURCES/postscripts.tar.gz postscripts LICENSE.html tar -czf $SOURCES/prescripts.tar.gz prescripts From 51c638476eb667c01594c57c0ca91b1950ac9b57 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Fri, 20 Feb 2026 11:25:47 -0300 Subject: [PATCH 05/21] fix: Fix dracut dependencies in buildrpm.pl Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/buildrpms.pl b/buildrpms.pl index 9be677b57..198f0a260 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -87,6 +87,7 @@ my %opts = ( packages => \@PACKAGES, targets => \@TARGETS, verbose => 0, + setup_vhpc_repo => 0, xcat_dep_path => "$PWD/../xcat-dep/", ); @@ -100,6 +101,7 @@ GetOptions( "target=s@" => \$opts{targets}, "verbose" => \$opts{verbose}, "xcat_dep_path=s" => \$opts{xcat_dep_path}, + "setup_vhpc_repo" => \$opts{setup_vhpc_repo}, ) or usage(); sub sh { @@ -137,6 +139,17 @@ sub product { } @$a } +sub setup_vhpc_repo { + write_text("/etc/yum.repos.d/VersatusHPC.repo", <<'EOF'); +[VersatusHPC] +name=VersatusHPC +baseurl=https://mirror.versatushpc.com.br/versatushpc/rpm/el10/ +gpgcheck=0 +EOF + system("dnf makecache --repoid=VersatusHPC"); + $? >> 0; +} + sub createmockconfig { my ($pkg, $target) = @_; my $chroot = "$pkg-$target"; @@ -174,10 +187,14 @@ sub buildsources_genesis_base() { rpmdevtools screen usbutils + + nfs-utils rpcbind + dhclient ); sh("dnf install -y " . join " ", @deps) and die "Error installing packages $?"; + my $dracutmoddir = "/usr/lib/dracut/modules.d/97xcat/"; my $buildarch = `uname -m`; @@ -417,6 +434,7 @@ EOF EOF write_text("/etc/nginx/conf.d/xcat-repos.conf", $conf); `systemctl restart nginx`; + $? >> 8; } sub update_repo { @@ -456,7 +474,8 @@ sub usage { sub main { return usage() if $opts{help}; - return configure_nginx() if $opts{configure_nginx}; + return exit(configure_nginx()) if $opts{configure_nginx}; + return exit(setup_vhpc_repo()) if $opts{setup_vhpc_repo}; my @rpms = product($opts{packages}, $opts{targets}); my $pm = Parallel::ForkManager->new($opts{nproc}); From 0e0ead786ff73d98f21ec1800fc46df7d82fdf5b Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:08:40 -0300 Subject: [PATCH 06/21] fix: Fix genesis & sequential node discovery in x86_64 Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 109 +++++++++++++++--- .../dracut_105/el/module-setup.sh | 3 +- .../dracut_105/el/xcat-cmdline.sh | 4 +- xCAT-server/sbin/xcatconfig | 3 + xCAT/xCAT.spec | 3 +- 5 files changed, 104 insertions(+), 18 deletions(-) diff --git a/buildrpms.pl b/buildrpms.pl index 198f0a260..189aea57c 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -21,6 +21,8 @@ sub install_deps { dnf install -y \$(/usr/lib/rpm/perl.req $0) dnf install -y tar mock nginx createrepo podman rpmdevtools + systemctl enable --now nginx + rpmdev-setuptree EOF $? >> 8; @@ -36,7 +38,7 @@ use Carp; use Cwd qw(); use Data::Dumper; use File::Copy qw(cp); -use File::Path qw(make_path); +use File::Path qw(make_path remove_tree); use File::Slurper qw(read_text write_text); use FindBin qw($Bin); use Getopt::Long qw(GetOptions); @@ -87,7 +89,6 @@ my %opts = ( packages => \@PACKAGES, targets => \@TARGETS, verbose => 0, - setup_vhpc_repo => 0, xcat_dep_path => "$PWD/../xcat-dep/", ); @@ -101,7 +102,7 @@ GetOptions( "target=s@" => \$opts{targets}, "verbose" => \$opts{verbose}, "xcat_dep_path=s" => \$opts{xcat_dep_path}, - "setup_vhpc_repo" => \$opts{setup_vhpc_repo}, + "setup_local_repos" => \$opts{setup_local_repos}, ) or usage(); sub sh { @@ -139,14 +140,39 @@ sub product { } @$a } -sub setup_vhpc_repo { - write_text("/etc/yum.repos.d/VersatusHPC.repo", <<'EOF'); -[VersatusHPC] -name=VersatusHPC -baseurl=https://mirror.versatushpc.com.br/versatushpc/rpm/el10/ -gpgcheck=0 +sub os_release { + my %os; + open my $fh, '<', '/etc/os-release' or die "Cannot open /etc/os-release: $!"; + + while (<$fh>) { + chomp; + next if /^\s*#/ || !/=/; + my ($k, $v) = split /=/, $_, 2; + $v =~ s/^["'](.*)["']$/$1/; # strip surrounding quotes + $os{$k} = $v; + } + + return %os; # usage: my %os = os_release(); +} + +sub setup_repo { + my (%opts) = @_; + my $id = $opts{-id} or confess "-id is required"; + my $name = $opts{-name} // $id; + my $url = $opts{-baseurl} or confess "-url is required"; + my $gpgkey = $opts{-gpgkey}; + my $gpgcheck = $gpgkey ? 1 : 0 ; + my $gpgkey_line = + $gpgkey + ? "gpgkey=$gpgkey" + : "# gpgkey="; + write_text("/etc/yum.repos.d/$id.repo", <<"EOF"); +[$id] +name=$name +baseurl=$url +$gpgkey_line +gpgcheck=$gpgcheck EOF - system("dnf makecache --repoid=VersatusHPC"); $? >> 0; } @@ -238,6 +264,16 @@ cd $buildpath/fs zcat $genesispath.rfs | cpio -dumi EOF + # Ensure helper scripts remain executable in genesis rootfs. + # EL10 discovery needs dhclient-script to be executable. + for my $script ( + "$buildpath/fs/sbin/dhclient-script", + "$buildpath/fs/usr/sbin/dhclient-script", + "$buildpath/fs/sbin/xcatroot", + ) { + chmod 0755, $script if -f $script; + } + my @perl_lib_dir = qw( /usr/share/perl5 /usr/lib64/perl5 @@ -260,8 +296,11 @@ EOF cp "$lib_udev_rules/80-net-name-slot.rules", "$buildpath/fs/lib/udev/rules.d/" if -e "$lib_udev_rules/80-net-name-slot.rules"; - make_path("$buildpath/kernel/"); - cp "/boot/vmlinuz-$kernelversion", "$buildpath/kernel/"; + # Keep historical layout: kernel is a file, not a directory. + # mknb expects genesis//kernel to be copied as a kernel file. + unlink "$buildpath/kernel" if -l "$buildpath/kernel" || -f "$buildpath/kernel"; + remove_tree "$buildpath/kernel" if -d "$buildpath/kernel"; + cp "/boot/vmlinuz-$kernelversion", "$buildpath/kernel"; # Create the targz # @@ -401,7 +440,27 @@ sub buildall { } sub configure_nginx { - my $xcat_dep_path = $opts{xcat_dep_path}; + my %os = os_release(); + my $version = $os{VERSION_ID}; + my $xcat_dep_path; + + if ($version > 10) { + setup_repo + -id => "VersatusHPC", + -baseurl => "https://mirror.versatushpc.com.br/versatushpc/rpm/el10/"; + $xcat_dep_path = $opts{xcat_dep_path}; + confess "Missing xcat-dep folder in $xcat_dep_path: No such file or directory" + unless -d $xcat_dep_path; + } elsif ($version =~ /^9/) { + $xcat_dep_path = "https://mirror.versatushpc.com.br/xcat/yum/xcat-dep/rh9/"; + } elsif ($version =~ /^8/) { + $xcat_dep_path = "https://mirror.versatushpc.com.br/xcat/yum/xcat-dep/rh8/"; + } else { + confess "Unexpected OS version $version"; + } + confess "xcat-dep path still undef, this is likely to be a bug" + unless defined $xcat_dep_path; + my $port = $opts{nginx_port}; my $conf = <<"EOF"; server { @@ -437,6 +496,25 @@ EOF $? >> 8; } +sub setup_local_repos { + my ($target) = @_; + $target //= $opts{targets}->[0] + or die "A target must be provided for setup_local_repos"; + my $exit = setup_repo + -id => "xcat-core-local", + -baseurl => "http://127.0.0.1:$opts{nginx_port}/$target"; + return $exit if $exit; + my %os = os_release(); + my $version = int $os{VERSION_ID}; + my $arch = `arch`; + chomp $arch; + + $exit = setup_repo + -id => "xcat-dep", + -baseurl => "http://127.0.0.1:$opts{nginx_port}/xcat-dep/el$version/$arch"; +} + + sub update_repo { my ($target) = @_; say "Creating repository dist/$target/rpms"; @@ -475,7 +553,7 @@ sub usage { sub main { return usage() if $opts{help}; return exit(configure_nginx()) if $opts{configure_nginx}; - return exit(setup_vhpc_repo()) if $opts{setup_vhpc_repo}; + return exit(setup_local_repos()) if $opts{setup_local_repos}; my @rpms = product($opts{packages}, $opts{targets}); my $pm = Parallel::ForkManager->new($opts{nproc}); @@ -501,7 +579,8 @@ sub main { $pm->wait_all_children; configure_nginx(); - + setup_local_repos(); + exit(0); } main(); diff --git a/xCAT-genesis-builder/dracut_105/el/module-setup.sh b/xCAT-genesis-builder/dracut_105/el/module-setup.sh index ddf3409a6..805d70fe2 100755 --- a/xCAT-genesis-builder/dracut_105/el/module-setup.sh +++ b/xCAT-genesis-builder/dracut_105/el/module-setup.sh @@ -622,7 +622,8 @@ install() { dracut_install /usr/share/zoneinfo/posix/Chile/Continental inst "$moddir/xcatroot" "/sbin/xcatroot" inst "$moddir/dhclient.conf" "/etc/dhclient.conf" - inst "$moddir/dhclient-script" "/sbin/dhclient-script" + # dhclient executes this helper, so it must stay executable in initramfs. + inst_script "$moddir/dhclient-script" "/sbin/dhclient-script" inst "$moddir/rsyslog.conf" "/etc/rsyslog.conf" dracut_install chronyc chronyd rpcbind systemd-tmpfiles dracut_install /etc/ssh diff --git a/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh b/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh index 15ead2175..c479f9e91 100755 --- a/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh +++ b/xCAT-genesis-builder/dracut_105/el/xcat-cmdline.sh @@ -78,7 +78,9 @@ if [[ ${ARCH} =~ ppc64 ]]; then elif [[ ${ARCH} =~ x86_64 ]]; then # load all network driver modules listed in /lib/modules//modules.dep file KERVER=`uname -r` - for line in `cat /lib/modules/$KERVER/modules.dep |grep -vE 'tunnel|ieee|ifb|bond|dummy|fjes|hv_netvsc|ntb_netdev|xen-netfront|hdlc_fr|dlci'| awk -F: '{print \$1}' | sed -e "s/\(.*\)\.ko.*/\1/"`; do + # Xen guests require xen-netfront for the paravirtual NIC. + modprobe xen-netfront 2>/dev/null || : + for line in `cat /lib/modules/$KERVER/modules.dep |grep -vE 'tunnel|ieee|ifb|bond|dummy|fjes|hv_netvsc|ntb_netdev|hdlc_fr|dlci'| awk -F: '{print \$1}' | sed -e "s/\(.*\)\.ko.*/\1/"`; do if [[ $line =~ "kernel/drivers/net" ]]; then modprobe `basename $line` fi diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 6b5120922..b3c8fb2c8 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -2014,6 +2014,9 @@ 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/; system("$cmd $_"); if ($? != 0) { my $rc = $? >> 8; diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index c0508a257..c0ac906e6 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -41,7 +41,8 @@ Requires: xCAT-server = 4:%{version}-%{release} %if %nots390x Requires: xCAT-probe = 4:%{version}-%{release} Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} -Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} +# Disabling temporary for testing in x86_64, no ppc build yet +# Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} %endif Requires: rsync From 4780ba94001087e0005e3784471ef7a7077c78aa Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Thu, 26 Feb 2026 13:54:56 -0300 Subject: [PATCH 07/21] fix: Fix genesis loop where osimage value grows at each boot Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- xCAT-server/lib/xcat/plugins/seqdiscovery.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm index a40960209..ddd0c2df2 100644 --- a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm +++ b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm @@ -379,7 +379,9 @@ sub findme { if ($nodechain !~ /osimage=/) { $nodechain = $nodechain . ",osimage=$param{'osimage'}"; } else { - $nodechain =~ s/osimage=\w+/osimage=$param{'osimage'}/; + # Replace the full osimage token up to chain separator. + # Using \w+ corrupts image names containing '.' or '-'. + $nodechain =~ s/osimage=[^,;]+/osimage=$param{'osimage'}/; } } } # end if $param{'osimage'} From fd69b14d75be54168ec3ac9b33f59987b4fd94ad Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Thu, 5 Mar 2026 08:21:21 -0300 Subject: [PATCH 08/21] fix: Generalize buildrpms to handle ppc64le and other distros* * Motivation: Before this commit we hardcoded "rhel" in the mock chroot names, but these depend running over RHEL host. After this commit the distribution name is read from /etc/os-release ID variable. So it should work on any EL clone now. Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 58 +++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/buildrpms.pl b/buildrpms.pl index 189aea57c..f33b2faa7 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -57,6 +57,30 @@ chomp($VERSION); chomp($RELEASE); chomp($GITINFO); +sub os_release { + my %os; + open my $fh, '<', '/etc/os-release' or die "Cannot open /etc/os-release: $!"; + + while (<$fh>) { + chomp; + next if /^\s*#/ || !/=/; + my ($k, $v) = split /=/, $_, 2; + $v =~ s/^["'](.*)["']$/$1/; # strip surrounding quotes + $os{$k} = $v; + } + + return %os; # usage: my %os = os_release(); +} + +sub arch { + my $arch = `uname -m`; + chomp $arch; + return $arch; +} + +my $ARCH = arch(); +my %OS = os_release(); +my $DISTRO = $OS{ID}; my @PACKAGES = qw( perl-xCAT @@ -74,10 +98,11 @@ my @PACKAGES = qw( xCAT-vlan ); -my @TARGETS = qw( - rhel+epel-8-x86_64 - rhel+epel-9-x86_64 - rhel+epel-10-x86_64); +my @TARGETS = ( + "$DISTRO+epel-8-$ARCH", + "$DISTRO+epel-9-$ARCH", + "$DISTRO+epel-10-$ARCH", +); my %opts = ( @@ -140,21 +165,6 @@ sub product { } @$a } -sub os_release { - my %os; - open my $fh, '<', '/etc/os-release' or die "Cannot open /etc/os-release: $!"; - - while (<$fh>) { - chomp; - next if /^\s*#/ || !/=/; - my ($k, $v) = split /=/, $_, 2; - $v =~ s/^["'](.*)["']$/$1/; # strip surrounding quotes - $os{$k} = $v; - } - - return %os; # usage: my %os = os_release(); -} - sub setup_repo { my (%opts) = @_; my $id = $opts{-id} or confess "-id is required"; @@ -223,9 +233,8 @@ sub buildsources_genesis_base() { my $dracutmoddir = "/usr/lib/dracut/modules.d/97xcat/"; - my $buildarch = `uname -m`; + my $buildarch = $ARCH; my $kernelversion = `uname -r`; - chomp $buildarch; chomp $kernelversion; my $genesispath = "/tmp/xcatgenesis.$$"; @@ -397,9 +406,7 @@ sub buildpkgs { my $targetarch = (split /-/, $target, 3)[2]; # get the builder arch, xCAT-genesis-base include it in its package name - my $nativearch = `uname -m`; - chomp $nativearch; - $nativearch = "ppc64" if $nativearch =~ /^ppc/; + my $nativearch = $ARCH; my $arch = is_in($pkg, @native_pkgs) ? $targetarch : "noarch"; my $diskcache = "dist/$target/rpms/$pkg-$VERSION-$RELEASE.$arch.rpm"; @@ -506,8 +513,7 @@ sub setup_local_repos { return $exit if $exit; my %os = os_release(); my $version = int $os{VERSION_ID}; - my $arch = `arch`; - chomp $arch; + my $arch = $ARCH; $exit = setup_repo -id => "xcat-dep", From 3767e0a25fcb7f7ab8926971230bc264b8c40657 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Thu, 5 Mar 2026 08:26:50 -0300 Subject: [PATCH 09/21] fix: Fix typo in xCAT-test/xcattest Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index cae71da3b..1a80e1fe0 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -53,7 +53,7 @@ my $NORUN = 0; my $RUN = 1; #----------global logs attributes--------------- -my $running_log_fd = undef +my $running_log_fd = undef; my $running_log_name = undef; my $failed_log_name = undef; my $performance_log_name = undef; From 4a1905171d0994c2a44e72aa10bcaa05139889bc Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Wed, 11 Mar 2026 09:32:35 -0300 Subject: [PATCH 10/21] fix: Fix genesis boot in ppc64le Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 58 ++++++++-- xCAT-genesis-builder/buildrpmel10 | 88 --------------- .../dracut_105/el/module-setup.sh | 7 +- .../dracut_105/el/xcat-cmdline.sh | 2 +- xCAT-genesis-builder/install | 3 + xCAT-genesis-builder/install.ubuntu | 3 + xCAT-genesis-builder/xCAT-genesis-base.spec | 2 +- xCAT-genesis-builder/xcat-cmdline.sh | 2 +- xCAT-genesis-scripts/usr/bin/doxcat | 101 +++++++++++++----- .../xCAT-genesis-scripts.spec | 2 +- xCAT/xCAT.spec | 9 +- xCATsn/xCATsn.spec | 9 +- 12 files changed, 140 insertions(+), 146 deletions(-) delete mode 100755 xCAT-genesis-builder/buildrpmel10 diff --git a/buildrpms.pl b/buildrpms.pl index f33b2faa7..0039c5f19 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -156,6 +156,22 @@ sub is_in { 0; } +sub genesis_tarch_from_targetarch { + my ($targetarch) = @_; + return 'ppc64' if $targetarch eq 'ppc64le'; + return 'x86' if $targetarch =~ /^i[3-6]86$/; + return $targetarch; +} + +sub targetarch_from_target { + my ($target) = @_; + return $ARCH unless defined $target && length $target; + my @parts = split /-/, $target; + my $arch = $parts[-1]; + $arch =~ s/^\s+|\s+$//g; + return lc $arch; +} + # product(\@A, \@B) returns the catersian product of \@A and \@B sub product { my ($a, $b) = @_; @@ -202,7 +218,9 @@ sub createmockconfig { write_text($cfgfile, $contents); } -sub buildsources_genesis_base() { +sub buildsources_genesis_base($) { + my ($target) = @_; + die "Assertion failed! No directory xCAT-genesis-builder in the current directory" unless -d "./xCAT-genesis-builder"; @@ -233,7 +251,8 @@ sub buildsources_genesis_base() { my $dracutmoddir = "/usr/lib/dracut/modules.d/97xcat/"; - my $buildarch = $ARCH; + my $targetarch = targetarch_from_target($target); + my $buildarch = genesis_tarch_from_targetarch($targetarch); my $kernelversion = `uname -r`; chomp $kernelversion; @@ -353,7 +372,18 @@ EOF } elsif ($pkg eq "xCAT-genesis-scripts") { sh qq(tar -cjf "$SOURCES/$pkg.tar.bz2" $pkg); } elsif ($pkg eq "xCAT-genesis-base") { - buildsources_genesis_base(); + buildsources_genesis_base($target); + } elsif ($pkg eq "xCATsn") { + sh(<<"EOF"); + tar -czf "$SOURCES/$pkg-$VERSION.tar.gz" $pkg + tar -czf "$SOURCES/license.tar.gz" -C $pkg LICENSE.html + tar -czf "$SOURCES/etc.tar.gz" -C xCAT etc + cp $pkg/xcat.conf $SOURCES + cp $pkg/xcat.conf.apach24 $SOURCES + cp $pkg/xCATSN $SOURCES +EOF + # xCATsn.spec consumes templates from xCAT shared templates payload. + sh qq(tar -czf "$SOURCES/templates.tar.gz" xCAT/templates) unless -f "$SOURCES/templates.tar.gz"; } else { sh qq(tar -czf "$SOURCES/$pkg-$VERSION.tar.gz" $pkg); } @@ -363,8 +393,13 @@ sub buildspkgs { my ($pkg, $target) = @_; my $chroot = "$pkg-$target"; + my $targetarch = targetarch_from_target($target); + my $genesis_tarch = genesis_tarch_from_targetarch($targetarch); - my $diskcache = "dist/$target/srpms/$pkg-$VERSION-$RELEASE.src.rpm"; + my $diskcache = ( + $pkg eq 'xCAT-genesis-scripts' || $pkg eq 'xCAT-genesis-base' + ) ? "dist/$target/srpms/$pkg-$genesis_tarch-$VERSION-$RELEASE.src.rpm" + : "dist/$target/srpms/$pkg-$VERSION-$RELEASE.src.rpm"; return if -f $diskcache and not $opts{force}; my $dir = sub { @@ -403,22 +438,25 @@ sub buildpkgs { ); # get x86_64 from rhel+epel-9-x86_64 - my $targetarch = (split /-/, $target, 3)[2]; + my $targetarch = targetarch_from_target($target); - # get the builder arch, xCAT-genesis-base include it in its package name - my $nativearch = $ARCH; + # xCAT genesis packages include the translated target arch in their file names. my $arch = is_in($pkg, @native_pkgs) ? $targetarch : "noarch"; - my $diskcache = "dist/$target/rpms/$pkg-$VERSION-$RELEASE.$arch.rpm"; + my $genesis_tarch = genesis_tarch_from_targetarch($targetarch); + my $diskcache = ( + $pkg eq 'xCAT-genesis-scripts' || $pkg eq 'xCAT-genesis-base' + ) ? "dist/$target/rpms/$pkg-$genesis_tarch-$VERSION-$RELEASE.noarch.rpm" + : "dist/$target/rpms/$pkg-$VERSION-$RELEASE.$arch.rpm"; return if -f $diskcache and not $opts{force}; my @opts; push @opts, "--quiet" unless $opts{verbose}; my $spkgname = sub { - return "${pkg}-${arch}-${VERSION}-${RELEASE}.src.rpm" + return "${pkg}-${genesis_tarch}-${VERSION}-${RELEASE}.src.rpm" if $pkg eq 'xCAT-genesis-scripts'; - return "xCAT-genesis-base-${nativearch}-${VERSION}-${RELEASE}.src.rpm" + return "xCAT-genesis-base-${genesis_tarch}-${VERSION}-${RELEASE}.src.rpm" if $pkg eq 'xCAT-genesis-base'; return "$pkg-${VERSION}-${RELEASE}.src.rpm"; diff --git a/xCAT-genesis-builder/buildrpmel10 b/xCAT-genesis-builder/buildrpmel10 deleted file mode 100755 index ec06183e8..000000000 --- a/xCAT-genesis-builder/buildrpmel10 +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# Build the xCAT-genesis-base rpm on a host system. -# Option 1: install the xCAT-genesis-builder rpm (that includes this file) on a system installed with -# the distro you want to use to build xCAT-genesis-base. -# Option 2: untar the root file system of the distro you want to use and then chroot into it and copy -# this whole dir into it somewhere (like /tmp). -# Then run this script. The optional 1st arg should be mcp if you are building against mcp. - -# Currently, *Fedora 28* and *RedHat 8* are the only OSes supported to build genesis-base for ppc64, and Centos 6.5 for x86_64 - -DIR=`dirname $0` -#DIR=`realpath $DIR` -DIR=`readlink -f $DIR` -BUILDARCH=`uname -m` -REQUIRED_PACKAGES="rpmdevtools rpm-build screen lldpad mstflint ipmitool pciutils mdadm dosfstools usbutils bind-utils psmisc nmap-ncat ethtool kexec-tools" -DISTRO=$(perl -lane 'print $1 if /^ID="?([^\"\$]+)/' < /etc/os-release) - -# Install required packages -dnf install -y epel-release -dnf -y install $REQUIRED_PACKAGES || { - echo "ERROR: Can not install required package" - exit 1 -} - -rpmdev-setuptree - -DRACUTMODDIR=/usr/lib/dracut/modules.d/97xcat -mkdir -p $DRACUTMODDIR -case "$DISTRO" in - ubuntu) - cp -a "$DIR/dracut_105/ubuntu/module-setup.sh" $DRACUTMODDIR/ - ;; - rhel) - cp -a "$DIR/dracut_105/el/module-setup.sh" $DRACUTMODDIR/ - ;; - *) - echo "Warning: Unknown distro $DISTRO, assuming RHEL clone" - cp -a "$DIR/dracut_105/el/module-setup.sh" $DRACUTMODDIR/ - ;; -esac -dracut -m "xcat base" --no-early-microcode -N -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION - -echo Expanding the initramfs into /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs ... - -mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs -cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs -zcat /tmp/xcatgenesis.$$.rfs | cpio -dumi - -# add the perl library -# add /usr/share/ntp/lib for Fedora26 ppc64, the ntp-perl will installed libraries under it -PERL_LIB_DIR="/usr/share/perl5 /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/share/ntp/lib" -for d in `echo $PERL_LIB_DIR`; do - if [ -e $d ]; then - echo Adding perl libary "$d" - TEMP_DIR=/tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/"$d" - mkdir -p $TEMP_DIR - cp -a -t $TEMP_DIR $d/. - fi -done - -# create directory for ssh-keygen -mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/etc/ssh -mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/lib/udev/rules.d/ - -# create the predictable naming for nics -LIB_UDEV_RULES="/lib/udev/rules.d/" -if [ ! -e "$LIB_UDEV_RULES/80-net-name-slot.rules" ]; then - cp $DRACUTMODDIR/80-net-name-slot.rules /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/lib/udev/rules.d/ - if [ $? -ne 0 ]; then - echo "ERROR - expanding the initramfs, please correct the issues and try again" - exit 1 - fi -fi - -# add the kernel -echo Adding kernel /boot/vmlinuz-$BUILDARCH ... -cp /boot/vmlinuz-`uname -r` /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/kernel -cd - - -# create tar file -echo Tarring /tmp/xcatgenesis.$$/opt into ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 ... -cd /tmp/xcatgenesis.$$ -tar jcf ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 opt - -# build the rpm -echo Building xCAT-genesis-base rpm from ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 and $DIR/xCAT-genesis-base.spec ... -rpmbuild -ba $DIR/xCAT-genesis-base.spec -rm -rf $DRACUTMODDIR diff --git a/xCAT-genesis-builder/dracut_105/el/module-setup.sh b/xCAT-genesis-builder/dracut_105/el/module-setup.sh index 805d70fe2..572e237ea 100755 --- a/xCAT-genesis-builder/dracut_105/el/module-setup.sh +++ b/xCAT-genesis-builder/dracut_105/el/module-setup.sh @@ -45,15 +45,18 @@ 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 dhclient lldpad + dracut_install /usr/sbin/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 efibootmgr dmidecode #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si + _dracut_install_opt efibootmgr + _dracut_install_opt dmidecode # uxspi prereqs, but optional on minimal EL10 hosts 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 c479f9e91..61147cd03 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 link show | grep -v "^ " | awk '{print $2}' | sed -e 's/:$//' | grep -v lo) + ALL_NICS=$(ip -o link show | awk -F': ' '{print $2}' | sed -e 's/@.*$//' -e 's/:$//' | grep -v '^lo$' | sort -u) 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 9d5674c6d..8239043aa 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -5,6 +5,9 @@ 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 f7363212e..e7803ba40 100755 --- a/xCAT-genesis-builder/install.ubuntu +++ b/xCAT-genesis-builder/install.ubuntu @@ -6,6 +6,9 @@ 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-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index b92568a5b..f08d38b05 100644 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -137,7 +137,7 @@ remove_directory_deep("/opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs/var/run" if [ "$1" == "2" ]; then #only on upgrade, as on install it's probably not going to work... if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image . /etc/profile.d/xcat.sh - #mknb %{tarch} + mknb %{tarch} echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb ' manually" mkdir -p /etc/xcat touch /etc/xcat/genesis-base-updated diff --git a/xCAT-genesis-builder/xcat-cmdline.sh b/xCAT-genesis-builder/xcat-cmdline.sh index 15ead2175..24ba807f4 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 link show | grep -v "^ " | awk '{print $2}' | sed -e 's/:$//' | grep -v lo) + ALL_NICS=$(ip -o link show | awk -F': ' '{print $2}' | sed -e 's/@.*$//' -e 's/:$//' | grep -v '^lo$' | sort -u) 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-scripts/usr/bin/doxcat b/xCAT-genesis-scripts/usr/bin/doxcat index 0bf5e360a..e07a6265a 100755 --- a/xCAT-genesis-scripts/usr/bin/doxcat +++ b/xCAT-genesis-scripts/usr/bin/doxcat @@ -6,6 +6,46 @@ # log_label="xcat.genesis.doxcat" +# Normalize interface names from "ip link" output by removing decorations +# like "@if3", trailing ":" and surrounding whitespace. +normalize_ifname() { + echo "$1" | sed -e 's/@.*$//' -e 's/:$//' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' +} + +# Only consider real ethernet NICs for link probing and DHCP. +# This skips virtual/tunnel interfaces that can spam netlink errors. +is_candidate_nic() { + local nic="$1" + + [ -n "$nic" ] || return 1 + [ "$nic" = "lo" ] && return 1 + case "$nic" in + usb*) return 1 ;; + esac + [ -d "/sys/class/net/$nic" ] || return 1 + [ -e "/sys/class/net/$nic/device" ] || return 1 + [ "$(cat "/sys/class/net/$nic/type" 2>/dev/null)" = "1" ] || return 1 + + return 0 +} + +list_candidate_nics() { + local only_up="$1" + local rawnic + local nic + + ip -o link show | awk -F': ' '{print $2}' | while read -r rawnic; do + nic=$(normalize_ifname "$rawnic") + if ! is_candidate_nic "$nic"; then + continue + fi + if [ "$only_up" = "up" ]; then + ip -o link show dev "$nic" 2>/dev/null | grep -q "UP" || continue + fi + echo "$nic" + done +} + # Start rsyslogd and log into a local file specified in /etc/rsyslog.conf # Later, once xCAT MN is known, dhclient-script will change # rsyslog.conf file to send log entries to xCAT MN @@ -40,11 +80,16 @@ if ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor &>/dev/null; then fi fi if [ ! -z "$BOOTIF" ]; then - BOOTIF=`echo $BOOTIF|sed -e s/01-// -e s/-/:/g` + BOOTIF=`echo "$BOOTIF"|sed -e s/01-// -e s/-/:/g` logger -s -t $log_label -p local4.info "Waiting for device with address $BOOTIF to appear.." gripeiter=6000 while [ -z "$bootnic" ]; do - bootnic=`ip link show|grep -B1 $BOOTIF|grep mtu|awk '{print $2}'|sed -e 's/:$//'` + bootnic=`ip -o link show | awk -v mac="$BOOTIF" 'tolower($0) ~ tolower(mac) {print $2; exit}'` + bootnic=`normalize_ifname "$bootnic"` + if [ ! -z "$bootnic" ] && ! ip link show dev "$bootnic" >/dev/null 2>&1; then + logger -s -t $log_label -p local4.info "Detected boot nic '$bootnic' from BOOTIF=$BOOTIF, but the interface does not exist yet. Retrying..." + bootnic="" + fi sleep 0.1 if [ $gripeiter = 0 ]; then logger -s -t $log_label -p local4.err "Unable to find boot device (Maybe the xCAT genesis kernel is missing the driver for your NIC?)" @@ -108,7 +153,7 @@ logger -s -t $log_label -p local4.info "Creating /var/lib/lldpad file..." mkdir -p /var/lib/lldpad echo 'lldp :' >> /var/lib/lldpad/lldpad.conf echo '{' >> /var/lib/lldpad/lldpad.conf -for iface in `ip link |grep -v '^ '|awk '{print $2}'|sed -e 's/:$//'|grep -v lo`; do +for iface in `ip -o link show | awk -F': ' '{print $2}' | sed -e 's/@.*$//' -e 's/:$//' | grep -v '^lo$'`; do echo "$iface :" >> /var/lib/lldpad/lldpad.conf echo "{" >> /var/lib/lldpad/lldpad.conf echo "tlvid00000006 :" >> /var/lib/lldpad/lldpad.conf @@ -205,14 +250,14 @@ if [[ -n $hostip && -n $netmask && -n $gateway && -n $bootnic ]]; then else logger -s -t $log_label -p local4.info "Setting IP via DHCP..." # This section is for System P hardware discovery, which won't have a BOOTIF value set - if [ -z "$bootnic" ]; then - tries=0 - while [ $tries -lt 100 ]; do - ALLUP_NICS=`ip link show | grep -v "^ " | grep "state UP" | awk '{print $2}' | sed -e 's/:$//'|grep -v lo | sort -n -r` - for tmp1 in $ALLUP_NICS; do - dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$tmp1.pid $tmp1 & - dhclient -6 -pf /var/run/dhclient6.$tmp1.pid $tmp1 -lf /var/lib/dhclient/dhclient6.leases & - #bootnic=$tmp1 + if [ -z "$bootnic" ]; then + tries=0 + while [ $tries -lt 100 ]; do + ALLUP_NICS=`list_candidate_nics up | sort -r` + for tmp1 in $ALLUP_NICS; do + dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$tmp1.pid $tmp1 & + dhclient -6 -pf /var/run/dhclient6.$tmp1.pid $tmp1 -lf /var/lib/dhclient/dhclient6.leases & + #bootnic=$tmp1 #break done if [ ! -z "$ALLUP_NICS" ]; then @@ -247,25 +292,25 @@ else /bin/bash fi else - dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$bootnic.pid $bootnic & - #we'll kick of IPv6 and IPv4 on all nics, but not wait for them to come up unless doing discovery, to reduce - #chances that we'll perform a partial discovery - #in other scenarios where downed non-bootnics cause issues, will rely on retries to fix things up - dhclient -6 -pf /var/run/dhclient6.$bootnic.pid $bootnic -lf /var/lib/dhclient/dhclient6.leases & - NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v $bootnic|grep -v usb|grep -v ,UP|awk -F: '{print $2}'` - export NICSTOBRINGUP - for nic in $NICSTOBRINGUP; do - (while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid $nic ) & - (while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -6 -pf /var/run/dhclient6.$nic.pid -lf /var/lib/dhclient/dhclient6.leases $nic ) & - done + dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$bootnic.pid "$bootnic" & + #we'll kick of IPv6 and IPv4 on all nics, but not wait for them to come up unless doing discovery, to reduce + #chances that we'll perform a partial discovery + #in other scenarios where downed non-bootnics cause issues, will rely on retries to fix things up + dhclient -6 -pf /var/run/dhclient6.$bootnic.pid "$bootnic" -lf /var/lib/dhclient/dhclient6.leases & + NICSTOBRINGUP=`list_candidate_nics | awk -v bootnic="$bootnic" '$0 != bootnic'` + export NICSTOBRINGUP + for nic in $NICSTOBRINGUP; do + (while ! ethtool "$nic" | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid "$nic" ) & + (while ! ethtool "$nic" | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -6 -pf /var/run/dhclient6.$nic.pid -lf /var/lib/dhclient/dhclient6.leases "$nic" ) & + done gripeiter=101 logger -s -t $log_label -p local4.info "Acquiring network addresses.." - while ! ip -4 -o a show dev $bootnic|grep -v 'scope link'|grep -q inet; do - sleep 0.1 - if [ $gripeiter = 1 ]; then - logger -s -t $log_label -p local4.info "It seems to be taking a while to acquire an IPv4 address, you may want to check spanning tree..." - fi + while ! ip -4 -o a show dev "$bootnic"|grep -v 'scope link'|grep -q inet; do + sleep 0.1 + if [ $gripeiter = 1 ]; then + logger -s -t $log_label -p local4.info "It seems to be taking a while to acquire an IPv4 address, you may want to check spanning tree..." + fi gripeiter=$((gripeiter-1)) done fi @@ -275,7 +320,7 @@ openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" -ip -4 -o a show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|awk '{print $4}' +ip -4 -o a show dev "$bootnic"|grep -v 'scope link'|grep -v 'dynamic'|awk '{print $4}' if [ -e /usr/sbin/ntpd ]; then logger -s -t $log_label -p local4.info "Starting ntpd..." diff --git a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec index a0384f6f2..ce89077a5 100644 --- a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec +++ b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec @@ -4,7 +4,7 @@ %ifarch x86_64 %define tarch x86_64 %endif -%ifarch ppc ppc64 +%ifarch ppc ppc64 ppc64le %define tarch ppc64 %endif %ifarch aarch64 diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index c0ac906e6..148300a77 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -74,7 +74,7 @@ Requires: elilo-xcat xnba-undi %endif %ifarch i386 i586 i686 x86 x86_64 -Requires: syslinux +Requires: syslinux-xcat Requires: ipmitool-xcat >= 1.8.17-1 %endif @@ -84,13 +84,6 @@ Requires: ipmitool-xcat >= 1.8.17-1 %endif %endif -%if %notpcm -# PCM does not need or ship syslinux-xcat -%if %nots390x -Requires: syslinux-xcat -%endif -%endif - %description xCAT is a server management package intended for at-scale management, including hardware management and software management. diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index a99a0fd13..997e92fed 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -14,6 +14,7 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root Source1: xcat.conf Source2: license.tar.gz Source3: xCATSN +Source4: etc.tar.gz Source5: templates.tar.gz Source6: xcat.conf.apach24 Requires: perl-DBD-SQLite @@ -56,7 +57,7 @@ Requires: elilo-xcat xnba-undi %endif %ifarch i386 i586 i686 x86 x86_64 -Requires: syslinux +Requires: syslinux-xcat Requires: ipmitool-xcat >= 1.8.17-1 %endif %ifos linux @@ -65,11 +66,6 @@ Requires: ipmitool-xcat >= 1.8.17-1 %endif %endif -%if %notpcm -# PCM does not need or ship syslinux-xcat -Requires: syslinux-xcat -%endif - %description xCAT supports management of very large sized cluster by creating a Hierarchical Cluster and the concept of xCAT Service Nodes. The xCAT Management Node can @@ -79,6 +75,7 @@ set of compute node. xCATsn package provides xCAT service node support. %prep %ifos linux tar zxf %{SOURCE2} +tar zxf %{SOURCE4} %else cp %{SOURCE2} /opt/freeware/src/packages/BUILD gunzip -f license.tar.gz From d309601a30e8cf0703cb41a9ea9b52ee62baf9b2 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Thu, 12 Mar 2026 11:27:37 -0300 Subject: [PATCH 11/21] fix: Fix templates for EL10 in ppc64le enviroment Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- .../rh/compute.rhels10.ppc64le.pkglist | 31 +++++++++++++++++++ .../rocky/compute.rocky10.ppc64le.exlist | 1 + .../rocky/compute.rocky10.ppc64le.pkglist | 1 + .../rocky/compute.rocky10.ppc64le.postinstall | 1 + .../rocky/service.rocky10.ppc64le.exlist | 1 + .../service.rocky10.ppc64le.otherpkgs.pkglist | 1 + .../rocky/service.rocky10.ppc64le.pkglist | 1 + .../rocky/service.rocky10.ppc64le.postinstall | 1 + 8 files changed, 38 insertions(+) create mode 100644 xCAT-server/share/xcat/netboot/rh/compute.rhels10.ppc64le.pkglist create mode 120000 xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.exlist create mode 120000 xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.pkglist create mode 120000 xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.postinstall create mode 120000 xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.exlist create mode 120000 xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.otherpkgs.pkglist create mode 120000 xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.pkglist create mode 120000 xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.postinstall diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels10.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels10.ppc64le.pkglist new file mode 100644 index 000000000..23895e5ff --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels10.ppc64le.pkglist @@ -0,0 +1,31 @@ +@minimal-environment +initscripts +chrony +kernel +net-tools +nfs-utils +openssh-server +rsync +tar +util-linux +wget +python3 +tar +bzip2 +bc +dracut +dracut-network +rsyslog +hostname +e2fsprogs +ethtool +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils +perl-interpreter + diff --git a/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.exlist b/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.exlist new file mode 120000 index 000000000..47be8bdca --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.exlist @@ -0,0 +1 @@ +../rh/compute.rhels9.ppc64le.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.pkglist new file mode 120000 index 000000000..d3291af62 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels10.ppc64le.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.postinstall b/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.postinstall new file mode 120000 index 000000000..1299428cb --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.ppc64le.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels9.ppc64le.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.exlist b/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.exlist new file mode 120000 index 000000000..e19a10166 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.exlist @@ -0,0 +1 @@ +../rh/service.rhels9.ppc64le.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.otherpkgs.pkglist new file mode 120000 index 000000000..6ec6a8d03 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels9.ppc64le.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.pkglist new file mode 120000 index 000000000..34e3c5f0e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.pkglist @@ -0,0 +1 @@ +../rh/service.rhels9.ppc64le.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.postinstall b/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.postinstall new file mode 120000 index 000000000..307b14b08 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/service.rocky10.ppc64le.postinstall @@ -0,0 +1 @@ +../rh/service.rhels9.ppc64le.postinstall \ No newline at end of file From 90a84dc37573b66170bec0f3301d6b66e2eff0ca Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:20:10 -0300 Subject: [PATCH 12/21] fix: Replace yaboot with grub2 for PPC nodediscovery Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 9 ++------- xCAT-server/lib/xcat/plugins/dhcp.pm | 4 ++-- xCAT-server/lib/xcat/plugins/nodediscover.pm | 4 ++-- xCAT-server/lib/xcat/plugins/setup.pm | 8 ++++---- xCAT-server/xCAT-wsapi/restapi.pl | 9 ++++----- xCAT-server/xCAT-wsapi/xcatws-test.sh | 3 +-- xCAT-server/xCAT-wsapi/xcatws.cgi | 9 ++++----- 7 files changed, 19 insertions(+), 27 deletions(-) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index b901d2413..b0ee5935a 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1497,20 +1497,15 @@ sub get_netboot_attr { # It's sequence sensitive: os arch -> os name -> os major version -> hardware profile # Priority | Arch | OS Name | OS Major Version | Management method | Noderes.netboot | # 1 | x86_64/x86 | * | * | * | xnba | - # 2 | ppc64 | rhels | 7 | * | grub2 | # 2 | ppc64 | pkvm | * | * | petitboot | - # 3 | | * | * | * | yaboot | + # 3 | ppc64 | * | * | * | grub2 | # 4 | ppc64le/el | * | * | * | grub2 # 4 | ppc64le/el | * | * | ipmi | petitboot # arch osname version hardware netboot my %netboot_dict = ('x86_64' => 'xnba', 'ppc64' => { - 'rhels' => { - '7' => 'grub2', - '*' => 'yaboot', - }, 'pkvm' => 'petitboot', - '*' => 'yaboot', + '*' => 'grub2', }, 'ppc64le' => { '*' => { diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 05dd98d9e..2e0f3a04a 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2750,8 +2750,8 @@ sub addnet " } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n"; push @netent, " option www-server = \"http://$tftp:$httpport/install/onie/onie-installer\";\n"; push @netent, - " } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n "; - push @netent, " filename \"/yaboot\";\n"; + " } else if substring(filename,0,1) = null { #otherwise, provide grub2 for PPC firmware that omits a client architecture\n "; + push @netent, " filename \"/boot/grub2/grub2.ppc\";\n"; push @netent, " }\n"; if ($range) { diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index d7f4fef1e..3489aef02 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -234,8 +234,8 @@ sub process_request { $nrtab->setNodeAttribs($node, { netboot => 'xnba' }); } elsif ($request->{arch}->[0] =~ /ppc/ and $request->{platform}->[0] =~ /PowerNV/) { $nrtab->setNodeAttribs($node, { netboot => 'petitboot' }); - } elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /yaboot/) { - $nrtab->setNodeAttribs($node, { netboot => 'yaboot' }); + } elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /^grub2(?:[-].*)?$/) { + $nrtab->setNodeAttribs($node, { netboot => 'grub2' }); } elsif($request->{arch}->[0] =~ /armv7l/ and $currboot !~ /onie/) { #for onie switch, the netboot should be "onie" $nrtab->setNodeAttribs($node, { netboot => 'onie' }); diff --git a/xCAT-server/lib/xcat/plugins/setup.pm b/xCAT-server/lib/xcat/plugins/setup.pm index 5ebe50cd9..b57c9292c 100644 --- a/xCAT-server/lib/xcat/plugins/setup.pm +++ b/xCAT-server/lib/xcat/plugins/setup.pm @@ -1172,7 +1172,7 @@ sub writelpar { # Set some attrs common to all lpars $tables{'nodetype'}->setNodeAttribs('lpar', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('lpar', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('lpar', { netboot => 'yaboot' }); + $tables{'noderes'}->setNodeAttribs('lpar', { netboot => 'grub2' }); # Write regexs for some of the ppc attrs # Note: we assume here that if they used f1c1p1 for nodes they should use f1c1 for cecs @@ -1468,7 +1468,7 @@ sub writesn { $tables{'ppc'}->setNodeAttribs('service', { id => '1', nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('service', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('service', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('service', { netboot => 'yaboot' }); + $tables{'noderes'}->setNodeAttribs('service', { netboot => 'grub2' }); $tables{'servicenode'}->setNodeAttribs('service', { nameserver => 1, dhcpserver => 1, tftpserver => 1, nfsserver => 1, conserver => 1, monserver => 1, ftpserver => 1, nimserver => 1, ipforward => defined($STANZAS{'xcat-service-nodes'}->{'route-masks'}) }); if ($STANZAS{'ll-config'}->{'central_manager_list'}) { # write the LL postscript for service nodes addPostscript('service', 'llserver.sh') @@ -1621,7 +1621,7 @@ sub writestorage { $tables{'ppc'}->setNodeAttribs('storage', { id => '1', nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('storage', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('storage', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('storage', { netboot => 'yaboot' }); + $tables{'noderes'}->setNodeAttribs('storage', { netboot => 'grub2' }); # Figure out what cec each storage node is in and write ppc.hcp, ppc.parent, noderes.xcatmaster, noderes.servicenode # Math for SN in BB: cecnum = ( ( (snnum-1) / snsperbb) * cecsperbb) + cecstart-1 + snpositioninbb @@ -1789,7 +1789,7 @@ sub writecompute { $tables{'ppc'}->setNodeAttribs('compute', { nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('compute', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('compute', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('compute', { netboot => 'yaboot' }); + $tables{'noderes'}->setNodeAttribs('compute', { netboot => 'grub2' }); if ($STANZAS{'ll-config'}->{'central_manager_list'}) { # write the LL postscript for compute nodes addPostscript('compute', 'llcompute.sh'); } diff --git a/xCAT-server/xCAT-wsapi/restapi.pl b/xCAT-server/xCAT-wsapi/restapi.pl index a4427e8d0..c8f87526f 100755 --- a/xCAT-server/xCAT-wsapi/restapi.pl +++ b/xCAT-server/xCAT-wsapi/restapi.pl @@ -81,7 +81,7 @@ my %URIdef = ( PUT => { desc => "Change the attibutes for the node {nodename}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/nodes/node1 {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -89,7 +89,7 @@ my %URIdef = ( POST => { desc => "Create the node {nodename}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Create a node with attributes groups=all, mgt=dfm and netboot=yaboot|POST|/nodes/node1 {\"groups\":\"all\",\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Create a node with attributes groups=all, mgt=hmc and netboot=grub2|POST|/nodes/node1 {\"groups\":\"all\",\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "mkdef", fhandler => \&defhdl, outhdler => \&noout, @@ -571,7 +571,7 @@ my %URIdef = ( PUT => { desc => "Change the attibutes for the group {groupname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/groups/all {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -583,7 +583,7 @@ my %URIdef = ( GET => { desc => "Get the specific attributes for the group {groupname}.", usage => "||$usagemsg{objreturn}|", - example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"yaboot\",\n \"mgt\":\"dfm\"\n }\n}|", + example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"grub2\",\n \"mgt\":\"hmc\"\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, @@ -2745,4 +2745,3 @@ sub pushFlags { } } - diff --git a/xCAT-server/xCAT-wsapi/xcatws-test.sh b/xCAT-server/xCAT-wsapi/xcatws-test.sh index 47d070218..267820393 100755 --- a/xCAT-server/xCAT-wsapi/xcatws-test.sh +++ b/xCAT-server/xCAT-wsapi/xcatws-test.sh @@ -158,7 +158,7 @@ RESTMSG="Display the node restapinode1" REST GET "/nodes/restapinode1" RESTMSG="Change the attributes for node restapinode1" -REST PUT "/nodes/restapinode1" '{"mgt":"fsp","netboot":"yaboot"}' +REST PUT "/nodes/restapinode1" '{"mgt":"hmc","netboot":"grub2"}' RESTMSG="Display the node restapinode1" REST GET "/nodes/restapinode1" @@ -194,4 +194,3 @@ REST GET "/groups/restapi" RESTMSG="Display the nodes in group restapi" REST GET "/nodes/restapi" - diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 59d8d16ce..c61a20b71 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -83,7 +83,7 @@ my %URIdef = ( PUT => { desc => "Change the attributes for the node {noderange}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/nodes/node1 {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -91,7 +91,7 @@ my %URIdef = ( POST => { desc => "Create the node {noderange}.", usage => "|$usagemsg{objchparam} DataBody: {options:{opt1:v1,opt2:v2},attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Create a node with attributes groups=all, mgt=dfm and netboot=yaboot|POST|/nodes/node1 {\"options\":{\"--template\":\"x86_64kvmguest-template\"}, \"groups\":\"all\",\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Create a node with attributes groups=all, mgt=hmc and netboot=grub2|POST|/nodes/node1 {\"options\":{\"--template\":\"x86_64kvmguest-template\"}, \"groups\":\"all\",\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "mkdef", fhandler => \&defhdl, outhdler => \&noout, @@ -657,7 +657,7 @@ my %URIdef = ( PUT => { desc => "Change the attributes for the group {groupname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/groups/all {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -669,7 +669,7 @@ my %URIdef = ( GET => { desc => "Get the specific attributes for the group {groupname}.", usage => "||$usagemsg{objreturn}|", - example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"yaboot\",\n \"mgt\":\"dfm\"\n }\n}|", + example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"grub2\",\n \"mgt\":\"hmc\"\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, @@ -3589,4 +3589,3 @@ sub pushFlags { } } - From ee87e900995e3181cfdeb7cb6dfcba569a799987 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:21:09 -0300 Subject: [PATCH 13/21] build: Add local repo mode for buildrpms.pl Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 198 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 162 insertions(+), 36 deletions(-) diff --git a/buildrpms.pl b/buildrpms.pl index 0039c5f19..cad4c670d 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -43,6 +43,7 @@ use File::Slurper qw(read_text write_text); use FindBin qw($Bin); use Getopt::Long qw(GetOptions); use Parallel::ForkManager; +use Pod::Usage qw(pod2usage); use autodie; use autodie qw(cp); @@ -112,6 +113,7 @@ my %opts = ( nginx_port => 8080, nproc => int(`nproc --all`), packages => \@PACKAGES, + repo_mode => "file", targets => \@TARGETS, verbose => 0, xcat_dep_path => "$PWD/../xcat-dep/", @@ -124,12 +126,25 @@ GetOptions( "nginx_port" => \$opts{nginx_port}, "nproc=i" => \$opts{nproc}, "package=s@" => \$opts{packages}, + "repo-mode=s" => \$opts{repo_mode}, "target=s@" => \$opts{targets}, "verbose" => \$opts{verbose}, "xcat_dep_path=s" => \$opts{xcat_dep_path}, "setup_local_repos" => \$opts{setup_local_repos}, ) or usage(); +sub usage { + my (%args) = @_; + my $verbose = $args{verbose} // 1; + my $exitval = $args{exitval} // 2; + my $message = $args{message}; + pod2usage( + -verbose => $verbose, + -exitval => $exitval, + (defined($message) && length($message) ? (-message => "$message\n") : ()), + ); +} + sub sh { my ($cmd) = @_; say "Running: $cmd" @@ -541,21 +556,49 @@ EOF $? >> 8; } +sub repo_mode { + my $mode = lc($opts{repo_mode} // "file"); + return $mode; +} + +sub xcat_dep_file_repo_baseurl { + my ($version, $arch) = @_; + my $xcat_dep_path = $opts{xcat_dep_path}; + confess "Missing xcat-dep path: --xcat_dep_path is empty" + unless defined $xcat_dep_path && length $xcat_dep_path; + $xcat_dep_path =~ s{/+$}{}; + my $repo_path = "$xcat_dep_path/el$version/$arch"; + confess "Missing xcat-dep repository path in $repo_path: No such directory" + unless -d $repo_path; + return "file://$repo_path"; +} + sub setup_local_repos { my ($target) = @_; $target //= $opts{targets}->[0] or die "A target must be provided for setup_local_repos"; + my $mode = repo_mode(); + my $core_baseurl = ( + $mode eq "file" + ? "file://$PWD/dist/$target/rpms" + : "http://127.0.0.1:$opts{nginx_port}/$target" + ); my $exit = setup_repo -id => "xcat-core-local", - -baseurl => "http://127.0.0.1:$opts{nginx_port}/$target"; + -baseurl => $core_baseurl; return $exit if $exit; my %os = os_release(); my $version = int $os{VERSION_ID}; my $arch = $ARCH; + my $xcat_dep_baseurl = ( + $mode eq "file" + ? xcat_dep_file_repo_baseurl($version, $arch) + : "http://127.0.0.1:$opts{nginx_port}/xcat-dep/el$version/$arch" + ); $exit = setup_repo -id => "xcat-dep", - -baseurl => "http://127.0.0.1:$opts{nginx_port}/xcat-dep/el$version/$arch"; + -baseurl => $xcat_dep_baseurl; } @@ -567,35 +610,12 @@ sub update_repo { } -sub usage { - my ($errmsg) = @_; - say STDERR "Usage: $0 [--package=] [--target=] [--package=] [--target=] ..."; - say STDERR ""; - say STDERR " RPM builder script"; - say STDERR " .. build xCAT RPMs for these targets:"; - say STDERR map { " $_\n" } @TARGETS; - say STDERR ""; - say STDERR " Options:"; - say STDERR ""; - say STDERR " --target .................. build only these targets"; - say STDERR " --package ................. build only these packages"; - say STDERR " --force ......................... override built RPMS"; - say STDERR " --configure_nginx ............... update nginx configuration"; - say STDERR " --nginx_port=8080 ............... change the nginx port in"; - say STDERR " (use with --configure_nginx)"; - say STDERR " --nproc ..................... run up to N jobs in parallel"; - say STDERR " --xcat_dep_path=../xcat-dep ..... path to xcat-dep repositories"; - say STDERR ""; - say STDERR " If no --target or --package is given all combinations are built"; - say STDERR ""; - say STDERR " See test/README.md for more information"; - - say STDERR $errmsg if $errmsg; - exit -1; -} - sub main { - return usage() if $opts{help}; + usage(verbose => 2, exitval => 0) if $opts{help}; + my $mode = repo_mode(); + return usage(message => "Invalid --repo-mode '$opts{repo_mode}'. Allowed values: file, http") + unless $mode eq "file" || $mode eq "http"; + return exit(configure_nginx()) if $opts{configure_nginx}; return exit(setup_local_repos()) if $opts{setup_local_repos}; @@ -622,8 +642,8 @@ sub main { } $pm->wait_all_children; - configure_nginx(); - setup_local_repos(); + # Default run builds artifacts only. + # Repo setup/nginx configuration are explicit actions. exit(0); } @@ -631,15 +651,121 @@ main(); __END__; +=head1 NAME + +buildrpms.pl - Build xCAT RPM packages with mock + =head1 SYNOPSIS -Build all xCAT RPM packages in parallel using mock for isolation + perl buildrpms.pl [options] + +=head1 DESCRIPTION + +Build xCAT packages (SRPM and RPM) for one or more targets using mock. +By default, this script only performs package builds and repository metadata +updates under C. It does not configure nginx or yum repositories unless +explicitly requested. + +=head1 OPTIONS + +=over 4 + +=item B<--help> + +Show usage text and exit. + +=item B<--install_deps> + +Install host build dependencies, mock, nginx, and supporting tools. +This option is handled before normal option parsing. + +=item B<--target>=I + +Build for the specified target. Repeatable. Example: +C. + +=item B<--package>=I + +Build only selected package(s). Repeatable. + +=item B<--nproc>=I + +Number of parallel workers used by C. +Default: all host CPUs. + +=item B<--force> + +Rebuild artifacts even if output files already exist. + +=item B<--verbose> + +Print executed shell commands. + +=item B<--xcat_dep_path>=I + +Path to the local C tree. Default: C<../xcat-dep/>. +Used by nginx configuration and file-based repo setup. + +=item B<--repo-mode>=I + +Repository mode used by C<--setup_local_repos>. Default: C. + +C: +configure C and C using C URLs. +No nginx configuration is required. + +C: +configure local repos as Cnginx_portE/...>. +Use C<--configure_nginx> to generate and apply nginx configuration first. + +=item B<--configure_nginx> + +Generate C and restart nginx. +This is an explicit action and does not run during the default build flow. + +=item B<--nginx_port>=I + +nginx listen port used by C<--configure_nginx> and C<--repo-mode=http>. +Default: C<8080>. + +=item B<--setup_local_repos> + +Write C and +C for the selected mode. +This is an explicit action and does not run during the default build flow. + +=back + +=head1 DEFAULT FLOW + +When no explicit repo/nginx options are passed, the script: + +=over 4 + +=item 1. + +Builds all selected package/target combinations. + +=item 2. + +Runs C for each selected target under C. + +=item 3. + +Exits without modifying nginx or yum repo files. + +=back =head1 KNOWN ERRORS =over 4 - 1. Error : GPG error during mock cache creation/update - Cause : Out-dated distribution-gpg-keys in host machine - Solution : Run `dnf update -y distribution-gpg-keys` in the host. +=item 1. + +Error: GPG error during mock cache creation/update. + +Cause: out-dated C on the host machine. + +Solution: run C on the host. + =back From d7e8ec96075a85597d67b8caf665c1fe2343d6f9 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:22:37 -0300 Subject: [PATCH 14/21] fix: Pull xCAT-genesis-scripts based on the arch Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- xCAT/xCAT.spec | 21 +++++++++++++++++---- xCATsn/xCATsn.spec | 17 +++++++++++++++-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 148300a77..676334b0e 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -35,14 +35,26 @@ Requires: xCAT-server = 4:%{version}-%{release} %define s390x %(if [ "$s390x" = "1" ];then echo 1; else echo 0; fi) %define nots390x %(if [ "$s390x" = "1" ];then echo 0; else echo 1; fi) +# Match xCAT-genesis-scripts package naming by build architecture. +%ifarch i386 i586 i686 x86 +%define genesistarch x86 +%endif +%ifarch x86_64 +%define genesistarch x86_64 +%endif +%ifarch ppc ppc64 ppc64le +%define genesistarch ppc64 +%endif +%ifarch aarch64 +%define genesistarch aarch64 +%endif + # Define a different location for various httpd configs in s390x mode %define httpconfigdir %(if [ "$s390x" = "1" ];then echo "xcathttpdsave"; else echo "xcat"; fi) %if %nots390x Requires: xCAT-probe = 4:%{version}-%{release} -Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} -# Disabling temporary for testing in x86_64, no ppc build yet -# Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} +Requires: xCAT-genesis-scripts-%{genesistarch} = 1:%{version}-%{release} %endif Requires: rsync @@ -70,10 +82,11 @@ Requires: goconserver >= 0.3.3 #support mixed cluster %if %nots390x -Requires: elilo-xcat xnba-undi +Requires: elilo-xcat %endif %ifarch i386 i586 i686 x86 x86_64 +Requires: xnba-undi Requires: syslinux-xcat Requires: ipmitool-xcat >= 1.8.17-1 %endif diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index 997e92fed..493d8325b 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -21,8 +21,20 @@ Requires: perl-DBD-SQLite Requires: xCAT-client = 4:%{version}-%{release} Requires: xCAT-server = 4:%{version}-%{release} Requires: xCAT-probe = 4:%{version}-%{release} + +# Match xCAT-genesis-scripts package naming by build architecture. +%ifarch i386 i586 i686 x86 +Requires: xCAT-genesis-scripts-x86 = 1:%{version}-%{release} +%endif +%ifarch x86_64 Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} -Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} +%endif +%ifarch ppc ppc64 ppc64le +Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} +%endif +%ifarch aarch64 +Requires: xCAT-genesis-scripts-aarch64 = 1:%{version}-%{release} +%endif Conflicts: xCAT @@ -53,10 +65,11 @@ Requires: goconserver >= 0.3.3 #support mixed cluster %ifnarch s390x -Requires: elilo-xcat xnba-undi +Requires: elilo-xcat %endif %ifarch i386 i586 i686 x86 x86_64 +Requires: xnba-undi Requires: syslinux-xcat Requires: ipmitool-xcat >= 1.8.17-1 %endif From 42d23c7d92501f8ad29ff62fbc6c521bd7fe62d7 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:26:46 -0300 Subject: [PATCH 15/21] fix: Fix regresion in makedns in update mode Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- xCAT-server/lib/xcat/plugins/ddns.pm | 61 +++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index fb0b79830..f5f0ce5d1 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -25,6 +25,39 @@ my $service = "named"; my $ddns_key_path = "/etc/xcat/ddns.key"; +# Net::DNS >= 1.36 removed support for sign_tsig($keyname, $secret) and now +# expects a keyfile. Keep the keyfile in sync with the xcat_key secret. +sub ensure_ddns_key_file { + my ($ctx) = @_; + + return unless (Net::DNS->VERSION >= 1.36); + return unless ($ctx && $ctx->{privkey}); + + my $algorithm = $ctx->{tsig_algorithm} || "hmac-sha256"; + my $contents = + "key \"xcat_key\" {\n" + . "\talgorithm $algorithm;\n" + . "\tsecret \"" . $ctx->{privkey} . "\";\n" + . "};\n\n"; + + if (open(my $existing_fh, "<", $ddns_key_path)) { + local $/; + my $existing = <$existing_fh>; + close($existing_fh); + return if defined($existing) && $existing eq $contents; + } + + my $fh; + unless (open($fh, ">", $ddns_key_path)) { + my $rsp = {}; + $rsp->{data}->[0] = "Cannot open $ddns_key_path: $!"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return; + } + print $fh $contents; + close($fh); +} + # is this ubuntu ? if ($distro =~ /ubuntu.*/i || $distro =~ /debian.*/i) { $service = "bind9"; @@ -1196,7 +1229,7 @@ sub update_namedconf { $i++; $line = $currnamed[$i]; push @candidate, $line; - if ($line =~ /key xcat_key/) { + if ($line =~ /key\s+\"?xcat_key\"?\b/) { $needreplace = 0; } } while ($line !~ /^\};/); #skip the old file zone @@ -1241,8 +1274,9 @@ sub update_namedconf { } while ($line !~ /^\};/); } - } elsif ($line =~ /^key xcat_key/) { + } elsif ($line =~ /^key\s+\"?xcat_key\"?\b/) { $gotkey = 1; + my $algorithmnow; if ($ctx->{privkey}) { #for now, assume the field is correct @@ -1251,20 +1285,29 @@ sub update_namedconf { do { $i++; $line = $currnamed[$i]; + if ($line =~ /^\s*algorithm\s+([^;\s]+)\s*;/) { + $algorithmnow = $1; + } push @newnamed, $line; } while ($line !~ /^\};/); } else { push @newnamed, $line; while ($line !~ /^\};/) { #skip the old file zone - if ($line =~ /secret \"([^"]*)\"/) { + if ($line =~ /^\s*algorithm\s+([^;\s]+)\s*;/) { + $algorithmnow = $1; + } elsif ($line =~ /secret \"([^"]*)\"/) { my $passtab = xCAT::Table->new("passwd", -create => 1); $passtab->setAttribs({ key => "omapi", username => "xcat_key" }, { password => $1 }); + $ctx->{privkey} = $1; } $i++; $line = $currnamed[$i]; push @newnamed, $line; } } + if ($algorithmnow) { + $ctx->{tsig_algorithm} = $algorithmnow; + } } elsif ($line !~ /generated by xCAT/) { push @newnamed, $line; } @@ -1363,15 +1406,13 @@ sub update_namedconf { $ctx->{privkey} = encode_base64(genpassword(32)); chomp($ctx->{privkey}); } - my $contents = "key \"xcat_key\" {\n". "\talgorithm hmac-sha256;\n". "\tsecret \"" . $ctx->{privkey} . "\";\n". "};\n\n"; - - if (Net::DNS->VERSION >= 1.36) { - open(my $fh, '>', $ddns_key_path) or die "Cannot open $ddns_key_path"; - print $fh $contents; - close $fh; - } + $ctx->{tsig_algorithm} ||= "hmac-sha256"; + my $contents = "key \"xcat_key\" {\n" . "\talgorithm " . $ctx->{tsig_algorithm} . ";\n" . "\tsecret \"" . $ctx->{privkey} . "\";\n" . "};\n\n"; push @newnamed, $contents; + ensure_ddns_key_file($ctx); $ctx->{restartneeded} = 1; + } else { + ensure_ddns_key_file($ctx); } } From 3569fbe77ee648d401eb508ed77c898b65198c68 Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Fri, 27 Mar 2026 11:14:47 -0300 Subject: [PATCH 16/21] Revert "fix: Replace yaboot with grub2 for PPC nodediscovery" This reverts commit 90a84dc37573b66170bec0f3301d6b66e2eff0ca. Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 9 +++++++-- xCAT-server/lib/xcat/plugins/dhcp.pm | 4 ++-- xCAT-server/lib/xcat/plugins/nodediscover.pm | 4 ++-- xCAT-server/lib/xcat/plugins/setup.pm | 8 ++++---- xCAT-server/xCAT-wsapi/restapi.pl | 9 +++++---- xCAT-server/xCAT-wsapi/xcatws-test.sh | 3 ++- xCAT-server/xCAT-wsapi/xcatws.cgi | 9 +++++---- 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index b0ee5935a..b901d2413 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1497,15 +1497,20 @@ sub get_netboot_attr { # It's sequence sensitive: os arch -> os name -> os major version -> hardware profile # Priority | Arch | OS Name | OS Major Version | Management method | Noderes.netboot | # 1 | x86_64/x86 | * | * | * | xnba | + # 2 | ppc64 | rhels | 7 | * | grub2 | # 2 | ppc64 | pkvm | * | * | petitboot | - # 3 | ppc64 | * | * | * | grub2 | + # 3 | | * | * | * | yaboot | # 4 | ppc64le/el | * | * | * | grub2 # 4 | ppc64le/el | * | * | ipmi | petitboot # arch osname version hardware netboot my %netboot_dict = ('x86_64' => 'xnba', 'ppc64' => { + 'rhels' => { + '7' => 'grub2', + '*' => 'yaboot', + }, 'pkvm' => 'petitboot', - '*' => 'grub2', + '*' => 'yaboot', }, 'ppc64le' => { '*' => { diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 2e0f3a04a..05dd98d9e 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2750,8 +2750,8 @@ sub addnet " } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n"; push @netent, " option www-server = \"http://$tftp:$httpport/install/onie/onie-installer\";\n"; push @netent, - " } else if substring(filename,0,1) = null { #otherwise, provide grub2 for PPC firmware that omits a client architecture\n "; - push @netent, " filename \"/boot/grub2/grub2.ppc\";\n"; + " } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n "; + push @netent, " filename \"/yaboot\";\n"; push @netent, " }\n"; if ($range) { diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index 3489aef02..d7f4fef1e 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -234,8 +234,8 @@ sub process_request { $nrtab->setNodeAttribs($node, { netboot => 'xnba' }); } elsif ($request->{arch}->[0] =~ /ppc/ and $request->{platform}->[0] =~ /PowerNV/) { $nrtab->setNodeAttribs($node, { netboot => 'petitboot' }); - } elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /^grub2(?:[-].*)?$/) { - $nrtab->setNodeAttribs($node, { netboot => 'grub2' }); + } elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /yaboot/) { + $nrtab->setNodeAttribs($node, { netboot => 'yaboot' }); } elsif($request->{arch}->[0] =~ /armv7l/ and $currboot !~ /onie/) { #for onie switch, the netboot should be "onie" $nrtab->setNodeAttribs($node, { netboot => 'onie' }); diff --git a/xCAT-server/lib/xcat/plugins/setup.pm b/xCAT-server/lib/xcat/plugins/setup.pm index b57c9292c..5ebe50cd9 100644 --- a/xCAT-server/lib/xcat/plugins/setup.pm +++ b/xCAT-server/lib/xcat/plugins/setup.pm @@ -1172,7 +1172,7 @@ sub writelpar { # Set some attrs common to all lpars $tables{'nodetype'}->setNodeAttribs('lpar', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('lpar', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('lpar', { netboot => 'grub2' }); + $tables{'noderes'}->setNodeAttribs('lpar', { netboot => 'yaboot' }); # Write regexs for some of the ppc attrs # Note: we assume here that if they used f1c1p1 for nodes they should use f1c1 for cecs @@ -1468,7 +1468,7 @@ sub writesn { $tables{'ppc'}->setNodeAttribs('service', { id => '1', nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('service', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('service', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('service', { netboot => 'grub2' }); + $tables{'noderes'}->setNodeAttribs('service', { netboot => 'yaboot' }); $tables{'servicenode'}->setNodeAttribs('service', { nameserver => 1, dhcpserver => 1, tftpserver => 1, nfsserver => 1, conserver => 1, monserver => 1, ftpserver => 1, nimserver => 1, ipforward => defined($STANZAS{'xcat-service-nodes'}->{'route-masks'}) }); if ($STANZAS{'ll-config'}->{'central_manager_list'}) { # write the LL postscript for service nodes addPostscript('service', 'llserver.sh') @@ -1621,7 +1621,7 @@ sub writestorage { $tables{'ppc'}->setNodeAttribs('storage', { id => '1', nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('storage', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('storage', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('storage', { netboot => 'grub2' }); + $tables{'noderes'}->setNodeAttribs('storage', { netboot => 'yaboot' }); # Figure out what cec each storage node is in and write ppc.hcp, ppc.parent, noderes.xcatmaster, noderes.servicenode # Math for SN in BB: cecnum = ( ( (snnum-1) / snsperbb) * cecsperbb) + cecstart-1 + snpositioninbb @@ -1789,7 +1789,7 @@ sub writecompute { $tables{'ppc'}->setNodeAttribs('compute', { nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('compute', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('compute', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('compute', { netboot => 'grub2' }); + $tables{'noderes'}->setNodeAttribs('compute', { netboot => 'yaboot' }); if ($STANZAS{'ll-config'}->{'central_manager_list'}) { # write the LL postscript for compute nodes addPostscript('compute', 'llcompute.sh'); } diff --git a/xCAT-server/xCAT-wsapi/restapi.pl b/xCAT-server/xCAT-wsapi/restapi.pl index c8f87526f..a4427e8d0 100755 --- a/xCAT-server/xCAT-wsapi/restapi.pl +++ b/xCAT-server/xCAT-wsapi/restapi.pl @@ -81,7 +81,7 @@ my %URIdef = ( PUT => { desc => "Change the attibutes for the node {nodename}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/nodes/node1 {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", + example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -89,7 +89,7 @@ my %URIdef = ( POST => { desc => "Create the node {nodename}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Create a node with attributes groups=all, mgt=hmc and netboot=grub2|POST|/nodes/node1 {\"groups\":\"all\",\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", + example => "|Create a node with attributes groups=all, mgt=dfm and netboot=yaboot|POST|/nodes/node1 {\"groups\":\"all\",\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", cmd => "mkdef", fhandler => \&defhdl, outhdler => \&noout, @@ -571,7 +571,7 @@ my %URIdef = ( PUT => { desc => "Change the attibutes for the group {groupname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/groups/all {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", + example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -583,7 +583,7 @@ my %URIdef = ( GET => { desc => "Get the specific attributes for the group {groupname}.", usage => "||$usagemsg{objreturn}|", - example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"grub2\",\n \"mgt\":\"hmc\"\n }\n}|", + example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"yaboot\",\n \"mgt\":\"dfm\"\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, @@ -2745,3 +2745,4 @@ sub pushFlags { } } + diff --git a/xCAT-server/xCAT-wsapi/xcatws-test.sh b/xCAT-server/xCAT-wsapi/xcatws-test.sh index 267820393..47d070218 100755 --- a/xCAT-server/xCAT-wsapi/xcatws-test.sh +++ b/xCAT-server/xCAT-wsapi/xcatws-test.sh @@ -158,7 +158,7 @@ RESTMSG="Display the node restapinode1" REST GET "/nodes/restapinode1" RESTMSG="Change the attributes for node restapinode1" -REST PUT "/nodes/restapinode1" '{"mgt":"hmc","netboot":"grub2"}' +REST PUT "/nodes/restapinode1" '{"mgt":"fsp","netboot":"yaboot"}' RESTMSG="Display the node restapinode1" REST GET "/nodes/restapinode1" @@ -194,3 +194,4 @@ REST GET "/groups/restapi" RESTMSG="Display the nodes in group restapi" REST GET "/nodes/restapi" + diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index c61a20b71..59d8d16ce 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -83,7 +83,7 @@ my %URIdef = ( PUT => { desc => "Change the attributes for the node {noderange}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/nodes/node1 {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", + example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -91,7 +91,7 @@ my %URIdef = ( POST => { desc => "Create the node {noderange}.", usage => "|$usagemsg{objchparam} DataBody: {options:{opt1:v1,opt2:v2},attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Create a node with attributes groups=all, mgt=hmc and netboot=grub2|POST|/nodes/node1 {\"options\":{\"--template\":\"x86_64kvmguest-template\"}, \"groups\":\"all\",\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", + example => "|Create a node with attributes groups=all, mgt=dfm and netboot=yaboot|POST|/nodes/node1 {\"options\":{\"--template\":\"x86_64kvmguest-template\"}, \"groups\":\"all\",\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", cmd => "mkdef", fhandler => \&defhdl, outhdler => \&noout, @@ -657,7 +657,7 @@ my %URIdef = ( PUT => { desc => "Change the attributes for the group {groupname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/groups/all {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", + example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -669,7 +669,7 @@ my %URIdef = ( GET => { desc => "Get the specific attributes for the group {groupname}.", usage => "||$usagemsg{objreturn}|", - example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"grub2\",\n \"mgt\":\"hmc\"\n }\n}|", + example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"yaboot\",\n \"mgt\":\"dfm\"\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, @@ -3589,3 +3589,4 @@ sub pushFlags { } } + From 3bbdcf5900723bb23bd73a3baf6adb9082699afa Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Fri, 27 Mar 2026 11:20:29 -0300 Subject: [PATCH 17/21] Revert "Remove doxcat changes from 4a1905171d0994c2a44e72aa10bcaa05139889bc" Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- xCAT-genesis-scripts/usr/bin/doxcat | 101 ++++++++-------------------- 1 file changed, 28 insertions(+), 73 deletions(-) diff --git a/xCAT-genesis-scripts/usr/bin/doxcat b/xCAT-genesis-scripts/usr/bin/doxcat index e07a6265a..0bf5e360a 100755 --- a/xCAT-genesis-scripts/usr/bin/doxcat +++ b/xCAT-genesis-scripts/usr/bin/doxcat @@ -6,46 +6,6 @@ # log_label="xcat.genesis.doxcat" -# Normalize interface names from "ip link" output by removing decorations -# like "@if3", trailing ":" and surrounding whitespace. -normalize_ifname() { - echo "$1" | sed -e 's/@.*$//' -e 's/:$//' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -} - -# Only consider real ethernet NICs for link probing and DHCP. -# This skips virtual/tunnel interfaces that can spam netlink errors. -is_candidate_nic() { - local nic="$1" - - [ -n "$nic" ] || return 1 - [ "$nic" = "lo" ] && return 1 - case "$nic" in - usb*) return 1 ;; - esac - [ -d "/sys/class/net/$nic" ] || return 1 - [ -e "/sys/class/net/$nic/device" ] || return 1 - [ "$(cat "/sys/class/net/$nic/type" 2>/dev/null)" = "1" ] || return 1 - - return 0 -} - -list_candidate_nics() { - local only_up="$1" - local rawnic - local nic - - ip -o link show | awk -F': ' '{print $2}' | while read -r rawnic; do - nic=$(normalize_ifname "$rawnic") - if ! is_candidate_nic "$nic"; then - continue - fi - if [ "$only_up" = "up" ]; then - ip -o link show dev "$nic" 2>/dev/null | grep -q "UP" || continue - fi - echo "$nic" - done -} - # Start rsyslogd and log into a local file specified in /etc/rsyslog.conf # Later, once xCAT MN is known, dhclient-script will change # rsyslog.conf file to send log entries to xCAT MN @@ -80,16 +40,11 @@ if ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor &>/dev/null; then fi fi if [ ! -z "$BOOTIF" ]; then - BOOTIF=`echo "$BOOTIF"|sed -e s/01-// -e s/-/:/g` + BOOTIF=`echo $BOOTIF|sed -e s/01-// -e s/-/:/g` logger -s -t $log_label -p local4.info "Waiting for device with address $BOOTIF to appear.." gripeiter=6000 while [ -z "$bootnic" ]; do - bootnic=`ip -o link show | awk -v mac="$BOOTIF" 'tolower($0) ~ tolower(mac) {print $2; exit}'` - bootnic=`normalize_ifname "$bootnic"` - if [ ! -z "$bootnic" ] && ! ip link show dev "$bootnic" >/dev/null 2>&1; then - logger -s -t $log_label -p local4.info "Detected boot nic '$bootnic' from BOOTIF=$BOOTIF, but the interface does not exist yet. Retrying..." - bootnic="" - fi + bootnic=`ip link show|grep -B1 $BOOTIF|grep mtu|awk '{print $2}'|sed -e 's/:$//'` sleep 0.1 if [ $gripeiter = 0 ]; then logger -s -t $log_label -p local4.err "Unable to find boot device (Maybe the xCAT genesis kernel is missing the driver for your NIC?)" @@ -153,7 +108,7 @@ logger -s -t $log_label -p local4.info "Creating /var/lib/lldpad file..." mkdir -p /var/lib/lldpad echo 'lldp :' >> /var/lib/lldpad/lldpad.conf echo '{' >> /var/lib/lldpad/lldpad.conf -for iface in `ip -o link show | awk -F': ' '{print $2}' | sed -e 's/@.*$//' -e 's/:$//' | grep -v '^lo$'`; do +for iface in `ip link |grep -v '^ '|awk '{print $2}'|sed -e 's/:$//'|grep -v lo`; do echo "$iface :" >> /var/lib/lldpad/lldpad.conf echo "{" >> /var/lib/lldpad/lldpad.conf echo "tlvid00000006 :" >> /var/lib/lldpad/lldpad.conf @@ -250,14 +205,14 @@ if [[ -n $hostip && -n $netmask && -n $gateway && -n $bootnic ]]; then else logger -s -t $log_label -p local4.info "Setting IP via DHCP..." # This section is for System P hardware discovery, which won't have a BOOTIF value set - if [ -z "$bootnic" ]; then - tries=0 - while [ $tries -lt 100 ]; do - ALLUP_NICS=`list_candidate_nics up | sort -r` - for tmp1 in $ALLUP_NICS; do - dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$tmp1.pid $tmp1 & - dhclient -6 -pf /var/run/dhclient6.$tmp1.pid $tmp1 -lf /var/lib/dhclient/dhclient6.leases & - #bootnic=$tmp1 + if [ -z "$bootnic" ]; then + tries=0 + while [ $tries -lt 100 ]; do + ALLUP_NICS=`ip link show | grep -v "^ " | grep "state UP" | awk '{print $2}' | sed -e 's/:$//'|grep -v lo | sort -n -r` + for tmp1 in $ALLUP_NICS; do + dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$tmp1.pid $tmp1 & + dhclient -6 -pf /var/run/dhclient6.$tmp1.pid $tmp1 -lf /var/lib/dhclient/dhclient6.leases & + #bootnic=$tmp1 #break done if [ ! -z "$ALLUP_NICS" ]; then @@ -292,25 +247,25 @@ else /bin/bash fi else - dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$bootnic.pid "$bootnic" & - #we'll kick of IPv6 and IPv4 on all nics, but not wait for them to come up unless doing discovery, to reduce - #chances that we'll perform a partial discovery - #in other scenarios where downed non-bootnics cause issues, will rely on retries to fix things up - dhclient -6 -pf /var/run/dhclient6.$bootnic.pid "$bootnic" -lf /var/lib/dhclient/dhclient6.leases & - NICSTOBRINGUP=`list_candidate_nics | awk -v bootnic="$bootnic" '$0 != bootnic'` - export NICSTOBRINGUP - for nic in $NICSTOBRINGUP; do - (while ! ethtool "$nic" | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid "$nic" ) & - (while ! ethtool "$nic" | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -6 -pf /var/run/dhclient6.$nic.pid -lf /var/lib/dhclient/dhclient6.leases "$nic" ) & - done + dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$bootnic.pid $bootnic & + #we'll kick of IPv6 and IPv4 on all nics, but not wait for them to come up unless doing discovery, to reduce + #chances that we'll perform a partial discovery + #in other scenarios where downed non-bootnics cause issues, will rely on retries to fix things up + dhclient -6 -pf /var/run/dhclient6.$bootnic.pid $bootnic -lf /var/lib/dhclient/dhclient6.leases & + NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v $bootnic|grep -v usb|grep -v ,UP|awk -F: '{print $2}'` + export NICSTOBRINGUP + for nic in $NICSTOBRINGUP; do + (while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid $nic ) & + (while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -6 -pf /var/run/dhclient6.$nic.pid -lf /var/lib/dhclient/dhclient6.leases $nic ) & + done gripeiter=101 logger -s -t $log_label -p local4.info "Acquiring network addresses.." - while ! ip -4 -o a show dev "$bootnic"|grep -v 'scope link'|grep -q inet; do - sleep 0.1 - if [ $gripeiter = 1 ]; then - logger -s -t $log_label -p local4.info "It seems to be taking a while to acquire an IPv4 address, you may want to check spanning tree..." - fi + while ! ip -4 -o a show dev $bootnic|grep -v 'scope link'|grep -q inet; do + sleep 0.1 + if [ $gripeiter = 1 ]; then + logger -s -t $log_label -p local4.info "It seems to be taking a while to acquire an IPv4 address, you may want to check spanning tree..." + fi gripeiter=$((gripeiter-1)) done fi @@ -320,7 +275,7 @@ openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" -ip -4 -o a show dev "$bootnic"|grep -v 'scope link'|grep -v 'dynamic'|awk '{print $4}' +ip -4 -o a show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|awk '{print $4}' if [ -e /usr/sbin/ntpd ]; then logger -s -t $log_label -p local4.info "Starting ntpd..." 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 18/21] 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 From 1b0deaf9af83fda2e231fb903ec1eec70372653b Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:02:35 -0300 Subject: [PATCH 19/21] fix: Fix dhcp-client dependency failure during genimage Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- xCAT-server/lib/xcat/plugins/anaconda.pm | 6 +++++- xCAT-server/xCAT-server.spec | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 542c4e75a..a9dcfae05 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2392,7 +2392,11 @@ sub copycd my @ret = xCAT::SvrUtils->update_tables_with_mgt_image($distname, $arch, $path, $osdistroname); - my @ret = xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "netboot", $path, $osdistroname); + # @FIXME: (2.19+) dhcp-client is pulled by genimage but not provided by OS repositories. Because + # of that we provide it as an xCAT dependency in xCAT 2.18 unified repository and copy it + # to /install/dhcp_packages/ during post install, and append to the pkgdir of the netboot image below. + # Remove this in 2.19+ and use a supported DHCP implementation. + my @ret = xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "netboot", "$path,/install/dhcp_pkgs/", $osdistroname); #if ($ret[0] != 0) { #$callback->({data => "Error when updating the osimage tables for stateless: " . $ret[1]}); diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 545020251..c021649f4 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -507,6 +507,16 @@ then cp /etc/%httpconfigdir/conf.orig/xcat-ws.conf.apache24 /etc/apache2/conf.d/xcat-ws.conf fi +# @FIXME: (for v2.19+) Remove this and use the supported dhcp +%ifos linux +# In EL10 dhcp-client is not provided by the O.S repositories anymore +# so we download it to a directory which is appended to netboot +# pkgdir during copycds, s.t. genimage succeds without +# need for human intervention. At the moment of writing the dhcp-client +# is provided by xCAT 2.18 unified repository as a dependency. +dnf download --destdir=/install/dhcp_pkgs/ dhcp-client +%endif + exit 0 %preun From baa2380cd2190252bbe8a70ab3768f44ff51398f Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:15:56 -0300 Subject: [PATCH 20/21] fix: Move dracut call to the .spec This fixes a problem where the dracut image was pulling artifacts from the build host and not the mock image, e.g. building for EL9 in EL10. Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 133 ++------------- .../dracut_105/el/module-setup.sh | 2 +- xCAT-genesis-builder/xCAT-genesis-base.spec | 155 +++++++++++++++++- .../xCAT-genesis-scripts.spec | 2 +- xCAT-server/xCAT-server.spec | 32 +++- xCAT/xCAT.spec | 23 +-- 6 files changed, 206 insertions(+), 141 deletions(-) diff --git a/buildrpms.pl b/buildrpms.pl index cad4c670d..590b81ae0 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -238,130 +238,23 @@ sub buildsources_genesis_base($) { die "Assertion failed! No directory xCAT-genesis-builder in the current directory" unless -d "./xCAT-genesis-builder"; + my $staging_parent = "/tmp/xcat-genesis-base-build-support.$$"; + my $staging_root = "$staging_parent/xCAT-genesis-base-build-support"; + my $support_tarball = "$SOURCES/xCAT-genesis-base-build-support.tar.bz2"; - my @deps = qw( - bind-utils - dosfstools - ethtool - ipmitool - kexec-tools - lldpad - mdadm - mstflint - nmap-ncat - net-tools - pciutils - psmisc - rpm-build - rpmdevtools - screen - usbutils + remove_tree($staging_parent) if -e $staging_parent; + make_path("$staging_root/dracut_105"); - nfs-utils rpcbind - dhclient - ); - sh("dnf install -y " . join " ", @deps) - and die "Error installing packages $?"; + sh(qq(cp -a "xCAT-genesis-builder/dracut_105" "$staging_root/")) + and die "Error copying dracut_105 sources"; + cp "xCAT-genesis-builder/80-net-name-slot.rules", + "$staging_root/80-net-name-slot.rules"; + unlink $support_tarball if -f $support_tarball; + sh(qq(tar -cjf "$support_tarball" -C "$staging_parent" xCAT-genesis-base-build-support)) + and die "Error creating $support_tarball"; - my $dracutmoddir = "/usr/lib/dracut/modules.d/97xcat/"; - - my $targetarch = targetarch_from_target($target); - my $buildarch = genesis_tarch_from_targetarch($targetarch); - my $kernelversion = `uname -r`; - chomp $kernelversion; - - my $genesispath = "/tmp/xcatgenesis.$$"; - my $buildpath = "$genesispath/opt/xcat/share/xcat/netboot/genesis/$buildarch"; - - make_path $dracutmoddir; - make_path "$buildpath/fs/etc/ssh/"; - - my @files = map { "$Bin/xCAT-genesis-builder/dracut_105/el/$_" } - qw( - module-setup.sh - xcat-cmdline.sh - xcatroot - dhclient.conf - dhclient-script - rsyslog.conf - ); - # copy @files to $dracutmoddir - cp $_, $dracutmoddir for @files; - - # The dependents of these must be updated - # * netstat - # * /sbin/route - # * /sbin/ifconfig -> net-tool - # * nslookup - - - - my $opts = $opts{verbose} ? "set -x" : ""; - sh(<<"EOF"); -$opts -dracut --compress gzip -m "xcat base" --no-early-microcode -N -f $genesispath.rfs; -rm -rf $buildpath/fs || : -mkdir -p $buildpath/fs || : -cd $buildpath/fs -zcat $genesispath.rfs | cpio -dumi -EOF - - # Ensure helper scripts remain executable in genesis rootfs. - # EL10 discovery needs dhclient-script to be executable. - for my $script ( - "$buildpath/fs/sbin/dhclient-script", - "$buildpath/fs/usr/sbin/dhclient-script", - "$buildpath/fs/sbin/xcatroot", - ) { - chmod 0755, $script if -f $script; - } - - my @perl_lib_dir = qw( - /usr/share/perl5 - /usr/lib64/perl5 - /usr/local/lib64/perl5 - /usr/local/share/perl5 - /usr/share/ntp/lib - ); - - for my $d (@perl_lib_dir) { - next unless -d $d; - my $temp_dir = "$buildpath/fs/$d"; - make_path $temp_dir; - # cp function does not copy directories recursively - `cp -a -t $temp_dir $d/.`; - } - - make_path "$buildpath/fs/lib/udev/rules.d/"; - my $oldcwd = Cwd::cwd(); - my $lib_udev_rules="/lib/udev/rules.d/"; - cp "$lib_udev_rules/80-net-name-slot.rules", "$buildpath/fs/lib/udev/rules.d/" - if -e "$lib_udev_rules/80-net-name-slot.rules"; - - # Keep historical layout: kernel is a file, not a directory. - # mknb expects genesis//kernel to be copied as a kernel file. - unlink "$buildpath/kernel" if -l "$buildpath/kernel" || -f "$buildpath/kernel"; - remove_tree "$buildpath/kernel" if -d "$buildpath/kernel"; - cp "/boot/vmlinuz-$kernelversion", "$buildpath/kernel"; - - # Create the targz - # - # Note: - # - # Deletes character devices from the genesis-base - # image filesystem prior to tarball creation. The installation - # of the package fails in vanilla containers with "Operation not - # permited" during the creation of - # - # /opt/xcat/../genesis/../fs/dev/{console,random,...} - # - # otherwise. - sh(<<"EOF") -cd $genesispath -find . -type c -delete -tar jcf $SOURCES/xCAT-genesis-base-$buildarch.tar.bz2 opt -EOF + remove_tree($staging_parent); } sub buildsources { diff --git a/xCAT-genesis-builder/dracut_105/el/module-setup.sh b/xCAT-genesis-builder/dracut_105/el/module-setup.sh index 805d70fe2..81f2c052e 100755 --- a/xCAT-genesis-builder/dracut_105/el/module-setup.sh +++ b/xCAT-genesis-builder/dracut_105/el/module-setup.sh @@ -630,7 +630,7 @@ install() { dracut_install /etc/chrony.conf _dracut_install_opt /etc/chrony.keys dracut_install /run/rpcbind - _dracut_install_opt /etc/systemd/system.conf /usr/lib/systemd/system.conf + _dracut_install_opt /etc/systemd/system.conf dracut_install /sbin/rpc.statd /usr/sbin/sm-notify /etc/netconfig rpcbind /etc/host.conf /usr/sbin/rpc.idmapd dracut_install ps free find #debug inst_dir /var/lib/nfs diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index f08d38b05..27eac8751 100644 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -30,8 +30,51 @@ License: Various (see individual packages for details) Vendor: IBM Corp. Summary: xCAT Genesis netboot image URL: https://xcat.org/ -Source1: xCAT-genesis-base-%{tarch}.tar.bz2 +Source0: xCAT-genesis-base-build-support.tar.bz2 Conflicts: xCAT-genesis-scripts-%{tarch} < 1:2.13.10 +BuildRequires: bc +BuildRequires: bind-utils +BuildRequires: chrony +BuildRequires: cpio +BuildRequires: dhcp-client +BuildRequires: e2fsprogs +BuildRequires: hostname +%if "%{_target_cpu}" == "x86_64" +BuildRequires: dmidecode +BuildRequires: efibootmgr +%endif +BuildRequires: dosfstools +BuildRequires: dracut +BuildRequires: dracut-network +BuildRequires: ethtool +BuildRequires: gawk +BuildRequires: ipmitool +BuildRequires: iproute +BuildRequires: kexec-tools +BuildRequires: kernel-core +BuildRequires: lldpad +BuildRequires: lvm2 +BuildRequires: mdadm +BuildRequires: mstflint +BuildRequires: net-tools +BuildRequires: nfs-utils +BuildRequires: nmap-ncat +BuildRequires: openssh-clients +BuildRequires: openssh-server +BuildRequires: parted +BuildRequires: pciutils +BuildRequires: perl +BuildRequires: perl-interpreter +BuildRequires: procps-ng +BuildRequires: psmisc +BuildRequires: rsync +BuildRequires: rsyslog +BuildRequires: screen +BuildRequires: usbutils +BuildRequires: util-linux +BuildRequires: vim-minimal +BuildRequires: wget +BuildRequires: xfsprogs Buildroot: %{_localstatedir}/tmp/xCAT-genesis Packager: IBM Corp. @@ -40,17 +83,115 @@ Packager: IBM Corp. xCAT genesis (Genesis Enhanced Netboot Environment for System Information and Servicing) is a small, embedded-like environment for xCAT's use in discovery and management actions when interaction with an OS is infeasible. This package comprises the base platform with most of the xCAT specific behavior left to xCAT-genesis-scripts package. Built in environment "%dist" on %{_arch}. -%Prep +%prep +%setup -q -n xCAT-genesis-base-build-support -%Build +%build %Install +set -euxo pipefail + rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT -cd $RPM_BUILD_ROOT -tar jxf %{SOURCE1} -cd - +mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/%{tarch} + +GENESIS_TMPDIR=$(mktemp -d %{_tmppath}/xcat-genesis.%{tarch}.XXXXXX) +GENESIS_ROOT=$GENESIS_TMPDIR/%{prefix}/share/xcat/netboot/genesis/%{tarch} +GENESIS_FS=$GENESIS_ROOT/fs +DRACUT_IMAGE=$GENESIS_TMPDIR/genesis.rfs + +cleanup() { + rm -rf "$GENESIS_TMPDIR" + rm -rf "$DRACUTMODDIR" +} +trap cleanup EXIT + +if [ -d /usr/share/dracut/modules.d ]; then + DRACUT_PARENT=/usr/share/dracut/modules.d +else + DRACUT_PARENT=/usr/lib/dracut/modules.d +fi +DRACUTMODDIR=$DRACUT_PARENT/97xcat +rm -rf "$DRACUTMODDIR" +mkdir -p "$DRACUTMODDIR" +cp -a "%{_builddir}/xCAT-genesis-base-build-support/dracut_105/el/." "$DRACUTMODDIR/" +chmod 0755 "$DRACUTMODDIR/module-setup.sh" "$DRACUTMODDIR/xcatroot" "$DRACUTMODDIR/dhclient-script" +if [ "%{_target_cpu}" != "x86_64" ]; then + sed -i '/efibootmgr dmidecode/d' "$DRACUTMODDIR/module-setup.sh" +fi + +KERNELVERSION=$(ls -1 /lib/modules | sort -V | tail -n 1) +test -n "$KERNELVERSION" + +mkdir -p "$GENESIS_FS/etc/ssh" +mkdir -p /run/rpcbind +dracut --compress gzip -m "xcat base" --no-early-microcode -N -f "$DRACUT_IMAGE" "$KERNELVERSION" + +( + cd "$GENESIS_FS" + zcat "$DRACUT_IMAGE" | cpio -dumi +) + +%if 0%{?rhel} > 0 && 0%{?rhel} <= 9 +# EL9 upgrade safety depends on this remaining a real directory. +if [ ! -d "$GENESIS_FS/usr/lib/dracut/hooks" ] || [ -L "$GENESIS_FS/usr/lib/dracut/hooks" ]; then + echo "EL%{?rhel} genesis payload has invalid usr/lib/dracut/hooks layout" >&2 + exit 1 +fi +%endif + +for script in \ + "$GENESIS_FS/sbin/dhclient-script" \ + "$GENESIS_FS/usr/sbin/dhclient-script" \ + "$GENESIS_FS/sbin/xcatroot" +do + if [ -f "$script" ]; then + chmod 0755 "$script" + fi +done + +for perl_dir in \ + /usr/share/perl5 \ + /usr/lib64/perl5 \ + /usr/local/lib64/perl5 \ + /usr/local/share/perl5 \ + /usr/share/ntp/lib +do + if [ -d "$perl_dir" ]; then + mkdir -p "$GENESIS_FS$perl_dir" + cp -a "$perl_dir/." "$GENESIS_FS$perl_dir/" + fi +done + +mkdir -p "$GENESIS_FS/lib/udev/rules.d" +if [ -e /lib/udev/rules.d/80-net-name-slot.rules ]; then + cp /lib/udev/rules.d/80-net-name-slot.rules "$GENESIS_FS/lib/udev/rules.d/" +else + cp "%{_builddir}/xCAT-genesis-base-build-support/80-net-name-slot.rules" \ + "$GENESIS_FS/lib/udev/rules.d/" +fi + +KERNEL_IMAGE=/boot/vmlinuz-$KERNELVERSION +if [ ! -e "$KERNEL_IMAGE" ]; then + for candidate in \ + "/usr/lib/modules/$KERNELVERSION/vmlinuz" \ + "/lib/modules/$KERNELVERSION/vmlinuz" \ + "$(find /usr/lib/modules/$KERNELVERSION -maxdepth 2 -name 'vmlinuz*' 2>/dev/null | head -n 1)" \ + "$(find /lib/modules/$KERNELVERSION -maxdepth 2 -name 'vmlinuz*' 2>/dev/null | head -n 1)" \ + "$(ls -1 /boot/vmlinuz-* 2>/dev/null | sort -V | tail -n 1)" + do + if [ -n "$candidate" ] && [ -e "$candidate" ]; then + KERNEL_IMAGE="$candidate" + break + fi + done +fi +test -n "$KERNEL_IMAGE" +test -e "$KERNEL_IMAGE" +cp "$KERNEL_IMAGE" "$GENESIS_ROOT/kernel" + +find "$GENESIS_TMPDIR" -type c -delete +cp -a "$GENESIS_TMPDIR/%{prefix}/." "$RPM_BUILD_ROOT/%{prefix}/" %pretrans -p diff --git a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec index ce89077a5..5202c1ed0 100644 --- a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec +++ b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec @@ -32,7 +32,7 @@ Vendor: IBM Corp. Summary: xCAT Genesis netboot image - Core content URL: https://xcat.org/ Source1: xCAT-genesis-scripts.tar.bz2 -Requires: xCAT-genesis-base-%{tarch} >= 2:2.13.10 +Requires: xCAT-genesis-base-%{tarch} = 2:%{version}-%{release} Buildroot: %{_localstatedir}/tmp/xCAT-genesis Packager: IBM Corp. diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index c021649f4..8c188efe1 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -52,7 +52,9 @@ Obsoletes: atftp-xcat # # PCM does not use or ship grub2-xcat %if %nots390x -Requires: grub2-xcat >= 2.02-0.76.el7.1.snap201905160255 perl-Net-HTTPS-NB perl-HTTP-Async +Requires: grub2-xcat >= 2.02-0.76.el7.1.snap201905160255 +Requires: perl-Net-HTTPS-NB >= 0.14-3 +Requires: perl-HTTP-Async >= 0.30-3 %endif %endif %endif @@ -127,6 +129,23 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT %ifos linux cp -a share/xcat/install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/install/ cp -a share/xcat/netboot/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/ + +# Preserve netboot dracut aliases as symlinks so rpm upgrades do not fail when +# replacing older xCAT-server packages that already own these paths as symlinks. +for _required_symlink in \ + SL/dracut_033 \ + alma/dracut alma/dracut_033 alma/dracut_047 \ + centos/dracut centos/dracut_033 centos/dracut_047 \ + fedora/dracut_047 \ + ol/dracut ol/dracut_033 ol/dracut_047 \ + rocky/dracut rocky/dracut_033 rocky/dracut_047 rocky/dracut_105 +do + _target="$RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/${_required_symlink}" + if [ ! -L "$_target" ]; then + echo "ERROR: expected symlink missing or dereferenced: $_target" >&2 + exit 1 + fi +done %else cp -hpR share/xcat/install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/install/ cp -hpR share/xcat/netboot/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/ @@ -441,6 +460,16 @@ if [ -d $RPM_INSTALL_PREFIX0/share/xcat/devicetype/EthSwitch/Juniper ]; then rm -rf $RPM_INSTALL_PREFIX0/share/xcat/devicetype/EthSwitch/Juniper fi +# Newer xCAT-server payloads replace legacy dracut symlinks with real +# directories/files in several distro trees. Remove the old symlinks up front +# so RPM can upgrade the package cleanly. +for distro in SL alma centos fedora ol rocky; do + if [ -d "$RPM_INSTALL_PREFIX0/share/xcat/netboot/$distro" ]; then + find "$RPM_INSTALL_PREFIX0/share/xcat/netboot/$distro" \ + -maxdepth 2 -type l -name 'dracut*' -exec rm -f {} + + fi +done + %post %ifos linux ln -sf $RPM_INSTALL_PREFIX0/sbin/xcatd /usr/sbin/xcatd @@ -537,4 +566,3 @@ if [ $1 == 0 ]; then #This means only on -e fi %endif - diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index bb9af4f35..62beb6637 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -56,10 +56,10 @@ Requires: xCAT-server = 4:%{version}-%{release} 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} +Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} %endif %ifarch ppc ppc64 ppc64le -Recommends: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} +Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} %endif %endif @@ -76,30 +76,33 @@ Requires: /usr/sbin/dhcpd Requires: /usr/bin/ssh %if %nots390x Requires: /usr/sbin/in.tftpd -Requires: xCAT-buildkit +Requires: xCAT-buildkit = 4:%{version}-%{release} # Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p -Requires: perl-IO-Stty +Requires: perl-IO-Stty >= 0.04-5 %endif %endif %ifos linux -Requires: goconserver >= 0.3.3 +Requires: goconserver >= 0.3.3-snap202011021058 %endif #support mixed cluster %if %nots390x -Requires: elilo-xcat +Requires: elilo-xcat >= 3.14-6 %endif %ifarch i386 i586 i686 x86 x86_64 -Requires: xnba-undi -Requires: syslinux-xcat -Requires: ipmitool-xcat >= 1.8.17-1 +Requires: xnba-undi >= 1.21.1-1 +Requires: syslinux-xcat >= 6.03-1 +Requires: ipmitool-xcat >= 1.8.18-4 %endif %ifos linux %ifarch ppc ppc64 ppc64le -Requires: ipmitool-xcat >= 1.8.17-1 +# Mixed-arch management nodes also need the x86 PXE stack kept current. +Requires: xnba-undi >= 1.21.1-1 +Requires: syslinux-xcat >= 6.03-1 +Requires: ipmitool-xcat >= 1.8.18-4 %endif %endif From 749f9fa9c719fe56acfa7b01e0c787d05e963003 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, 17 Apr 2026 03:14:04 -0300 Subject: [PATCH 21/21] docs: update xCAT status in README --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 33aa9bf21..d67e232d9 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,26 @@ xCAT is a toolkit for deployment and administration of clusters of all sizes. -# Sunsetting xCAT and transitioning to Confluent +# The xCAT sunset was only a quick eclipse Dear xCAT Community, -As noted in our previous updates and during the informal BoF sessions at SC’23 and SC’24, the consortium has been focused on both completing the final work for xCAT and preparing for the transition to its successor. +The xCAT sunset has changed course. VersatusHPC has been invited to join the xCAT Consortium, and future development will move toward direct upstream contributions coordinated with the Consortium and its existing member companies. -As committed, we delivered Enterprise Linux 9 (EL9) support in the xCAT 2.17 release. This represents the final planned enablement for xCAT. +That matters most for Enterprise Linux 10 (EL10). EL10 support is coming to xCAT, restoring a future operating-system path for sites that still rely on xCAT. This is an important change from the previous sunset guidance, where the lack of an EL10 path was one of the strongest reasons to move away from xCAT. -xCAT is now officially being sunsetted. The consortium will not provide support beyond existing platforms, and Enterprise Linux 10 (EL10) will not be supported. Active development and all new feature work have transitioned fully to **Confluent**, which we recognise as the official successor to xCAT. +The xCAT Consortium continues to recommend **Confluent** as the long-term successor to xCAT, and that remains the Consortium position. Users planning new cluster-management deployments should evaluate Confluent and its xCAT comparison documentation. -While xCAT will remain in maintenance mode, with community pull requests still welcome and reviewed, there will be no new features or support for future operating systems. +At the same time, xCAT is no longer sunsetted. The Consortium and participating companies will continue updating xCAT while there is community and user demand for it. In summary: -- xCAT has delivered its final milestone with EL9 support. -- No EL10 or future OS enablement will be added. -- Community contributions are still accepted and reviewed. -- All development effort is now focused on **Confluent**, the successor to xCAT. +- xCAT development is continuing upstream through the Consortium and participating companies. +- Enterprise Linux 10 support is coming. +- Confluent remains the Consortium-recommended successor and migration path. +- xCAT updates will continue while there is community and user demand. -We want to sincerely thank the community for the years of contributions, support, and participation in shaping xCAT. We now look forward to continuing that journey with you in the **Confluent community**, where the future of open, vendor-agnostic cluster management will continue to grow. +We want to thank the xCAT Consortium and community for keeping this project moving. The sun went behind the moon for a moment, but xCAT is still here. For more information on **Confluent** and how to get started, please visit the **Confluent**: [Project Page](https://github.com/xcat2/confluent), [Documentation](https://xcat2.github.io/confluent-docs/) or [Confluent vs xCAT comparison](https://xcat2.github.io/confluent-docs/miscellaneous/confluentvxcat/). @@ -49,4 +49,3 @@ xCAT is made available under the EPL license: https://opensource.org/licenses/ec # Developers Want to help? Check out the [developers guide](http://xcat-docs.readthedocs.io/en/latest/developers)! -