feat(iso): Move to LiveCD with Anaconda webUI (BETA) (#535)

This commit is contained in:
inffy 2025-05-29 08:41:59 +03:00 committed by GitHub
parent c92e266224
commit 4502b520f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 285 additions and 0 deletions

View file

@ -0,0 +1,117 @@
---
name: Build ISOs (Live with Webui)
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/reusable-build-iso-anaconda-webui.yml"
- "iso_files/configure_iso_anaconda-webui.sh"
schedule:
- cron: "30 0 * * 1"
env:
IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}"
IMAGE_NAME: "aurora"
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Build ISOs
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-24.04' }}
strategy:
fail-fast: false
matrix:
platform: [amd64]
flavor: ["main", "nvidia-open"]
image_version: ["stable"]
include:
- platform: amd64
flavor: "main"
image_version: stable
permissions:
contents: read
packages: read
id-token: write
steps:
- name: Maximize build space
if: matrix.platform != 'arm64'
uses: ublue-os/remove-unwanted-software@cc0becac701cf642c8f0a6613bbdaf5dc36b259e # v9
with:
remove-codeql: true
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
- name: Check Just Syntax
shell: bash
run: |
just check
- name: Format image ref
id: image_ref
env:
FLAVOR: ${{ matrix.flavor }}
run: |
set -eoux pipefail
image_name=$(just image_name "aurora" "${{ matrix.image_version}}" "${{ matrix.flavor}}")
image_ref="${IMAGE_REGISTRY}/${image_name}"
KARGS="NONE"
echo "image_ref=$image_ref" >> "${GITHUB_OUTPUT}"
echo "artifact_format="$image_name-${{ matrix.image_version }}-webui-$(uname -m)"" >> "${GITHUB_OUTPUT}"
echo "kargs=$KARGS" >> "${GITHUB_OUTPUT}"
- name: Build ISO
id: build
uses: ublue-os/titanoboa@main
with:
image-ref: ${{ steps.image_ref.outputs.image_ref }}:${{ matrix.image_version }}
flatpaks-list: ${{ github.workspace }}/iso_files/system-flatpaks.list
hook-post-rootfs: ${{ github.workspace }}/iso_files/configure_iso_anaconda-webui.sh
kargs: ${{ steps.image_ref.outputs.kargs }}
- name: Rename ISO
id: rename
env:
OUTPUT_PATH: ${{ steps.build.outputs.iso-dest }}
FLAVOR: ${{ matrix.flavor }}
OUTPUT_NAME: ${{ steps.image_ref.outputs.artifact_format }}
IMAGE_VERSION: ${{ matrix.image_version }}
run: |
set -x
mkdir -p output
OUTPUT_DIRECTORY="$(realpath output)"
sha256sum "${OUTPUT_PATH}" | tee "${OUTPUT_DIRECTORY}/${OUTPUT_NAME}.iso-CHECKSUM"
mv "${OUTPUT_PATH}" "${OUTPUT_DIRECTORY}/${OUTPUT_NAME}.iso"
echo "output_directory=$OUTPUT_DIRECTORY" >> "${GITHUB_OUTPUT}"
- name: Upload to Job Artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ steps.image_ref.outputs.artifact_format }}
if-no-files-found: error
path: ${{ steps.rename.outputs.output_directory }}
- name: Upload to CloudFlare
if: contains(matrix.image_version, 'stable') && github.event_name != 'pull_request'
shell: bash
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.AURORA_R2_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.AURORA_R2_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_REGION: auto
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.AURORA_R2_ENDPOINT }}
SOURCE_DIR: ${{ steps.rename.outputs.output_directory }}
run: |
sudo apt-get update
sudo apt-get install -y rclone
rclone copy "${SOURCE_DIR}" R2:aurora-dl

View file

