-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Restore on UEFI hosts (#150) #151
base: release/xs8
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,11 @@ def restore_partitions(): | |
util.assertDir(os.path.dirname(dst_file)) | ||
boot_config.commit(dst_file) | ||
|
||
# prepare for boot loader restoration, before unmounting backup_fs | ||
if boot_config.src_fmt == 'grub2' and efi_boot: | ||
branding = util.readKeyValueFile(os.path.join(backup_fs.mount_point, constants.INVENTORY_FILE)) | ||
branding['product-brand'] = branding['PRODUCT_BRAND'] | ||
|
||
# repartition if needed | ||
backup_fs.unmount() | ||
if restore_partitions: | ||
|
@@ -209,8 +214,7 @@ def restore_partitions(): | |
# restore boot loader | ||
if boot_config.src_fmt == 'grub2': | ||
if efi_boot: | ||
branding = util.readKeyValueFile(os.path.join(backup_fs.mount_point, constants.INVENTORY_FILE)) | ||
branding['product-brand'] = branding['PRODUCT_BRAND'] | ||
mounts['esp'] = esp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you pointed out on https://github.com/xenserver/host-installer/pull/161/files, these solve the same issue |
||
backend.setEfiBootEntry(mounts, disk_device, boot_partnum, constants.INSTALL_TYPE_RESTORE, branding) | ||
else: | ||
if location == constants.BOOT_LOCATION_MBR: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just move this line inside the below
if
?We are restoring MBR so we won't have EFI to restore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly, but that rather looks like some improvement that can wait for later, here I'm solely focused on unbreaking the nominal case