Skip to contentSkip to conversation

xen: Create EFI_VENDOR directory

PATCH In review Jason Andryuk 6 participants 17 messages Mar 22, 2021 – Mar 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: Create EFI_VENDOR directory

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

---
 xen/Makefile | 1 +
 1 file changed, 1 insertion(+)
xen/Makefile +1 -0
index 0b97e459e2..f372b44de3 100644
@@ -289,6 +289,7 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
 		ln -sf $(T)-$(XEN_FULLVERSION).efi $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).efi; \
 		ln -sf $(T)-$(XEN_FULLVERSION).efi $(D)$(EFI_DIR)/$(T).efi; \
 		if [ -n '$(EFI_MOUNTPOINT)' -a -n '$(EFI_VENDOR)' ]; then \
+			$(INSTALL_DIR) $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR); \
 			$(INSTALL_DATA) $(TARGET).efi $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi; \
 		elif [ "$(D)" = "$(patsubst $(shell cd $(XEN_ROOT) && pwd)/%,%,$(D))" ]; then \
 			echo 'EFI installation only partially done (EFI_VENDOR not set)' >&2; \
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw

Re: for-4.15 [PATCH] xen: Create EFI_VENDOR directory

Quoted 9 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

This wants backporting, and should be considered for 4.15 at this point.

#2 lore raw
In reply to Jason Andryuk

Jason Andryuk writes ("[PATCH] xen: Create EFI_VENDOR directory"):

Quoted 7 lines

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

I reviewed this.

Presuming someone else also reviews it. Andy, was your Acked-by a Reviewed-by ?

Ian.

#3 lore raw
In reply to Jason Andryuk
Quoted 7 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

Jan

#4 lore raw
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

Quoted 8 lines
Quoted 2 lines

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

This reasoning is broken for anything other make install DESTDIR=/ on a live system.

It is incompatible with how RPM, deb, etc packages work.

~Andrew

#5 lore raw
Quoted 16 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

Quoted 8 lines
Quoted 2 lines

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

Quoted 4 lines

This reasoning is broken for anything other make install DESTDIR=/ on a live system.

It is incompatible with how RPM, deb, etc packages work.

I'm afraid I don't understand, for both of your statements. If distro installation put in place the designated directory, there wouldn't be any live system lacking it, and there wouldn't be any concern in the packaging of any software.

To take a perhaps too extreme example - packages typically expect e.g. /usr to exist as well, don't they?

Jan

#6 lore raw
Quoted 9 lines · Jan Beulich
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

I didn't write this for an rpm xen.spec - I just cross referenced out of curiosity.

Quoted 5 lines
Quoted 4 lines

This reasoning is broken for anything other make install DESTDIR=/ on a live system.

It is incompatible with how RPM, deb, etc packages work.

Quoted 7 lines

I'm afraid I don't understand, for both of your statements. If distro installation put in place the designated directory, there wouldn't be any live system lacking it, and there wouldn't be any concern in the packaging of any software.

To take a perhaps too extreme example - packages typically expect e.g. /usr to exist as well, don't they?

But you have to install -d ${D}/usr before install ${D}/usr/file, right?

It's a surprising sequence to:
1) see 'EFI installation only partially done (EFI_VENDOR not set)'
2) set EFI_VENDOR
3) see xen.efi installation fail

I was working on a fedora system, and I was using make && sh install.sh to install (but be sure to rm -r dist/install/var/run since otherwise that'll break booting). I wanted xen.efi to end up in /boot/efi/EFI/fedora after running sh install.sh, and EFI_VENDOR appeared to be the way to do it. Again, it was surprising to enable an option and then have it break.

Regards,
Jason

#7 lore raw
Quoted 32 lines · Jason Andryuk
Quoted 9 lines · Jan Beulich
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

I didn't write this for an rpm xen.spec - I just cross referenced out of curiosity.

Quoted 10 lines
Quoted 4 lines

This reasoning is broken for anything other make install DESTDIR=/ on a live system.

It is incompatible with how RPM, deb, etc packages work.

I'm afraid I don't understand, for both of your statements. If distro installation put in place the designated directory, there wouldn't be any live system lacking it, and there wouldn't be any concern in the packaging of any software.

Quoted 4 lines
Quoted 2 lines

To take a perhaps too extreme example - packages typically expect e.g. /usr to exist as well, don't they?

But you have to install -d ${D}/usr before install ${D}/usr/file, right?

Sure, but I take it that about every package can rely on it to be there, and not have to take care of creating it. There ought to be an "owning" package for that directory, and that's the package responsible for creating it. The same would then go for wherever you want xen.efi to go.

Quoted 11 lines

It's a surprising sequence to:
1) see 'EFI installation only partially done (EFI_VENDOR not set)'
2) set EFI_VENDOR
3) see xen.efi installation fail

