From b2b1f1a7ea742becfc7518daeb20ccfbbfd088e3 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Fri, 13 Feb 2026 17:23:23 -0500 Subject: [PATCH 1/2] feat: add toggle-testing ujust recipe for LTS images Adds a ujust toggle-testing command that switches users between stable (lts/lts-hwe) and testing (lts-testing/lts-hwe-testing) images. Uses bootc status --json to detect the current image tag and gum confirm for user confirmation. Exits gracefully on non-LTS images where testing variants do not exist. Also adds lts-testing and lts-hwe-testing channels to the rebase-helper channel picker, with correct date-pin filter logic for testing tags. Closes: projectbluefin/common#130 Assisted-by: Claude Sonnet 4.5 via OpenCode --- .../bluefin/usr/bin/ublue-rollback-helper | 9 ++-- .../usr/share/ublue-os/just/system.just | 45 +++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/system_files/bluefin/usr/bin/ublue-rollback-helper b/system_files/bluefin/usr/bin/ublue-rollback-helper index 9ea5b643..2c1dd0f6 100755 --- a/system_files/bluefin/usr/bin/ublue-rollback-helper +++ b/system_files/bluefin/usr/bin/ublue-rollback-helper @@ -31,9 +31,9 @@ IMAGE_NAME="$(gum choose --header="Select your image:" "${IMAGES[@]}" cancel)" base_image="${IMAGE_REGISTRY}/${IMAGE_NAME}" declare -a CHANNELS if [ "${LTS_MODE}" == "1" ] ; then - CHANNELS=(lts lts-hwe) + CHANNELS=(lts lts-testing lts-hwe lts-hwe-testing) if grep -q -e "gdx" <<< "${IMAGE_NAME}" ; then - CHANNELS=(lts) + CHANNELS=(lts lts-testing) fi else CHANNELS=(gts stable stable-daily latest) @@ -51,7 +51,10 @@ if gum confirm --default=no "Would you like to pin to a specific build date?" ; filter="${channel_selected}.[0-9]{8}" if [ "${LTS_MODE}" == 1 ] ; then - if grep -q -e "hwe" -e "gdx" <<< "${channel_selected}" ; then + if grep -q -e "testing" <<< "${channel_selected}" ; then + # Testing channels: filter is already correct (e.g., lts-testing.[0-9]{8}) + valid_tags=( $(list_tags "$filter") ) + elif grep -q -e "hwe" -e "gdx" <<< "${channel_selected}" ; then filter="lts.[0-9]{8}" valid_tags=( $(list_tags "$filter" | grep hwe) ) else diff --git a/system_files/bluefin/usr/share/ublue-os/just/system.just b/system_files/bluefin/usr/share/ublue-os/just/system.just index 992fd4a3..64190365 100644 --- a/system_files/bluefin/usr/share/ublue-os/just/system.just +++ b/system_files/bluefin/usr/share/ublue-os/just/system.just @@ -43,6 +43,51 @@ toggle-devmode: fi echo "Use ujust dx-group to add your user to the correct groups and complete the installation after rebooting into the development image" +# Toggle between stable and testing images (LTS only) +[group('System')] +toggle-testing: + #!/usr/bin/env bash + IMAGE_INFO_FILE="${IMAGE_INFO_FILE:-/usr/share/ublue-os/image-info.json}" + IMAGE_TAG="$(jq -rc '."image-tag"' "${IMAGE_INFO_FILE}")" + + # Guard: only LTS images have testing variants + if ! grep -q "^lts" <<< "${IMAGE_TAG}" ; then + echo "toggle-testing is only available on Bluefin LTS images." + echo "Current image tag: ${IMAGE_TAG}" + exit 0 + fi + + # Detect current booted image reference via bootc + BOOTED_IMAGE="$(sudo bootc status --json | jq -rc '.status.booted.image.image.image')" + if [ -z "${BOOTED_IMAGE}" ] || [ "${BOOTED_IMAGE}" == "null" ] ; then + echo "Error: Could not determine current booted image from bootc status." + exit 1 + fi + + # Split into registry/name and tag + IMAGE_BASE="${BOOTED_IMAGE%%:*}" + CURRENT_TAG="${BOOTED_IMAGE##*:}" + + if grep -q "\-testing" <<< "${CURRENT_TAG}" ; then + STABLE_TAG="${CURRENT_TAG%-testing}" + TARGET="${IMAGE_BASE}:${STABLE_TAG}" + echo "You are currently on a testing image." + echo " Current: ${BOOTED_IMAGE}" + echo " Target: ${TARGET}" + gum confirm "Switch from testing to stable?" || exit 0 + else + TESTING_TAG="${CURRENT_TAG}-testing" + TARGET="${IMAGE_BASE}:${TESTING_TAG}" + echo "You are currently on a stable image." + echo " Current: ${BOOTED_IMAGE}" + echo " Target: ${TARGET}" + gum confirm "Switch from stable to testing? Testing images may be less stable." || exit 0 + fi + + # --enforce-container-sigpolicy is MANDATORY for security (container signature verification) + pkexec bootc switch --enforce-container-sigpolicy "${TARGET}" + echo "Reboot to apply the change." + # Configure docker,incus-admin,libvirt, container manager, serial permissions [group('System')] dx-group: From 3a7269144afd5a487e1c3ff62314e3b655406ab6 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Fri, 13 Feb 2026 17:24:28 -0500 Subject: [PATCH 2/2] style: apply justfile formatting --- system_files/bluefin/usr/share/ublue-os/just/00-entry.just | 1 + system_files/bluefin/usr/share/ublue-os/just/system.just | 1 + system_files/shared/usr/share/ublue-os/just/apps.just | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system_files/bluefin/usr/share/ublue-os/just/00-entry.just b/system_files/bluefin/usr/share/ublue-os/just/00-entry.just index f586fb81..dea4fe2e 100644 --- a/system_files/bluefin/usr/share/ublue-os/just/00-entry.just +++ b/system_files/bluefin/usr/share/ublue-os/just/00-entry.just @@ -7,6 +7,7 @@ _default: ujust --list --list-heading $'Available commands:\n' --list-prefix $' - ' # Imports + import "/usr/share/ublue-os/just/apps.just" import "/usr/share/ublue-os/just/changelog.just" import "/usr/share/ublue-os/just/default.just" diff --git a/system_files/bluefin/usr/share/ublue-os/just/system.just b/system_files/bluefin/usr/share/ublue-os/just/system.just index 64190365..f6efeb5e 100644 --- a/system_files/bluefin/usr/share/ublue-os/just/system.just +++ b/system_files/bluefin/usr/share/ublue-os/just/system.just @@ -129,6 +129,7 @@ install-system-flatpaks $confirm="1" $dx_only="0": brew bundle --file="${TARGET_FLATPAK_FILE:-/usr/share/ublue-os/homebrew/system-flatpaks.Brewfile}" # Install default system flatpaks (alias for install-system-flatpaks) + # For additional applications, use: ujust bbrew [group('System')] bluefin-apps: diff --git a/system_files/shared/usr/share/ublue-os/just/apps.just b/system_files/shared/usr/share/ublue-os/just/apps.just index 0fc4d1c9..b741df06 100644 --- a/system_files/shared/usr/share/ublue-os/just/apps.just +++ b/system_files/shared/usr/share/ublue-os/just/apps.just @@ -12,7 +12,6 @@ install-jetbrains-toolbox: brew tap ublue-os/homebrew-tap brew install --cask jetbrains-toolbox-linux - # Install OpenTabletDriver, an open source, cross-platform, user-mode tablet driver [group('Apps')] install-opentabletdriver: