Fix issue #439: Boot to Windows installer not working in UEFI mode.

Copy /efi/boot/bootx64.efi (from Windows ISO) to /EFI/BOOT_WINDOWS/
bootx64.efi in usb (to avoid grub's /efi/boot/bootx64.efi). In UEFI
mode, chainload it instead of bootmgr.efi.
pull/460/head
Hoang-Anh Nguyen 5 years ago
parent 0b504f2a8c
commit 91f494c567

@ -34,14 +34,14 @@ if [ ${grub_platform} == "efi" ]; then
}
fi
if [ -e /bootmgr.efi ]; then
menuentry "Microsoft Windows Vista/7/8/8.1 UEFI Boot (bootmgr.efi)" {
if [ -e /EFI/BOOT_WINDOWS/bootx64.efi ]; then
menuentry "Microsoft Windows Vista/7/8/8.1 UEFI Boot (bootx64.efi)" {
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
# search --fs-uuid --set=root $hints_string $fs_uuid
chainloader /bootmgr.efi
chainloader /EFI/BOOT_WINDOWS/bootx64.efi
}
fi

@ -412,7 +412,13 @@ def update_distro_cfg_files(iso_link, usb_disk, distro, persistence=0):
shutil.copy2(resource_path(os.path.join("data", "EFI", "BOOT", "bootx64.efi")),
os.path.join(config.usb_mount, 'EFI', 'BOOT'))
elif gen.grub_efi_exist(efi_grub_img) is False:
gen.log('EFI image overwritten by distro install. Replacing it now...')
if distro == "Windows":
gen.log('EFI image overwritten by Windows install. Moving it now...')
dst = os.path.join(config.usb_mount, 'EFI', 'BOOT_WINDOWS')
os.makedirs(dst)
shutil.move(efi_grub_img, dst)
else:
gen.log('EFI image overwritten by distro install. Replacing it now...')
shutil.copy2(resource_path(os.path.join("data", "EFI", "BOOT", "bootx64.efi")),
os.path.join(config.usb_mount, 'EFI', 'BOOT'))
else:

Loading…
Cancel
Save