anaconda: make sure the latest version is placed as xen.efi

os.listdir returns files in filesystem order, not sorted.

QubesOS/qubes-issues#2990
This commit is contained in:
Marek Marczykowski-Górecki 2017-09-21 22:10:04 +02:00
parent e3a4a46958
commit c834daa176
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1857,10 +1857,10 @@ class XenEFI(EFIGRUB):
if os.path.exists(xen_efi_target): if os.path.exists(xen_efi_target):
os.remove(xen_efi_target) os.remove(xen_efi_target)
xen_efi = [x for x in os.listdir(iutil.getSysroot() + self.config_dir) if xen_efi = [x for x in sorted(os.listdir(iutil.getSysroot() + self.config_dir)) if
x.startswith('xen-') and x.endswith('.efi')][0] x.startswith('xen-') and x.endswith('.efi')][-1]
shutil.copy("{}/{}".format(iutil.getSysroot() + self.config_dir, xen_efi), shutil.copy("{}/{}".format(iutil.getSysroot() + self.config_dir, xen_efi),
"{}/{}".format(iutil.getSysroot() + self.config_dir, "xen.efi")) xen_efi_target)
rc = self.efibootmgr("-c", "-w", "-L", productName, rc = self.efibootmgr("-c", "-w", "-L", productName,
"-d", boot_disk.path, "-p", boot_part_num, "-d", boot_disk.path, "-p", boot_part_num,
"-l", "-l",