From 648290ffbc1e070fdeed7dbae3a50e59002cf4f8 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 27 Jan 2023 08:00:38 -0500 Subject: [PATCH] Begin implementing aarch64 deploy support --- confluent_osdeploy/el8/profiles/default/initprofile.sh | 8 ++++++-- confluent_server/bin/osdeploy | 9 +++++++++ confluent_server/confluent/discovery/protocols/pxe.py | 2 ++ confluent_server/confluent/osimage.py | 8 ++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/el8/profiles/default/initprofile.sh b/confluent_osdeploy/el8/profiles/default/initprofile.sh index d0125588..680ffda7 100644 --- a/confluent_osdeploy/el8/profiles/default/initprofile.sh +++ b/confluent_osdeploy/el8/profiles/default/initprofile.sh @@ -2,6 +2,10 @@ sed -i 's/centos/CentOS/; s/rhel/Red Hat Enterprise Linux/; s/oraclelinux/Oracle Linux/; s/alma/AlmaLinux/' $2/profile.yaml ln -s $1/images/pxeboot/vmlinuz $2/boot/kernel && \ ln -s $1/images/pxeboot/initrd.img $2/boot/initramfs/distribution -mkdir -p $2/boot/efi/boot && \ -ln -s $1/EFI/BOOT/BOOTX64.EFI $1/EFI/BOOT/grubx64.efi $2/boot/efi/boot/ +mkdir -p $2/boot/efi/boot +if [ -e $1/EFI/BOOT/BOOTAA64.EFI ]; then + ln -s $1/EFI/BOOT/BOOTAA64.EFI $1/EFI/BOOT/grubaa64.efi $2/boot/efi/boot/ +else + ln -s $1/EFI/BOOT/BOOTX64.EFI $1/EFI/BOOT/grubx64.efi $2/boot/efi/boot/ +fi diff --git a/confluent_server/bin/osdeploy b/confluent_server/bin/osdeploy index 052a5c3a..0f924d19 100644 --- a/confluent_server/bin/osdeploy +++ b/confluent_server/bin/osdeploy @@ -223,8 +223,17 @@ def install_tftp_content(): except OSError as e: if e.errno != 17: raise + armtftplocation = '{0}/confluent/aarch64'.format(tftplocation) + try: + os.makedirs(armtftplocation) + except OSError as e: + if e.errno != 17: + raise shutil.copy('/opt/confluent/lib/ipxe/ipxe.efi', tftplocation) shutil.copy('/opt/confluent/lib/ipxe/ipxe.kkpxe', tftplocation) + if os.path.exists('/opt/confluent/lib/ipxe/ipxe-aarch64.efi') + shutil.copy('/opt/confluent/lib/ipxe/ipxe-aarch64.efi', armtftplocation) + def initialize(cmdset): diff --git a/confluent_server/confluent/discovery/protocols/pxe.py b/confluent_server/confluent/discovery/protocols/pxe.py index baa73c1b..5e2716ce 100644 --- a/confluent_server/confluent/discovery/protocols/pxe.py +++ b/confluent_server/confluent/discovery/protocols/pxe.py @@ -365,6 +365,8 @@ def proxydhcp(handler, nodeguess): bootfile = b'confluent/x86_64/ipxe.efi' elif disco['arch'] == 'bios-x86': bootfile = b'confluent/x86_64/ipxe.kkpxe' + elif disco['arch'] == 'uefi-aarch64': + bootfile = b'confluent/aarch64/ipxe.efi' if len(bootfile) > 127: log.log( {'info': 'Boot offer cannot be made to {0} as the ' diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 8384913e..e914f636 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -376,6 +376,14 @@ def check_ubuntu(isoinfo): if not isinstance(arch, str): arch = arch.decode('utf8') major = '.'.join(ver.split('.', 2)[:2]) + if 'efi/boot/bootaa64.efi' in isoinfo[0]: + exlist = ['casper/vmlinuz', 'casper/initrd', + 'efi/boot/bootaa64.efi', 'efi/boot/grubaa64.efi' + ] + else: + exlist = ['casper/vmlinuz', 'casper/initrd', + 'efi/boot/bootx64.efi', 'efi/boot/grubx64.efi' + ] return {'name': 'ubuntu-{0}-{1}'.format(ver, arch), 'method': EXTRACT|COPY, 'extractlist': ['casper/vmlinuz', 'casper/initrd',