2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-05-17 11:54:16 +00:00

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
This commit is contained in:
Vinícius Ferrão
2026-05-08 02:18:40 -03:00
parent 9bbd5644bc
commit c8b21c1cca
2 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -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} // "";
}
+4 -3
View File
@@ -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} // "";
}