| 692 | |
| 693 | self._initrd_arch = self._qemu_arch = 'x86_64' |
| 694 | |
| 695 | def run(self) -> None: |
| 696 | if not self.use_kvm: |
| 697 | self._qemu_args += ['-cpu', 'Nehalem'] |
| 698 | |
| 699 | if self.efi: |
| 700 | usr_share = Path('/usr/share') |
| 701 | ovmf_locations = [ |
| 702 | Path('edk2/x64/OVMF_CODE.fd'), # Arch Linux (current), Fedora |
| 703 | Path('edk2-ovmf/x64/OVMF_CODE.fd'), # Arch Linux (old) |
| 704 | Path('OVMF/OVMF_CODE.fd'), # Debian and Ubuntu |
| 705 | ] |
| 706 | self._efi_img = utils.find_first_file(usr_share, ovmf_locations) |
| 707 | |
| 708 | ovmf_vars_locations = [ |
| 709 | Path('edk2/x64/OVMF_VARS.fd'), # Arch Linux and Fedora |
| 710 | Path('OVMF/OVMF_VARS.fd'), # Debian and Ubuntu |
| 711 | ] |
| 712 | ovmf_vars = utils.find_first_file(usr_share, ovmf_vars_locations) |
| 713 | self._efi_vars = Path(utils.BOOT_UTILS, 'images', self._initrd_arch, ovmf_vars.name) |
| 714 | # This file is in /usr/share, so it must be copied in order to be |
| 715 | # modified. |
| 716 | shutil.copyfile(ovmf_vars, self._efi_vars) |
| 717 | |
| 718 | super().run() |
| 719 | |
| 720 | |