2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-09 05:00:44 +00:00

fix(genesis): harden qeth activation

This commit is contained in:
Vinícius Ferrão
2026-09-06 02:02:58 -03:00
parent 9f9f535c6a
commit e53d351d17
2 changed files with 20 additions and 0 deletions
@@ -5,6 +5,7 @@ LC_ALL=C
export LC_ALL
cmdline_file=${XCAT_CMDLINE_FILE:-/proc/cmdline}
cio_settle_file=${XCAT_CIO_SETTLE_FILE:-/proc/cio_settle}
status_command=${XCAT_STATUS_COMMAND:-/usr/libexec/xcat/genesis-status}
znetconf_command=${XCAT_ZNETCONF_COMMAND:-/sbin/znetconf}
@@ -41,6 +42,15 @@ configured_channels() {
return 1
}
processed_channels() {
local channels=$1 processed
for processed in "${ready_channels[@]}" "${failed_channels[@]}"; do
[ "$processed" = "$channels" ] && return 0
done
return 1
}
activate_channels() {
local channels=$1
shift
@@ -48,6 +58,11 @@ activate_channels() {
local option output result
local have_layer2=false
if processed_channels "$channels"; then
log "qeth channels already processed: $channels"
return 0
fi
for option in "$@"; do
if [[ ! $option =~ ^[A-Za-z_][A-Za-z0-9_./-]*=[A-Za-z0-9_./:+-]+$ ]]; then
log "Invalid qeth option for $channels: $option"
@@ -79,6 +94,10 @@ activate_channels() {
return 0
}
if [ -w "$cio_settle_file" ]; then
printf '1\n' >"$cio_settle_file" || log 'Unable to wait for IBM Z channel devices'
fi
configured_output=$("$znetconf_command" -c 2>/dev/null || true)
declare -a cmdline_arguments=() explicit_specs=() ready_channels=() failed_channels=()
rd_znet_present=false
@@ -8,6 +8,7 @@ Before=NetworkManager.service xcat-genesis-network-state.service
[Service]
Type=oneshot
ExecStart=/usr/libexec/xcat/genesis-qeth
TimeoutStartSec=120
RemainAfterExit=yes
[Install]