stages: add efi_src_dir config to grub2.iso stage#2202
Conversation
|
Is this bootupd path an implementation detail or documented that this is the path that will contain EFI binaries? It doesn't matter much since we can pick the source by users of this stage but it would be nice to know if this is 'the right place' :) |
You mean this path |
4cffab0 to
afd4709
Compare
afd4709 to
c3a636a
Compare
achilleas-k
left a comment
There was a problem hiding this comment.
Ondrej is right. Regardless, this LGTM :)
c3a636a to
b644dd8
Compare
We currently hardcode the location of the efi binaries to `/boot/efi/EFI/`. This makes sense in general but when working with bootc containers the location is usually different and inside `/usr/lib/bootupd/updates/EFI/`. So this commit makes the location configurable in a similar way as we already have it for the grub2 (non-iso) stage (in the grub2 stage its under `uefi` but in this stage everything is flat incuding the vendor so `efi_src_dir` is flat as well). The rational is that we want to build ISOs from bootc base images (c.f. osbuild/bootc-image-builder#1053) but also do not want every bootc installer image to have a special bootupd grub iso configuration (which would also hard to maintain as it would be duplicated in every container). So instead we use this stage to generate the config and just point to a different EFI dir.
b644dd8 to
135d493
Compare
Sadly the support for a single custom `efi_src_dir` [0] to look
for EFI binaries is not enough for the anaconda-bootc work:
The default shim on a bootc system is diverted from
`/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`.
We also need to install "grub2-iso-x64-cdboot" for a booting
iso from the base bootc container. This will be put under
the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location.
So the `org.osbuild.grub2.iso` stage will need to be able
to lookup the required binaries in both places. Hence
this commit tweaks the option to allow an array of
paths for the `efi_src_dirs` so that this can be supported.
The images library will then set this to:
``go
bootTreePipeline.EfiSrcDirs = []string{
"/boot/efi/EFI/",
"/usr/lib/bootupd/updates/EFI/",
}
```
Note that this could have also been solved with something like
`efi_fallback_dir` or even hardcoding the fallback here but
an array feels more extensible (even though I don't foresee
even more locations). But YAGNI, I'm open for ideas and we
could also just hardcode the fallback here and drop the
`efi_src_dir` option entirely.
This is needed for
osbuild/bootc-image-builder#1059
[0] osbuild#2202
Sadly the support for a single custom `efi_src_dir` [0] to look
for EFI binaries is not enough for the anaconda-bootc work:
The default shim on a bootc system is diverted from
`/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`.
We also need to install "grub2-iso-x64-cdboot" for a booting
iso from the base bootc container. This will be put under
the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location.
So the `org.osbuild.grub2.iso` stage will need to be able
to lookup the required binaries in both places. Hence
this commit tweaks the option to allow an array of
paths for the `efi_src_dirs` so that this can be supported.
The images library will then set this to:
```go
bootTreePipeline.EfiSrcDirs = []string{
"/boot/efi/EFI/",
"/usr/lib/bootupd/updates/EFI/",
}
```
Note that this could have also been solved with something like
`efi_fallback_dir` or even hardcoding the fallback here but
an array feels more extensible (even though I don't foresee
even more locations). But YAGNI, I'm open for ideas and we
could also just hardcode the fallback here and drop the
`efi_src_dir` option entirely.
This is needed for
osbuild/bootc-image-builder#1059
[0] osbuild#2202
Sadly the support for a single custom `efi_src_dir` [0] to look
for EFI binaries is not enough for the anaconda-bootc work:
The default shim on a bootc system is diverted from
`/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`.
We also need to install "grub2-iso-x64-cdboot" for a booting
iso from the base bootc container. This will be put under
the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location.
So the `org.osbuild.grub2.iso` stage will need to be able
to lookup the required binaries in both places. Hence
this commit tweaks the option to allow an array of
paths for the `efi_src_dirs` so that this can be supported.
The images library will then set this to:
```go
bootTreePipeline.EfiSrcDirs = []string{
"/boot/efi/EFI/",
"/usr/lib/bootupd/updates/EFI/",
}
```
Note that this could have also been solved with something like
`efi_fallback_dir` or even hardcoding the fallback here but
an array feels more extensible (even though I don't foresee
even more locations). But YAGNI, I'm open for ideas and we
could also just hardcode the fallback here and drop the
`efi_src_dir` option entirely.
This is needed for
osbuild/bootc-image-builder#1059
[0] osbuild#2202
Sadly the support for a single custom `efi_src_dir` [0] to look
for EFI binaries is not enough for the anaconda-bootc work:
The default shim on a bootc system is diverted from
`/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`.
We also need to install "grub2-iso-x64-cdboot" for a booting
iso from the base bootc container. This will be put under
the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location.
So the `org.osbuild.grub2.iso` stage will need to be able
to lookup the required binaries in both places. Hence
this commit tweaks the option to allow an array of
paths for the `efi_src_dirs` so that this can be supported.
The images library will then set this to:
```go
bootTreePipeline.EfiSrcDirs = []string{
"/boot/efi/EFI/",
"/usr/lib/bootupd/updates/EFI/",
}
```
This is needed for
osbuild/bootc-image-builder#1059
[0] osbuild#2202
Sadly the support for a single custom `efi_src_dir` [0] to look
for EFI binaries is not enough for the anaconda-bootc work:
The default shim on a bootc system is diverted from
`/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`.
We also need to install "grub2-iso-x64-cdboot" for a booting
iso from the base bootc container. This will be put under
the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location.
So the `org.osbuild.grub2.iso` stage will need to be able
to lookup the required binaries in both places. Hence
this commit tweaks the option to allow an array of
paths for the `efi_src_dirs` so that this can be supported.
The images library will then set this to:
```go
bootTreePipeline.EfiSrcDirs = []string{
"/boot/efi/EFI/",
"/usr/lib/bootupd/updates/EFI/",
}
```
This is needed for
osbuild/bootc-image-builder#1059
[0] osbuild#2202
We currently hardcode the location of the efi binaries to
/boot/efi/EFI. This makes sense in general but when working with bootc containers the location is usually different and inside/usr/lib/bootupd/updates/EFI. So this commit makes the location configurable in a similar way as we already have it for the grub2 (non-iso) stage (in the grub2 stage its underuefibut in this stage everything is flat incuding the vendor soefi_src_diris flat as well).The rational is that we want to build ISOs from bootc base images (c.f.
osbuild/bootc-image-builder#1053) but also do not want every bootc installer image to have a special bootupd grub iso configuration (which would also hard to maintain as it would be duplicated in every container). So instead we use this stage to generate the config and just point to a different EFI dir.
Needed for osbuild/bootc-image-builder#1053