-
Notifications
You must be signed in to change notification settings - Fork 87
[WIP] many: switch to bootc based anaconda (away from rpm) (HMS-9392) #1053
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
Conversation
…/mvo5/images@bib-anaconda-1
Build an anaconda bootc base container with a custom LiveOS and a anaconda enable kernel via an extra dracut run.
AWESOME!!!! Thanks so much for starting this! Even having an experimental/hidden option for this would be super useful.
Yes because they're managed via bootupd; I think we could intersect bootupd with the osbuild ISO logic here. Or...maybe more generally this is really intersecting
Nah it's still a bootc container, we support content in |
This is amazing work. I need to read it in more detail, but from a quick skim it looks great. |
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 the same way as we already have it for the grub2 (non-iso) stage. 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.
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 the same way as we already have it for the grub2 (non-iso) stage. 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.
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.
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.
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.
Thank you! Really happy that you like it! [..]
I managed to remove this (and more quirks), I think the only one left is that anaconda does not like it when /mnt is a dangling symlink in the base image. I created https://gitlab.com/fedora/bootc/base-images/-/merge_requests/294 but I'm not sure its the best approach given the discouraged nature of populating /var. OTOH the dangling symlink might also be considered not super nice, idk. Or we could create a stage in osbuild that runs systemd-tmpfiles in a tree, i.e. after we mount the container we run systemd-tmpfiles(?). |
Closing in favor of #1059 which is a much cleaner version of this (I used a separate branch to keep this spike around for reference) |
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.
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.
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.
This spike show how we could use bootc based containers with anaconda. So instead of building our iso from rpm packages and just putting the bootc container into the rpm generated ISO this spike builds the ISO from a bootc container.
This requires that the container has the right content of course (i.e. anaconda). We would move some of the responsibility to the user (or to a tool that helps the user and hides the complexity here like bootc-iso-imagectl or something) to ensure that.
The
Containerfile
to generate an installer looks something like:this basic template works for cs9,cs10,f42 (Note that the goal here is to essentially remove all quirks
and hide them in images/, ideally the containerfile would be just a "FROM \ndnf install anaconda...").
This branch also has a "--installer-payload" switch so to use this one would essentially write:
bib --type iso --installer-payload quay.io/centos-bootc/centos-bootc:stream9 quay.io/centos-bootc-anaconda:stream9
(as currently the containerfile changes things like /root which makes it no longer a proper bootc container). We could of course explore making this more user friendly, either by a convention like "suffix -installer" for type iso or by creating a derrived constainer locally ourselfs with the above containerfile or helper or by fixing the issues that require /root to be a real dir (but even with that it would probably be undesired to install a container that contains a full anaconda env so something like installer-payload is probably still be needed).Note that this is big departure from our current approach and we would need to think about a transition strategy/communication if we go down this route.
Thanks to Ondrej, Colin for their help/inputs in this, I hope it captures what they suggested to explore.
/jira-epic HMS-8839
JIRA: HMS-9392