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

Is it safe to run /usr/bin/bootupctl backend generate-update-metadata in a Containerfile? #635

Closed
travier opened this issue Mar 29, 2024 · 8 comments

Comments

@travier
Copy link
Member

travier commented Mar 29, 2024

To fix issues with Fedora Atomic desktops, I'm considering backporting the bootupd inclusion to Fedora 39:

While thinking about that, I wondered if it would be able to create layered images with bootupd included in a layer.

Is it safe to run /usr/bin/bootupctl backend generate-update-metadata from a container layer?

FROM quay.io/fedora-ostree-desktops/kinoite:40

RUN rpm-ostree install bootupd \
    &&\
    /usr/bin/bootupctl backend generate-update-metadata \
    && \
    ostree container commit

I'll do some testing.

@cgwalters
Copy link
Member

Offhand, I think so.

@travier
Copy link
Member Author

travier commented Sep 3, 2024

I did that for a while in travier/fedora-kinoite@7e3df8d and it worked fine.

@travier travier closed this as completed Sep 3, 2024
@fiftydinar
Copy link

fiftydinar commented Sep 28, 2024

Running this in Containerfile makes /usr/lib/ostree-boot/efi/ empty.

Is this normal behavior?

Credits to @bsherman for finding this out

bsherman added a commit to bsherman/ublue-custom that referenced this issue Sep 28, 2024
I noticed this bootupctl command was causing contents of
/usr/lib/ostree-boot to be removed.

Disabling this for now.

See:
coreos/bootupd#635 (comment)
@travier
Copy link
Member Author

travier commented Sep 30, 2024

Yes, the content is moved to /usr/lib/bootupd/updates. bsherman/ublue-custom@7778989 looks weird and it will likely fail when installing with Ananconda.

What's your issue with /usr/lib/ostree-boot/efi/ being empty?

@bsherman
Copy link

What's your issue with /usr/lib/ostree-boot/efi/ being empty?

I noticed the change when trying to use grub2-switch-to-blscfg on an installed system, which failed since the image had bootupctl backend generate-update-metadata.

Yes, the content is moved to /usr/lib/bootupd/updates. bsherman/ublue-custom@7778989 looks weird and it will likely fail when installing with Ananconda.

My naive guess is, if using such an image with bootupd, the service must be started to update grub, rather than using grub2-switch-to-blscfg?

@travier
Copy link
Member Author

travier commented Sep 30, 2024

You don't need to use grub2-switch-to-blscfg because that's what ostree does by default now and ostree-grub2 generates a config that reads BLS (unless you've explicitly told it not to but it's not the default). Bootupd will update older GRUBs to be able to read BLS.

@bsherman
Copy link

bsherman commented Oct 1, 2024

You don't need to use grub2-switch-to-blscfg because that's what ostree does by default now and ostree-grub2 generates a config that reads BLS (unless you've explicitly told it not to but it's not the default). Bootupd will update older GRUBs to be able to read BLS.

I see what's happening now. Apologies for the noise on this.

In the past I'd seen this discussion ( https://discussion.fedoraproject.org/t/why-does-grub2-present-twice-double-menuentry-for-each-ostree-entry/73990/8 ) and Universal Blue forums were we'd documented use of grub2-switch-to-blscfg as a way to drop the duplicate boot entries in Grub.

I had NOT seen your recent updates to that discussion, however. Recent questions about the duplicate entries and noticing it reoccurring on my own system caused me to ask some questions.

Since it's clearly expected behavior, I'm content. Thank you for the response!

bsherman added a commit to bsherman/ublue-custom that referenced this issue Oct 1, 2024
Revert: 7778989

What I'd observed is intentional. Duplicate grub boot entries do not
bother me since I know it's not a bug.

See:
coreos/bootupd#635 (comment)
@travier
Copy link
Member Author

travier commented Oct 3, 2024

Yes, with an updated GRUB (with BLS support) and dynamic GRUB configs (pre-bootupd) then you'll get duplicated GRUB entries. This will go away once we transition people to static GRUB configs by default, hopefully for F42 but we don't have this ready yet.

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

No branches or pull requests

4 participants