From 7d59ccaccb8ac69080f811721c1fb03202ebdf76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 22 Jul 2026 00:49:04 -0300 Subject: [PATCH] fix(netboot): allow the rootfs image to be downloaded over HTTPS The diskless/statelite xcatroot scripts only recognize an http:// rootfs image URL; an https:// imgurl falls through to the "unsupported" path even though the download itself already uses wget/curl on the full $imgurl, both of which handle TLS. Accept xhttps alongside xhttp in the protocol test. Applied to every current xcatroot variant (rh dracut/dracut_033/dracut_047/dracut_105 stateless and statelite, plus fedora, sles and ubuntu), so HTTPS works uniformly rather than only on the three rh scripts the original touched. Recovered from the unmerged lenovobuild branch (original 751bce24, extended to the dracut generations and distros that postdate it). Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com> --- xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot | 2 +- xCAT-server/share/xcat/netboot/rh/dracut/xcatroot | 2 +- xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot | 2 +- xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot | 2 +- xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot | 2 +- xCAT-server/share/xcat/netboot/rh/dracut_105/statelite/xcatroot | 2 +- xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot | 2 +- xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot index 7811cf0fb..b12134b9a 100755 --- a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot +++ b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot @@ -22,7 +22,7 @@ if [ $NODESTATUS -ne 0 ];then fi if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then + if [ xhttp = x${imgurl%%:*} ] || [ xhttps = x${imgurl%%:*} ]; then NFS=0 FILENAME=${imgurl##*/} while [ ! -r "$FILENAME" ]; do diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot index 423ab6d36..d7b33a347 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot @@ -27,7 +27,7 @@ if [ "$NODESTATUS" != "0" ]; then fi if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then + if [ xhttp = x${imgurl%%:*} ] || [ xhttps = x${imgurl%%:*} ]; then NFS=0 FILENAME=${imgurl##*/} while [ ! -r "$FILENAME" ]; do diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot index b52b49035..89a7f50d2 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot @@ -33,7 +33,7 @@ fi imgurl="$(getarg imgurl=)"; if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then + if [ xhttp = x${imgurl%%:*} ] || [ xhttps = x${imgurl%%:*} ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Downloading rootfs image from $imgurl..." NFS=0 FILENAME=${imgurl##*/} diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot index b851865b5..6f9f11b28 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot @@ -33,7 +33,7 @@ fi imgurl="$(getarg imgurl=)"; if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then + if [ xhttp = x${imgurl%%:*} ] || [ xhttps = x${imgurl%%:*} ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Downloading rootfs image from $imgurl..." NFS=0 FILENAME=${imgurl##*/} diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot index b851865b5..6f9f11b28 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot @@ -33,7 +33,7 @@ fi imgurl="$(getarg imgurl=)"; if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then + if [ xhttp = x${imgurl%%:*} ] || [ xhttps = x${imgurl%%:*} ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Downloading rootfs image from $imgurl..." NFS=0 FILENAME=${imgurl##*/} diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_105/statelite/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_105/statelite/xcatroot index b851865b5..6f9f11b28 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_105/statelite/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_105/statelite/xcatroot @@ -33,7 +33,7 @@ fi imgurl="$(getarg imgurl=)"; if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then + if [ xhttp = x${imgurl%%:*} ] || [ xhttps = x${imgurl%%:*} ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Downloading rootfs image from $imgurl..." NFS=0 FILENAME=${imgurl##*/} diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot index 4a9aac8fb..b84b4076c 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot @@ -37,7 +37,7 @@ if [ $NODESTATUS -ne 0 ];then fi if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then + if [ xhttp = x${imgurl%%:*} ] || [ xhttps = x${imgurl%%:*} ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Downloading rootfs image from $imgurl..." NFS=0 FILENAME=${imgurl##*/} diff --git a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot index c48c46d2d..c0232154c 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot @@ -4,7 +4,7 @@ RWDIR=.statelite XCATMASTER=$XCAT if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then + if [ xhttp = x${imgurl%%:*} ] || [ xhttps = x${imgurl%%:*} ]; then NFS=0 FILENAME=${imgurl##*/} while [ ! -r "$FILENAME" ]; do