From c8b21c1ccabe757eaeef936e86e2dbb3f6550360 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, 8 May 2026 02:18:40 -0300 Subject: [PATCH] fix: strip R:: prefix from netboot config when all options are persistent When all addkcmdline options have R:: prefix (persistent options for the installed OS), the volatile check in xnba.pm and pxe.pm would fail because volatile was undefined. This left the original R::-prefixed string in the netboot config instead of stripping it. The fix ensures we always use the volatile portion after calling splitkcmdline, even if it's empty. Persistent (R::) options are handled separately by Template.pm via PERSKCMDLINE for the installed OS bootloader. Fixes #7442 --- xCAT-server/lib/xcat/plugins/pxe.pm | 7 ++++--- xCAT-server/lib/xcat/plugins/xnba.pm | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index dab9cbe81..4b586f984 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -119,9 +119,10 @@ sub setstate { $cmdhashref = xCAT::Utils->splitkcmdline($kcmdlinehack); } - if ($cmdhashref and $cmdhashref->{volatile}) - { - $kcmdlinehack = $cmdhashref->{volatile}; + if ($cmdhashref) { + # Use only volatile options for netboot; persistent (R::) options + # are handled separately for the installed OS via PERSKCMDLINE + $kcmdlinehack = $cmdhashref->{volatile} // ""; } diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index c59e6a2f4..88c09c5e6 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -186,9 +186,10 @@ sub setstate { $cmdhashref = xCAT::Utils->splitkcmdline($kcmdlinehack); } - if ($cmdhashref and $cmdhashref->{volatile}) - { - $kcmdlinehack = $cmdhashref->{volatile}; + if ($cmdhashref) { + # Use only volatile options for netboot; persistent (R::) options + # are handled separately for the installed OS via PERSKCMDLINE + $kcmdlinehack = $cmdhashref->{volatile} // ""; }