From 53204d90309574fddbb0576d7a153657996eef33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 19 Oct 2018 08:02:12 +0200 Subject: [PATCH] anaconda: make sure the latest version is placed as xen.efi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit os.listdir returns files in filesystem order, not sorted. QubesOS/qubes-issues#2990 Signed-off-by: Frédéric Pierret --- pyanaconda/bootloader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py index 27c7ed34a..ad8e8c2e7 100644 --- a/pyanaconda/bootloader.py +++ b/pyanaconda/bootloader.py @@ -1856,10 +1856,10 @@ class XenEFI(EFIGRUB): if os.path.exists(xen_efi_target): os.remove(xen_efi_target) - xen_efi = [x for x in os.listdir(iutil.getSysroot() + self.config_dir) if - x.startswith('xen-') and x.endswith('.efi')][0] + xen_efi = [x for x in sorted(os.listdir(iutil.getSysroot() + self.config_dir)) if + x.startswith('xen-') and x.endswith('.efi')][-1] 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, "-d", boot_disk.path, "-p", boot_part_num, "-l", -- 2.14.4