Skip to content
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

[xs8] "restore" with UEFI is broken #150

Open
ydirson opened this issue Jul 3, 2024 · 3 comments · Fixed by #161
Open

[xs8] "restore" with UEFI is broken #150

ydirson opened this issue Jul 3, 2024 · 3 comments · Fixed by #161
Assignees

Comments

@ydirson
Copy link
Contributor

ydirson commented Jul 3, 2024

In https://github.com/xenserver/host-installer/blob/release/xs8/restore.py#L196-L212 we see backup_fs being unmounted and then used, resulting in the crash shown below.

Problem was introduced in v10.10.14 with e9d686a#diff-2f9ea690c2cdc310e67485fde6a0d74fd91f25e9ac5f5bc6054961b742de74a8R193 (with a commit that does not exist on master)

INFO     [2024-07-03 08:01:07] Data restoration complete.  About to re-install bootloader.
INFO     [2024-07-03 08:01:07] Unmounting /tmp/restore-backup-cRo2Wv (force = False)
INFO     [2024-07-03 08:01:07] ran ['/bin/umount', '-d', '/tmp/restore-backup-cRo2Wv']; rc 0
...
INFO     [2024-07-03 08:01:08] INSTALL FAILED.
INFO     [2024-07-03 08:01:08] A fatal exception occurred:
INFO     [2024-07-03 08:01:08] Traceback (most recent call last):
  File "/opt/xensource/installer/install.py", line 269, in go
    restore.restoreFromBackup(backup, progress)
  File "/opt/xensource/installer/restore.py", line 212, in restoreFromBackup
    branding = util.readKeyValueFile(os.path.join(backup_fs.mount_point, constants.INVENTORY_FILE))
  File "/opt/xensource/installer/util.py", line 322, in readKeyValueFile
    f = open(filename, "r")
IOError: [Errno 2] No such file or directory: '/tmp/restore-backup-cRo2Wv/etc/xensource-inventory'
@freddy77
Copy link
Collaborator

freddy77 commented Jul 3, 2024

Yes, we should probably get the "branding" before unmounting the backup file system.

ydirson added a commit to xcp-ng/host-installer that referenced this issue Jul 3, 2024
This fixes a regression introduced in e9d686a.

This is not sufficient however to get Restore to work un UEFI, as
setEfiBootEntry() assumes `mounts['efi']` is populated, which is not
the case (only `backend.mountVolumes()` would set that).

Signed-off-by: Yann Dirson <[email protected]>
ydirson added a commit to xcp-ng/host-installer that referenced this issue Jul 3, 2024
This fixes a regression introduced in e9d686a.

This is not sufficient however to get Restore to work un UEFI, as
setEfiBootEntry() assumes `mounts['efi']` is populated, which is not
the case (only `backend.mountVolumes()` would set that).

Signed-off-by: Yann Dirson <[email protected]>
@ydirson
Copy link
Contributor Author

ydirson commented Jul 3, 2024

As noted in #151 this is not the only problem in the UEFI code path.

@GeraldEV
Copy link
Collaborator

GeraldEV commented Oct 4, 2024

Re-opening as this needs to be resolved in XS8 too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants