From 915478ee5af78cdecb5bfce5d09942f849bc6b9c Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Sun, 17 Nov 2024 13:05:11 -0300 Subject: [PATCH 1/2] feat(rollback-helper): use bootc switch if layering is locked (#1915) --- system_files/shared/usr/bin/ublue-rollback-helper | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/system_files/shared/usr/bin/ublue-rollback-helper b/system_files/shared/usr/bin/ublue-rollback-helper index 1b5232464e2..0f5ef77ee2a 100755 --- a/system_files/shared/usr/bin/ublue-rollback-helper +++ b/system_files/shared/usr/bin/ublue-rollback-helper @@ -44,11 +44,16 @@ function rebase_helper(){ fi echo "Rebase Target is ${rebase_target}" echo "Confirm Rebase" - if [[ $(Confirm) -eq "0" ]]; then - rpm-ostree rebase ostree-image-signed:docker://"${rebase_target}" - else + if [[ $(Confirm) -ne "0" ]]; then return 1 fi + + if /usr/bin/grep "^LockLayering=true" /etc/rpm-ostreed.conf &> /dev/null; then + pkexec bootc switch --enforce-container-sigpolicy "${rebase_target}" + return 0 + fi + rpm-ostree rebase ostree-image-signed:docker://"${rebase_target}" + return 0 } echo "Choose your action." From 35aac9565bb64e68bdabf33d936cb6a0c4a38e42 Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Sun, 17 Nov 2024 13:52:38 -0300 Subject: [PATCH 2/2] feat: automatically use bootc to update system if locklayering is being used (#1902) Co-authored-by: Jorge O. Castro --- just/bluefin-system.just | 6 ------ .../shared/usr/share/ublue-os/just/10-update.just | 4 +++- .../shared/usr/share/ublue-os/topgrade-bootc.toml | 9 +++++++++ 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 system_files/shared/usr/share/ublue-os/topgrade-bootc.toml diff --git a/just/bluefin-system.just b/just/bluefin-system.just index 215361633a9..c04e218d47b 100644 --- a/just/bluefin-system.just +++ b/just/bluefin-system.just @@ -260,12 +260,6 @@ alias switch-channel := rebase-helper rebase-helper: @/usr/bin/ublue-rollback-helper -update-ng: - echo "Note: This command doesn't work if you have locally layered packages" - sudo bootc upgrade - flatpak update -y - brew upgrade - # Toggle tailscale toggle-tailscale: #!/bin/bash diff --git a/system_files/shared/usr/share/ublue-os/just/10-update.just b/system_files/shared/usr/share/ublue-os/just/10-update.just index 68b86dad067..c7942976f49 100644 --- a/system_files/shared/usr/share/ublue-os/just/10-update.just +++ b/system_files/shared/usr/share/ublue-os/just/10-update.just @@ -5,7 +5,9 @@ alias upgrade := update # Update system, flatpaks, and containers all at once update: #!/usr/bin/bash - /usr/bin/topgrade --config /usr/share/ublue-os/topgrade.toml --keep + TOPGRADE_CONFIG="/usr/share/ublue-os/topgrade" + /usr/bin/grep "^LockLayering=true" /etc/rpm-ostreed.conf &>/dev/null && TOPGRADE_CONFIG="${TOPGRADE_CONFIG}-bootc" + /usr/bin/topgrade --config "${TOPGRADE_CONFIG}.toml" --keep alias auto-update := toggle-updates diff --git a/system_files/shared/usr/share/ublue-os/topgrade-bootc.toml b/system_files/shared/usr/share/ublue-os/topgrade-bootc.toml new file mode 100644 index 00000000000..d7e20c755ba --- /dev/null +++ b/system_files/shared/usr/share/ublue-os/topgrade-bootc.toml @@ -0,0 +1,9 @@ +[misc] +no_self_update = true +disable = ["self_update", "toolbx", "containers", "helm", "system"] +ignore_failures = ["distrobox", "flatpak", "brew_cask", "brew_formula", "nix", "node", "pip3", "home_manager", "firmware"] +assume_yes = true +no_retry = false + +[commands] +"System Upgrade" = "sudo bootc upgrade"