feat(just): use bootc upgrade when possible - #256
Conversation
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." |
There was a problem hiding this comment.
I guess we could also handle the case when we are in a container as /proc/cmdline is present there as well
Up to standards ✅🟢 Issues
|
| 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 |
There was a problem hiding this comment.
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
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
LockLayeringvalue inrpm-ostreed.conf. Users don't change this so this will always call torpm-ostree. We have this because it used to be a shared recipe with bluefin-lts which setsLockLayering=Truebecause 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-ostreethat broke image updates [1]. Bootc is simpler and the likelihood seems to be lower forupgradeto 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