@@ -115,6 +115,13 @@ QEMU_CONFIG = {
115115 },
116116}
117117
118+ if platform .machine () in ['amd64' , 'x86_64' ]:
119+ architecture = 'amd64'
120+ elif platform .machine () in ['arm64' , 'aarch64' ]:
121+ architecture = 'arm64'
122+ else :
123+ raise ValueError ('Unsupported architecture!' )
124+
118125parser = argparse .ArgumentParser (description = 'Install and start a test VyOS vm.' )
119126parser .add_argument ('--iso' , help = 'ISO file to install' )
120127parser .add_argument ('--disk' , help = 'name of disk image file' , nargs = '?' )
@@ -212,13 +219,6 @@ def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False
212219 uuid = "f48b60b2-e6ad-49ef-9d09-4245d0585e52"
213220 accel = ',accel=kvm' if _kvm_exists () else ''
214221
215- if platform .machine () in ['amd64' , 'x86_64' ]:
216- architecture = 'amd64'
217- elif platform .machine () in ['arm64' , 'aarch64' ]:
218- architecture = 'arm64'
219- else :
220- raise ValueError ('Unsupported architecture!' )
221-
222222 qemu_arch_config = QEMU_CONFIG [architecture ]
223223 qemu_bin = qemu_arch_config ['bin' ]
224224 bios = qemu_arch_config ['bios' ]
@@ -232,6 +232,11 @@ def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False
232232 vga = '-vga virtio'
233233 vnc = '-vnc :0'
234234
235+ # There is no legacy BIOS on the arm64 QEMU machine - it always needs
236+ # firmware to boot, regardless of whether --uefi was requested.
237+ if architecture == 'arm64' :
238+ uefi = f'-bios { bios } '
239+
235240 if enable_uefi :
236241 uefi = f'-bios { bios } '
237242 name = f'{ name } -UEFI'
@@ -554,8 +559,12 @@ def BOOTLOADERchooseSerialConsole(child, live: bool) -> None:
554559 GRUB_STRING = r'GNU GRUB.*'
555560 ISOLINUX_STRING = r'ISOLINUX.*'
556561
562+ # There is no legacy BIOS on the arm64 QEMU machine - it always
563+ # loads UEFI firmware and jumps straight to GRUB.
564+ boots_uefi = args .uefi or architecture == 'arm64'
565+
557566 # XXX: UEFI systems directly load GRUB, BIOS systems fallback to ISOLINUX
558- if live and args . uefi :
567+ if live and boots_uefi :
559568 # Let UEFI start before GRUB
560569 child .expect (UEFI_STRING , timeout = BOOTLOADER_TMO )
561570 # Wait for GRUB
@@ -571,7 +580,7 @@ def BOOTLOADERchooseSerialConsole(child, live: bool) -> None:
571580 time .sleep (BOOTLOADER_SLEEP )
572581 # Boot
573582 child .send (KEY_RETURN )
574- elif live and not args . uefi :
583+ elif live and not boots_uefi :
575584 # Wait for ISOLINUX
576585 child .expect (ISOLINUX_STRING , timeout = BOOTLOADER_TMO )
577586 time .sleep (BOOTLOADER_LOAD_TMO )
@@ -586,11 +595,18 @@ def BOOTLOADERchooseSerialConsole(child, live: bool) -> None:
586595 child .send (KEY_RETURN )
587596 else :
588597 # Let UEFI start before GRUB
589- if args . uefi :
598+ if boots_uefi :
590599 child .expect (UEFI_STRING , timeout = BOOTLOADER_TMO )
591600
592601 # Wait for GRUB
593602 child .expect (GRUB_STRING , timeout = BOOTLOADER_TMO )
603+
604+ if architecture == 'arm64' :
605+ # arm64 only ships grub-efi, it uses "Select console type" as its own top-level entry.
606+ # The highlighted default entry already boots with the correct serial console
607+ # Just let it auto-boot instead of navigating this menu.
608+ return None
609+
594610 time .sleep (BOOTLOADER_LOAD_TMO )
595611
596612 # Select GRUB serial console
0 commit comments