Skip to content

Commit

Permalink
Merge pull request #29 from xcp-ng/for-xs/fix-150
Browse files Browse the repository at this point in the history
Fix UEFI Restore
  • Loading branch information
ydirson authored Jul 3, 2024
2 parents dfb85dc + 9b63a88 commit 1a2a73f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
backend.setEfiBootEntry(mounts, disk_device, boot_partnum, constants.INSTALL_TYPE_RESTORE, branding)
else:
if location == constants.BOOT_LOCATION_MBR:
Expand Down

0 comments on commit 1a2a73f

Please sign in to comment.