Skip to content

feat(just): use bootc upgrade when possible - #256

Draft
renner0e wants to merge 1 commit into
mainfrom
bootc-over-rpm-ostree
Draft

feat(just): use bootc upgrade when possible#256
renner0e wants to merge 1 commit into
mainfrom
bootc-over-rpm-ostree

Conversation

@renner0e

@renner0e renner0e commented Aug 7, 2026

Copy link
Copy Markdown
Member

The reason why we are not using uupd, which would completely handle the bootc rpm-ostree compatibility dance is because the output is not super useful from a troubleshooting perspective and people like their bling.

What we want is to use bootc for upgrades when it is possible to use it. We currently don't do this as we just check for the LockLayering value in rpm-ostreed.conf. Users don't change this so this will always call to rpm-ostree. We have this because it used to be a shared recipe with bluefin-lts which sets LockLayering=True because it doesn't support package layering.

Bootc upgrade is slightly faster than rpm-ostree and more importantly does not mess with any RPMs or calls to any repos, which are all steps that might fail. There have also been bugs in recent times in rpm-ostree that broke image updates [1]. Bootc is simpler and the likelihood seems to be lower for upgrade to straight up be broken.

The disadvantage compared to always using rpm-ostree for everything is that bootc doesn't have polkit rules to allow members of the wheel group to execute it without authentication, even if rpm-ostree ends up being used which does exactly that.

More complex and probably more buggy alternative to #252

[1] coreos/rpm-ostree#5567

The reason why we are not using uupd, which would completely handle the
bootc rpm-ostree compatibility dance is because the output is not super
useful from a troubleshooting perspective and people like their bling.

What we want is to use bootc for upgrades when it is possible to use it.
We currently don't do this as we just check for the `LockLayering` value
in `rpm-ostreed.conf`. Users don't change this so this will always call
to `rpm-ostree`. We have this because it used to be a shared recipe with
bluefin-lts which sets `LockLayering=True` because it doesn't support
package layering.

Bootc upgrade is slightly faster than rpm-ostree and more importantly
does not mess with any RPMs or calls to any repos, which are all steps
that might fail. There have also been bugs in recent times in
`rpm-ostree` that broke image updates [1]. Bootc is simpler and the
likelihood seems to be lower for `upgrade` to straight up be broken.

The disadvantage compared to always using rpm-ostree for everything is
that bootc doesn't have polkit rules to allow members of the wheel group
to execute it without authentication, even if rpm-ostree ends up being
used which does exactly that.

More complex and probably more buggy alternative to
#252

[1] coreos/rpm-ostree#5567
IS_OSTREE="true"
else
rpm-ostree upgrade
echo "Not booted, nothing to upgrade."

@renner0e renner0e Aug 7, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could also handle the case when we are in a container as /proc/cmdline is present there as well

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment on lines +38 to +52
STAGED_INCOMPAT=$(echo "${STATUS}" | jq ".staged.incompatible")
BOOTED_INCOMPAT=$(echo "${STATUS}" | jq ".booted.incompatible")

if [[ "${STAGED_INCOMPAT}" == "true" || ( "${BOOTED_INCOMPAT}" == "true" && -z "${STAGED_INCOMPAT}" ) || "${BOOTED_INCOMPAT}" == "true" ]]; then
INCOMPAT="true"
else
INCOMPAT="false"
fi

if [[ "${INCOMPAT}" == "true" ]]; then
rpm-ostree upgrade
else
sudo bootc upgrade
fi
fi

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this mostly works from my testing

This should also support the usecase of

layered packages/not compatible with bootc -> has a staged image with rpm-ostree reset (is compatible) -> ujust upgrade uses bootc path

and the inverse of that

booted deployment is compatible, staged one is not compatible -> use rpm-ostree

I have not tested rpm-ostree rollback/bootc rollback behavior at all

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

Successfully merging this pull request may close these issues.

1 participant