From 0e3f73253822d6a66684a17210168529f24d826f Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Mon, 9 Nov 2026 20:03:07 +0100 Subject: [PATCH 1/2] Keep interface naming arguments when installing images to disk image2disk only carried console= and quiet into the installed system. A built image deployed with net.ifnames=0 biosdevname=0 came up with enp1s0 while the connection written during the install was for eth0, so the network failed. Carry net.ifnames= and biosdevname= as well. Also add the missing space before crashkernel= in the default el9 GRUB_CMDLINE_LINUX. --- .../el8-diskless/profiles/default/scripts/image2disk.py | 4 +--- .../el9-diskless/profiles/default/scripts/image2disk.py | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/confluent_osdeploy/el8-diskless/profiles/default/scripts/image2disk.py b/confluent_osdeploy/el8-diskless/profiles/default/scripts/image2disk.py index 66b3d38c..195d46ea 100644 --- a/confluent_osdeploy/el8-diskless/profiles/default/scripts/image2disk.py +++ b/confluent_osdeploy/el8-diskless/profiles/default/scripts/image2disk.py @@ -193,9 +193,7 @@ def fixup(rootdir, vols): with open('/proc/cmdline') as cmdlinein: cmdline = cmdlinein.read().strip() for arg in cmdline.split(): - if arg.startswith('console='): - currcmdline.append(arg) - elif arg == 'quiet': + if arg == 'quiet' or arg.startswith(('console=', 'net.ifnames=', 'biosdevname=')): currcmdline.append(arg) currcmdlinestr = ' '.join(currcmdline) if os.path.exists(grubsyscfg): diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py b/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py index ce03f84b..08b5afca 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py @@ -213,9 +213,7 @@ def fixup(rootdir, vols): with open('/proc/cmdline') as cmdlinein: cmdline = cmdlinein.read().strip() for arg in cmdline.split(): - if arg.startswith('console='): - currcmdline.append(arg) - elif arg == 'quiet': + if arg == 'quiet' or arg.startswith(('console=', 'net.ifnames=', 'biosdevname=')): currcmdline.append(arg) currcmdlinestr = ' '.join(currcmdline) kcmdline = os.path.join(rootdir, 'etc/kernel/cmdline') @@ -286,7 +284,7 @@ def fixup(rootdir, vols): 'GRUB_DISABLE_SUBMENU=true', 'GRUB_TERMINAL=""', 'GRUB_SERIAL_COMMAND=""', - 'GRUB_CMDLINE_LINUX="{}crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M rd.lvm.lv=vg/root rd.lvm.lv=vg/swap"'.format(currcmdlinestr), + 'GRUB_CMDLINE_LINUX="{} crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M rd.lvm.lv=vg/root rd.lvm.lv=vg/swap"'.format(currcmdlinestr), 'GRUB_DISABLE_RECOVERY="true"', 'GRUB_ENABLE_BLSCFG=true', ] From bd5c7be4dac8ed66b326fdf9e978030f20c856f1 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Mon, 9 Nov 2026 21:04:06 +0100 Subject: [PATCH 2/2] Add interface naming arguments to captured image cmdlines A captured image keeps the /etc/kernel/cmdline of its source. If the source did not run with the net.ifnames=/biosdevname= of the diskless boot, the installed system renames the interface and the connection written during the install does not match. Append them when missing. --- .../el9-diskless/profiles/default/scripts/image2disk.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py b/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py index 08b5afca..a35252e0 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py @@ -234,6 +234,11 @@ def fixup(rootdir, vols): newkcmdlineent.append(ent) else: newkcmdlineent.append(ent) + # the network configuration written during the install uses the + # interface names of this boot + for arg in currcmdline: + if arg.startswith(('net.ifnames=', 'biosdevname=')) and arg not in newkcmdlineent: + newkcmdlineent.append(arg) with open(kcmdline, 'w') as kcmdlineout: kcmdlineout.write(' '.join(newkcmdlineent) + '\n') for loadent in glob.glob(os.path.join(rootdir, 'boot/loader/entries/*.conf')):