@ -0,0 +1,168 @@
#!/usr/bin/env bash
set -eoux pipefail
IMAGE_INFO="$(cat /usr/share/ublue-os/image-info.json)"
IMAGE_TAG="$(jq -c -r '."image-tag"' <<<"$IMAGE_INFO")"
IMAGE_REF="$(jq -c -r '."image-ref"' <<<"$IMAGE_INFO")"
IMAGE_REF="${IMAGE_REF##*://}"
sbkey='https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
# Configure Live Environment
## Remove packages from liveCD to save space
dnf remove -y google-noto-fonts-all ublue-brew ublue-motd || true
glib-compile-schemas /usr/share/glib-2.0/schemas
systemctl disable rpm-ostree-countme.service
systemctl disable tailscaled.service
systemctl disable bootloader-update.service
systemctl disable brew-upgrade.timer
systemctl disable brew-update.timer
systemctl disable brew-setup.service
systemctl disable rpm-ostreed-automatic.timer
systemctl disable uupd.timer
systemctl disable ublue-system-setup.service
systemctl disable ublue-guest-user.service
systemctl disable check-sb-key.service
systemctl --global disable ublue-flatpak-manager.service
systemctl --global disable podman-auto-update.timer
systemctl --global disable ublue-user-setup.service
# Configure Anaconda
# Install Anaconda WebUI
SPECS=(
"libblockdev-btrfs"
"libblockdev-lvm"
"libblockdev-dm"
"anaconda-live"
"anaconda-webui"
)
dnf install -y "${SPECS[@]}"
# swap webui package to copr
dnf -y copr enable @rhinstaller/Anaconda-webui
dnf5 -y swap \
--repo=copr:copr.fedorainfracloud.org:group_rhinstaller:Anaconda-webui \
anaconda-webui anaconda-webui
# Anaconda Profile Detection
# Aurora
tee /etc/anaconda/profile.d/aurora.conf <<'EOF'
# Anaconda configuration file for Aurora Stable
[Profile]
# Define the profile.
profile_id = aurora
[Profile Detection]
# Match os-release values
os_id = aurora
[Network]
default_on_boot = FIRST_WIRED_WITH_LINK
[Bootloader]
efi_dir = fedora
menu_auto_hide = True
[Storage]
default_scheme = BTRFS
btrfs_compression = zstd:1
default_partitioning =
/ (min 1 GiB, max 70 GiB)
/home (min 500 MiB, free 50 GiB)
/var (btrfs)
[User Interface]
custom_stylesheet = /usr/share/anaconda/pixmaps/fedora.css
hidden_spokes =
NetworkSpoke
PasswordSpoke
hidden_webui_pages =
root-password
network
[Localization]
use_geolocation = False
EOF
# Configure
. /etc/os-release
echo "Aurora release $VERSION_ID ($VERSION_CODENAME)" >/etc/system-release
sed -i 's/ANACONDA_PRODUCTVERSION=.*/ANACONDA_PRODUCTVERSION=""/' /usr/{,s}bin/liveinst || true
sed -i 's|^Icon=.*|Icon=/usr/share/anaconda/pixmaps/fedora-logo-icon.png|' /usr/share/applications/liveinst.desktop || true
# Get Artwork
git clone --depth=1 https://github.com/ublue-os/packages.git /root/packages
mkdir -p /usr/share/anaconda/pixmaps/
cp -r /root/packages/aurora/fedora-logos/src/anaconda/* /usr/share/anaconda/pixmaps/
rm -rf /root/packages
# Interactive Kickstart
tee -a /usr/share/anaconda/interactive-defaults.ks <<EOF
ostreecontainer --url=$IMAGE_REF:$IMAGE_TAG --transport=containers-storage --no-signature-verification
%include /usr/share/anaconda/post-scripts/install-configure-upgrade.ks
%include /usr/share/anaconda/post-scripts/disable-fedora-flatpak.ks
%include /usr/share/anaconda/post-scripts/install-flatpaks.ks
%include /usr/share/anaconda/post-scripts/secureboot-enroll-key.ks
EOF
# Signed Images
tee /usr/share/anaconda/post-scripts/install-configure-upgrade.ks <<EOF
%post --erroronfail
bootc switch --mutate-in-place --enforce-container-sigpolicy --transport registry $IMAGE_REF:$IMAGE_TAG
%end
EOF
# Disable Fedora Flatpak
tee /usr/share/anaconda/post-scripts/disable-fedora-flatpak.ks <<'EOF'
%post --erroronfail
systemctl disable flatpak-add-fedora-repos.service
%end
EOF
# Install Flatpaks
tee /usr/share/anaconda/post-scripts/install-flatpaks.ks <<'EOF'
%post --erroronfail --nochroot
deployment="$(ostree rev-parse --repo=/mnt/sysimage/ostree/repo ostree/0/1/0)"
target="/mnt/sysimage/ostree/deploy/default/deploy/$deployment.0/var/lib/"
mkdir -p "$target"
rsync -aAXUHKP /var/lib/flatpak "$target"
%end
EOF
# Fetch the Secureboot Public Key
curl --retry 15 -Lo /etc/sb_pubkey.der "$sbkey"
# Enroll Secureboot Key
tee /usr/share/anaconda/post-scripts/secureboot-enroll-key.ks <<'EOF'
%post --erroronfail --nochroot
set -oue pipefail
readonly ENROLLMENT_PASSWORD="universalblue"
readonly SECUREBOOT_KEY="/etc/sb_pubkey.der"
if [[ ! -d "/sys/firmware/efi" ]]; then
echo "EFI mode not detected. Skipping key enrollment."
exit 0
fi
if [[ ! -f "$SECUREBOOT_KEY" ]]; then
echo "Secure boot key not provided: $SECUREBOOT_KEY"
exit 0
fi
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
if [[ ":Jupiter:Galileo:" =~ ":$SYS_ID:" ]]; then
echo "Steam Deck hardware detected. Skipping key enrollment."
exit 0
fi
mokutil --timeout -1 || :
echo -e "$ENROLLMENT_PASSWORD\n$ENROLLMENT_PASSWORD" | mokutil --import "$SECUREBOOT_KEY" || :
%end
EOF