2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-07-31 18:19:40 +00:00

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>
This commit is contained in:
Vinícius Ferrão
2026-07-22 00:49:04 -03:00
parent cf44f51463
commit 7d59ccaccb
8 changed files with 8 additions and 8 deletions
@@ -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
@@ -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
@@ -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##*/}
@@ -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##*/}
@@ -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##*/}
@@ -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##*/}
@@ -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##*/}
@@ -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