I was working on a fedora system, and I was using make && sh install.sh to install (but be sure to rm -r dist/install/var/run since otherwise that'll break booting). I wanted xen.efi to end up in /boot/efi/EFI/fedora after running sh install.sh, and EFI_VENDOR appeared to be the way to do it. Again, it was surprising to enable an option and then have it break.

Well - the thing is that according to my understanding you don't simply pick a directory name of your liking, but you use the one your distro uses. Otherwise I consider it quite likely that upon next re-building of the EFI partition your binary won't be put back.

Jan

#8 lore raw
In reply to Jan Beulich
Quoted 19 lines · Jan Beulich
Quoted 18 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

Quoted 8 lines
Quoted 2 lines

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

This reasoning is broken for anything other make install DESTDIR=/ on a live system.

Quoted 8 lines
Quoted 1 line

It is incompatible with how RPM, deb, etc packages work.

I'm afraid I don't understand, for both of your statements. If distro installation put in place the designated directory, there wouldn't be any live system lacking it, and there wouldn't be any concern in the packaging of any software.

To take a perhaps too extreme example - packages typically expect e.g. /usr to exist as well, don't they?

No.  A buildroot starts out fully empty, by design.

The packaging environment (usually a chroot) invokes make install DESTDIR=/path/to/staging/root so you don't interfere with any of the tools inside the environment, and the resulting tar/cpio has the buildroot stripped out of paths.

The failure being discussed here is the build within the packaging environment, not the metadata which forms the final package.  Installing a deb/rpm/etc will make directories as applicable.

~Andrew

#9 lore raw
Quoted 31 lines · Andrew Cooper
Quoted 19 lines · Jan Beulich
Quoted 18 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

Quoted 8 lines
Quoted 2 lines

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

This reasoning is broken for anything other make install DESTDIR=/ on a live system.

Quoted 8 lines
Quoted 1 line

It is incompatible with how RPM, deb, etc packages work.

I'm afraid I don't understand, for both of your statements. If distro installation put in place the designated directory, there wouldn't be any live system lacking it, and there wouldn't be any concern in the packaging of any software.

To take a perhaps too extreme example - packages typically expect e.g. /usr to exist as well, don't they?

No.  A buildroot starts out fully empty, by design.

Quoted 8 lines

The packaging environment (usually a chroot) invokes make install DESTDIR=/path/to/staging/root so you don't interfere with any of the tools inside the environment, and the resulting tar/cpio has the buildroot stripped out of paths.

The failure being discussed here is the build within the packaging environment, not the metadata which forms the final package.  Installing a deb/rpm/etc will make directories as applicable.

Ah, I see. But then this _still_ isn't the right thing to do. In fact, the package build and installation shouldn't put xen.efi in the EFI partition _at all_. The build system doing so is for developers only, so they don't need to invoke boot loader configuration every time they rebuild and re-install. Hence the packaging build shouldn't set EFI_VENDOR in the first place. There it instead should be a subsequent boot loader re-configuration which picks up xen.efi from its install location (under $(EFI_DIR)) and places it on the EFI partition.

With the above I take back my "I'm not strictly against" - I'm pretty firmly against. If the warning emitted is deemed a problem, I'm sure we can find a way to silence it.

Jan

#10 lore raw
Quoted 42 lines · Jan Beulich
Quoted 31 lines · Andrew Cooper
Quoted 19 lines · Jan Beulich
Quoted 18 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

Quoted 8 lines
Quoted 2 lines

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

This reasoning is broken for anything other make install DESTDIR=/ on a live system.

Quoted 8 lines
Quoted 1 line

It is incompatible with how RPM, deb, etc packages work.

I'm afraid I don't understand, for both of your statements. If distro installation put in place the designated directory, there wouldn't be any live system lacking it, and there wouldn't be any concern in the packaging of any software.

To take a perhaps too extreme example - packages typically expect e.g. /usr to exist as well, don't they?

No. A buildroot starts out fully empty, by design.

Quoted 8 lines

The packaging environment (usually a chroot) invokes make install DESTDIR=/path/to/staging/root so you don't interfere with any of the tools inside the environment, and the resulting tar/cpio has the buildroot stripped out of paths.

The failure being discussed here is the build within the packaging environment, not the metadata which forms the final package. Installing a deb/rpm/etc will make directories as applicable.

Quoted 8 lines

Ah, I see. But then this _still_ isn't the right thing to do. In fact, the package build and installation shouldn't put xen.efi in the EFI partition _at all_. The build system doing so is for developers only, so they don't need to invoke boot loader configuration every time they rebuild and re-install. Hence the packaging build shouldn't set EFI_VENDOR in the first place. There it instead should be a subsequent boot loader re-configuration which picks up xen.efi from its install location (under $(EFI_DIR)) and places it on the EFI partition.

On Fedora, RPMs drop EFI binaries directly into /boot/efi/EFI/fedora/. grub, shim, fwupdate and xen are all packaged that way. It seems reasonable to have those important binaries tracked by the package manager.

Does SuSE populate EFI_VENDOR from EFI_DIR when some boot loader script is called?

I think Xen's population of EFI_VENDOR is sensible and fine. Plus it's *used*. I don't see why it needs to be removed. I was just trying to fix a bug.

Regards,
Jason

#11 lore raw
Quoted 52 lines · Jason Andryuk
Quoted 42 lines · Jan Beulich
Quoted 31 lines · Andrew Cooper
Quoted 19 lines · Jan Beulich
Quoted 18 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file '/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Create the EFI_VENDOR directory so xen.efi can be installed within.

Quoted 8 lines
Quoted 2 lines

This removes the need for Fedora and Qubes xen.spec files to manually create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

This reasoning is broken for anything other make install DESTDIR=/ on a live system.

Quoted 8 lines
Quoted 1 line

It is incompatible with how RPM, deb, etc packages work.

I'm afraid I don't understand, for both of your statements. If distro installation put in place the designated directory, there wouldn't be any live system lacking it, and there wouldn't be any concern in the packaging of any software.

To take a perhaps too extreme example - packages typically expect e.g. /usr to exist as well, don't they?

No. A buildroot starts out fully empty, by design.

Quoted 8 lines

The packaging environment (usually a chroot) invokes make install DESTDIR=/path/to/staging/root so you don't interfere with any of the tools inside the environment, and the resulting tar/cpio has the buildroot stripped out of paths.

The failure being discussed here is the build within the packaging environment, not the metadata which forms the final package. Installing a deb/rpm/etc will make directories as applicable.

Quoted 8 lines

Ah, I see. But then this _still_ isn't the right thing to do. In fact, the package build and installation shouldn't put xen.efi in the EFI partition _at all_. The build system doing so is for developers only, so they don't need to invoke boot loader configuration every time they rebuild and re-install. Hence the packaging build shouldn't set EFI_VENDOR in the first place. There it instead should be a subsequent boot loader re-configuration which picks up xen.efi from its install location (under $(EFI_DIR)) and places it on the EFI partition.

Quoted 7 lines

On Fedora, RPMs drop EFI binaries directly into /boot/efi/EFI/fedora/. grub, shim, fwupdate and xen are all packaged that way. It seems reasonable to have those important binaries tracked by the package manager.

Does SuSE populate EFI_VENDOR from EFI_DIR when some boot loader script is called?

Yes. And back at the time, when I consulted our EFI person, I was left with the impression that this is the only reasonable approach. The primary reason, as said, was that the EFI partition as a whole may get rebuilt perhaps even from scratch at any point. Hence it's not reasonable to expect package-managed files to live there. (This is also expressed by us installing xen.efi into two places, which ought to be a clear indication by itself that one of them is only to ease things, not for packaging.)

As indicated - if the error is confusing, let's try to address it by, perhaps, covering the case of the directory not existing also via the "partially done" message. And the message, should that also be deemed confusing, could maybe be dropped - I wouldn't be happy about it, but if e.g. it was replaced by one reporting the secondary install step was actually done, this would look acceptable.

Jan

#12 lore raw

Jan Beulich writes ("Re: [PATCH] xen: Create EFI_VENDOR directory"):

Quoted 1 line · Jason Andryuk

...

Quoted 5 lines
Quoted 5 lines

On Fedora, RPMs drop EFI binaries directly into /boot/efi/EFI/fedora/. grub, shim, fwupdate and xen are all packaged that way. It seems reasonable to have those important binaries tracked by the package manager.

Quoted 8 lines
Quoted 2 lines

Does SuSE populate EFI_VENDOR from EFI_DIR when some boot loader script is called?

Yes. And back at the time, when I consulted our EFI person, I was left with the impression that this is the only reasonable approach. The primary reason, as said, was that the EFI partition as a whole may get rebuilt perhaps even from scratch at any point. Hence it's not reasonable to expect package-managed files to live there.

I agree with this analysis but it is for people like Fedora to decide how they want to build their packages.

There is also the case of ad-hoc packages (eg our "make debball") which the user might reasonably choose to have dump things in the EFI system partition.

Conversely, I see no downside to the mkdir. Jan, is there some actual harm in it ? If not, we should be accomodating to people's build and packaging strategies even if we don't entirely approve of them.

Thanks,
Ian.

#13 lore raw
Quoted 17 lines · Ian Jackson

Jan Beulich writes ("Re: [PATCH] xen: Create EFI_VENDOR directory"):

Quoted 1 line · Jason Andryuk

...

Quoted 5 lines
Quoted 5 lines

On Fedora, RPMs drop EFI binaries directly into /boot/efi/EFI/fedora/. grub, shim, fwupdate and xen are all packaged that way. It seems reasonable to have those important binaries tracked by the package manager.

Quoted 8 lines
Quoted 2 lines

Does SuSE populate EFI_VENDOR from EFI_DIR when some boot loader script is called?

Yes. And back at the time, when I consulted our EFI person, I was left with the impression that this is the only reasonable approach. The primary reason, as said, was that the EFI partition as a whole may get rebuilt perhaps even from scratch at any point. Hence it's not reasonable to expect package-managed files to live there.

Quoted 6 lines

I agree with this analysis but it is for people like Fedora to decide how they want to build their packages.

There is also the case of ad-hoc packages (eg our "make debball") which the user might reasonably choose to have dump things in the EFI system partition.

Well, it that's deemed reasonable, then perhaps yes. Albeit such ad-hoc packaging could then also involve the creation of that dir.

Quoted 3 lines

Conversely, I see no downside to the mkdir. Jan, is there some actual harm in it ? If not, we should be accomodating to people's build and packaging strategies even if we don't entirely approve of them.

"Actual harm" is relative: Nothing's going to break afaict. There'll be a leftover dir from an install immediately followed by an uninstall. I consider such okay for the purpose of the install step that I did outline; I wouldn't consider it okay for a package install/uninstall. But nothing worse, I guess. So bottom line - my objection is not to be taken as a NAK. If everyone else wants the change, then so be it.

Jan

#14 lore raw
In reply to Ian Jackson
Quoted 20 lines · Ian Jackson

Jan Beulich writes ("Re: [PATCH] xen: Create EFI_VENDOR directory"):

Quoted 1 line · Jason Andryuk

...

Quoted 5 lines
Quoted 5 lines

On Fedora, RPMs drop EFI binaries directly into /boot/efi/EFI/fedora/. grub, shim, fwupdate and xen are all packaged that way. It seems reasonable to have those important binaries tracked by the package manager.

Quoted 8 lines
Quoted 2 lines

Does SuSE populate EFI_VENDOR from EFI_DIR when some boot loader script is called?

Yes. And back at the time, when I consulted our EFI person, I was left with the impression that this is the only reasonable approach. The primary reason, as said, was that the EFI partition as a whole may get rebuilt perhaps even from scratch at any point. Hence it's not reasonable to expect package-managed files to live there.

I agree with this analysis but it is for people like Fedora to decide how they want to build their packages.

Quoted 7 lines

There is also the case of ad-hoc packages (eg our "make debball") which the user might reasonably choose to have dump things in the EFI system partition.

Conversely, I see no downside to the mkdir. Jan, is there some actual harm in it ? If not, we should be accomodating to people's build and packaging strategies even if we don't entirely approve of them.

There is a request in https://bugzilla.redhat.com/show_bug.cgi?id=1750733 for xen on Fedora to install the efi file elsewhere and then copy it to /boot/efi post install. I could change the current Fedora set up for Fedora 35 (which should have xen-4.15) if there is a good reason to do so. I am not sure how useful the xen.efi file in /boot/efi is anyway for the the Fedora set up as it will generally use a xen*.gz file in /boot via grub.

Michael Young

#15 lore raw
Quoted 32 lines · Michael Young
Quoted 20 lines · Ian Jackson

Jan Beulich writes ("Re: [PATCH] xen: Create EFI_VENDOR directory"):

Quoted 1 line · Jason Andryuk

...

Quoted 5 lines
Quoted 5 lines

On Fedora, RPMs drop EFI binaries directly into /boot/efi/EFI/fedora/. grub, shim, fwupdate and xen are all packaged that way. It seems reasonable to have those important binaries tracked by the package manager.

Quoted 8 lines
Quoted 2 lines

Does SuSE populate EFI_VENDOR from EFI_DIR when some boot loader script is called?

Yes. And back at the time, when I consulted our EFI person, I was left with the impression that this is the only reasonable approach. The primary reason, as said, was that the EFI partition as a whole may get rebuilt perhaps even from scratch at any point. Hence it's not reasonable to expect package-managed files to live there.

I agree with this analysis but it is for people like Fedora to decide how they want to build their packages.

Quoted 7 lines

There is also the case of ad-hoc packages (eg our "make debball") which the user might reasonably choose to have dump things in the EFI system partition.

Conversely, I see no downside to the mkdir. Jan, is there some actual harm in it ? If not, we should be accomodating to people's build and packaging strategies even if we don't entirely approve of them.

Quoted 8 lines

There is a request in https://bugzilla.redhat.com/show_bug.cgi?id=1750733
for xen on Fedora to install the efi file elsewhere and then copy it to /boot/efi post install. I could change the current Fedora set up for Fedora 35 (which should have xen-4.15) if there is a good reason to do so. I am not sure how useful the xen.efi file in /boot/efi is anyway for the the Fedora set up as it will generally use a xen*.gz file in /boot via grub.

FWIW: /boot as the source of truth and EFI partition as a cache for that is also what we've settled on in EVE distro.

As a somewhat unrelated side-note: on ARM at least, with u-boot playing the role of UEFI more and more -- we can actually pick EFI payloads straight from source of truth and completely by-pass EFI partition altogether (which is fine -- it is, after all, only a cache).

Thanks,
Roman.

#16 lore raw
In reply to Jan Beulich
Quoted 66 lines · Jan Beulich
Quoted 9 lines · Jason Andryuk
Quoted 8 lines · Jan Beulich
Quoted 6 lines · Andrew Cooper
Quoted 5 lines · Jan Beulich
Quoted 4 lines · Andrew Cooper
Quoted 3 lines · Jan Beulich
Quoted 2 lines · Jason Andryuk

make install-xen fails when EFI_VENDOR is set (=fedora) with:
install: cannot create regular file

'/home/user/xen/dist/install/boot/efi/efi/fedora/xen-4.15.0-rc.efi': No such file or directory

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Create the EFI_VENDOR directory so xen.efi can be installed within.

This removes the need for Fedora and Qubes xen.spec files to

manually

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 1 line

create the directory in advance.

While I'm not strictly against, I'd like to point out that it was deliberate to not create this directory here. I also didn't expect anyone's xen.spec to do so. Instead I'd expect the distro to create it during OS installation. If this was a bad assumption, I'd prefer if the commit message here could point out why such an expectation won't hold in general.

This reasoning is broken for anything other make install DESTDIR=/

on

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 10 lines
Quoted 3 lines

a live system.

It is incompatible with how RPM, deb, etc packages work.

I'm afraid I don't understand, for both of your statements. If distro installation put in place the designated directory, there wouldn't be any live system lacking it, and there wouldn't be any concern in the packaging of any software.

To take a perhaps too extreme example - packages typically expect e.g. /usr to exist as well, don't they?

No. A buildroot starts out fully empty, by design.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The packaging environment (usually a chroot) invokes make install DESTDIR=/path/to/staging/root so you don't interfere with any of the tools inside the environment, and the resulting tar/cpio has the buildroot stripped out of paths.

The failure being discussed here is the build within the packaging environment, not the metadata which forms the final package.

Installing

Quoted 11 lines
Quoted 10 lines
Quoted 1 line

a deb/rpm/etc will make directories as applicable.

Ah, I see. But then this _still_ isn't the right thing to do. In fact, the package build and installation shouldn't put xen.efi in the EFI partition _at all_. The build system doing so is for developers only, so they don't need to invoke boot loader configuration every time they rebuild and re-install. Hence the packaging build shouldn't set EFI_VENDOR in the first place. There it instead should be a subsequent boot loader re-configuration which picks up xen.efi from its install location (under $(EFI_DIR)) and places it on the EFI partition.

Quoted 7 lines

On Fedora, RPMs drop EFI binaries directly into /boot/efi/EFI/fedora/. grub, shim, fwupdate and xen are all packaged that way. It seems reasonable to have those important binaries tracked by the package manager.

Does SuSE populate EFI_VENDOR from EFI_DIR when some boot loader script is called?

Quoted 9 lines

Yes. And back at the time, when I consulted our EFI person, I was left with the impression that this is the only reasonable approach. The primary reason, as said, was that the EFI partition as a whole may get rebuilt perhaps even from scratch at any point. Hence it's not reasonable to expect package-managed files to live there. (This is also expressed by us installing xen.efi into two places, which ought to be a clear indication by itself that one of them is only to ease things, not for packaging.)

Big +1 to the above -- in running our own distro we've come to appreciate that very point -- EFI partition is basically a cache and the source of truth
is always elsewhere.

Thanks,
Roman.