From def5fa3753dccafcb1a0306df9158c438eb02f7a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 7 Oct 2026 19:10:46 -0400 Subject: [PATCH] Have a separate file for shim boot Legacy boot with iPXE adapters will cause issues with the relatively new 'shim' command. It's useless for BIOS anyway, so omit it. --- .../confluent/discovery/protocols/pxe.py | 5 ++++- confluent_server/confluent/osimage.py | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/discovery/protocols/pxe.py b/confluent_server/confluent/discovery/protocols/pxe.py index 5ae19465..f66513ff 100644 --- a/confluent_server/confluent/discovery/protocols/pxe.py +++ b/confluent_server/confluent/discovery/protocols/pxe.py @@ -351,7 +351,10 @@ async def proxydhcp(handler, nodeguess): log.log({'info': 'No pending profile for {0}, skipping proxyDHCP reply'.format(node)}) continue myip = socket.inet_ntoa(myipn) - bootfile = 'http://{0}/confluent-public/os/{1}/boot.ipxe'.format(myip, profile).encode('utf8') + if disco['arch'] == 'bios-x86': + bootfile = 'http://{0}/confluent-public/os/{1}/boot.ipxe'.format(myip, profile).encode('utf8') + else: + bootfile = 'http://{0}/confluent-public/os/{1}/boot.ipxe.shim'.format(myip, profile).encode('utf8') elif disco['arch'] == 'uefi-x64': bootfile = b'confluent/x86_64/ipxe-shim.efi' elif disco['arch'] == 'bios-x86': diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index b85842da..e8fd20b0 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -240,7 +240,7 @@ async def update_boot_linux(profiledir, profile, label): for initramfs in initrds: ipxeargs += " initrd=" + initramfs oum = os.umask(0o22) - ipout = os.open(profiledir + '/boot.ipxe', os.O_WRONLY|os.O_CREAT|os.O_TRUNC, 0o644) + ipout = os.open(profiledir + '/boot.ipxe.shim', os.O_WRONLY|os.O_CREAT|os.O_TRUNC, 0o644) ipxeout = os.fdopen(ipout, 'w') try: os.umask(oum) @@ -259,6 +259,17 @@ async def update_boot_linux(profiledir, profile, label): ipxeout.write('imgload kernel\nimgexec kernel\n') finally: ipxeout.close() + ipout = os.open(profiledir + '/boot.ipxe', os.O_WRONLY|os.O_CREAT|os.O_TRUNC, 0o644) + ipxeout = os.fdopen(ipout, 'w') + try: + os.umask(oum) + ipxeout.write('#!ipxe\n') + ipxeout.write('imgfetch boot/kernel ' + ipxeargs + '\n') + for initramfs in initrds: + ipxeout.write('imgfetch boot/initramfs/{0}\n'.format(initramfs)) + ipxeout.write('imgload kernel\nimgexec kernel\n') + finally: + ipxeout.close() await util.check_call( '/opt/confluent/bin/dir2img', '{0}/boot'.format(profiledir), '{0}/boot.img'.format(profiledir), profname, preexec_fn=relax_umask)