Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions system_files/bluefin/usr/bin/ublue-rollback-helper
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions system_files/bluefin/usr/share/ublue-os/just/00-entry.just
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
46 changes: 46 additions & 0 deletions system_files/bluefin/usr/share/ublue-os/just/system.just
Original file line number Diff line number Diff line change
Expand Up @@ -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')"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think it's a problem we use bootc for this but it's inconsistent with what we currently have. I personally prefer using bootc for this.

cc @tulilirockz

IMAGE_INFO_FILE="${IMAGE_INFO_FILE:-/usr/share/ublue-os/image-info.json}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah the reason that is is I didn't want to touch image-info things in this PR. We didn't add -testing to the image-info.json and I'm not sure if it's worth it? I was thinking once we're all deploying testing branches we can go back and make it consistent.

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:
Expand Down Expand Up @@ -84,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:
Expand Down
1 change: 0 additions & 1 deletion system_files/shared/usr/share/ublue-os/just/apps.just
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down