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

installer should replace /boot/efi/qubes/xen.efi if it exists #2990

Closed
freddierice opened this Issue Aug 8, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@freddierice

freddierice commented Aug 8, 2017

Qubes OS version (e.g., R3.2):

R4.0-rc1

Affected TemplateVMs (e.g., fedora-23, if applicable):

n/a


Expected behavior:

/boot/efi/qubes/xen.efi should be updated to the newest efi file.

Actual behavior:

If the file /boot/efi/qubes/xen.efi already exists (i.e. from a previous install of qubes), it will not get replaced with a newer version.

Steps to reproduce the behavior:

  1. Install Qubes 3.2 with automatic partitioning.
  2. Remove the LUKS partition.
  3. Install Qubes 4.0-rc1 with automatic partitioning

General notes:

I found the source of the error in anaconda/pyanaconda/bootloader.py on line 1855:

        if not os.path.exists(
                "{}/{}".format(iutil.getSysroot() + self.config_dir, "xen.efi")):
            xen_efi = [x for x in os.listdir(iutil.getSysroot() + self.config_dir) if
                       x.startswith('xen-') and x.endswith('.efi')][0]
            shutil.copy("{}/{}".format(iutil.getSysroot() + self.config_dir, xen_efi),
                        "{}/{}".format(iutil.getSysroot() + self.config_dir, "xen.efi"))
        rc = self.efibootmgr("-c", "-w", "-L", productName,
                             "-d", boot_disk.path, "-p", boot_part_num,
                             "-l",
                             self.efi_dir_as_efifs_dir + "\\xen.efi",
                             root=iutil.getSysroot())

The newest xen.efi does not get copied if an older one exists.

Related issues:

In the specific case of upgrading from Qubes 3.2 to 4.0, there is a switch from Xen 4.6 to 4.8, which in turn caused countless errors in the interaction between the Xen tooling and the Xen HVM.

@freddierice freddierice changed the title from Install Fails to installer should replace /boot/efi/qubes/xen.efi if it exists Aug 8, 2017

@andrewdavidwong andrewdavidwong added this to the Release 4.0 milestone Aug 9, 2017

@freddierice

This comment has been minimized.

Show comment
Hide comment
@freddierice

freddierice Sep 20, 2017

I'd like to contribute, but there are a couple of ways that this issue could be fixed.

  1. Allow for both qubes 3.2 and qubes 4.0 compatible xen.efi to exist (i.e. name the 4.0-rc1 compatible xen.efi something like /boot/efi/qubes/4.0-rc1.efi)
  2. Overwrite the previous xen.efi, breaking qubes 3.2.

Realistically, a user should only have one version of qubes on their computer. If 2) is the expected behavior, then the user should be notified in the installer.

Thoughts?

I'd like to contribute, but there are a couple of ways that this issue could be fixed.

  1. Allow for both qubes 3.2 and qubes 4.0 compatible xen.efi to exist (i.e. name the 4.0-rc1 compatible xen.efi something like /boot/efi/qubes/4.0-rc1.efi)
  2. Overwrite the previous xen.efi, breaking qubes 3.2.

Realistically, a user should only have one version of qubes on their computer. If 2) is the expected behavior, then the user should be notified in the installer.

Thoughts?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Sep 20, 2017

Member

I think it should be 2). One subdirectory in /boot/efi/EFI should be used only by one OS. It isn't only about xen.efi, but also xen.cfg, kernel, initrd.

BTW there is a way to have multiple Qubes instances at the same machine - using different subdirectories in /boot/efi/EFI. There is no UI for that, but you can manually copy/rename "qubes" to for example "qubes3.2", "qubes4" etc, then use efibootmgr to adjust boot entries. I don't think we need to support this automatically.

Member

marmarek commented Sep 20, 2017

I think it should be 2). One subdirectory in /boot/efi/EFI should be used only by one OS. It isn't only about xen.efi, but also xen.cfg, kernel, initrd.

BTW there is a way to have multiple Qubes instances at the same machine - using different subdirectories in /boot/efi/EFI. There is no UI for that, but you can manually copy/rename "qubes" to for example "qubes3.2", "qubes4" etc, then use efibootmgr to adjust boot entries. I don't think we need to support this automatically.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Sep 21, 2017

Member

Actually I'm surprised this happens, because installation of xen-hypevisor package should replace xen.efi. See here:
https://github.com/QubesOS/qubes-vmm-xen/blob/d48f41f123f33387fa5691231466be3e38ea7c16/xen.spec#L533-L549

Anyway, I'm going to merge the current fix, until the code above start working again.

Member

marmarek commented Sep 21, 2017

Actually I'm surprised this happens, because installation of xen-hypevisor package should replace xen.efi. See here:
https://github.com/QubesOS/qubes-vmm-xen/blob/d48f41f123f33387fa5691231466be3e38ea7c16/xen.spec#L533-L549

Anyway, I'm going to merge the current fix, until the code above start working again.

marmarek added a commit to marmarek/qubes-installer-qubes-os that referenced this issue Sep 21, 2017

anaconda: make sure the latest version is placed as xen.efi
os.listdir returns files in filesystem order, not sorted.

QubesOS/qubes-issues#2990

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Oct 8, 2017

Closed

installer-qubes-os v25.20.9-7-anaconda (r4.0) #257

@marmarek marmarek closed this Oct 17, 2017

marmarek added a commit to marmarek/qubes-installer-qubes-os that referenced this issue Dec 25, 2017

anaconda: make sure the latest version is placed as xen.efi
os.listdir returns files in filesystem order, not sorted.

QubesOS/qubes-issues#2990

(cherry picked from commit c834daa)

fepitre added a commit to fepitre/qubes-installer-qubes-os that referenced this issue Dec 29, 2017

anaconda: make sure the latest version is placed as xen.efi
os.listdir returns files in filesystem order, not sorted.

QubesOS/qubes-issues#2990

fepitre added a commit to fepitre/qubes-installer-qubes-os that referenced this issue Dec 30, 2017

anaconda: make sure the latest version is placed as xen.efi
os.listdir returns files in filesystem order, not sorted.

QubesOS/qubes-issues#2990

marmarek added a commit to marmarek/qubes-installer-qubes-os that referenced this issue Jan 15, 2018

anaconda: make sure the latest version is placed as xen.efi
os.listdir returns files in filesystem order, not sorted.

QubesOS/qubes-issues#2990

(cherry picked from commit c834daa)

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Jul 14, 2018

Closed

installer-qubes-os v3.2-2-qubes-release (r3.2) #582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment