mirror of
https://github.com/xcat2/confluent.git
synced 2026-10-20 14:45:45 +00:00
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.
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user