Files
fluffy-pancake/iso/enable_anaconda.sh
T

96 lines
3.1 KiB
Bash
Raw Normal View History

2026-03-08 20:42:12 +01:00
#!/usr/bin/env bash
2026-03-09 21:10:02 +01:00
set -eoux pipefail
2026-03-08 16:11:49 +01:00
2026-03-09 21:10:02 +01:00
# -------------------------------------------------------------------
# Image metadata
# -------------------------------------------------------------------
IMAGE_INFO="$(cat /usr/share/ublue-os/image-info.json)"
IMAGE_TAG="$(jq -r '."image-tag"' <<<"$IMAGE_INFO")"
IMAGE_REF="$(jq -r '."image-ref"' <<<"$IMAGE_INFO")"
IMAGE_REF="${IMAGE_REF##*://}"
2026-03-08 20:25:14 +01:00
2026-03-09 21:10:02 +01:00
# -------------------------------------------------------------------
# Prevent suspend during installation (Anaconda requirement)
# -------------------------------------------------------------------
tee /usr/share/glib-2.0/schemas/zz3-fluffy-pancake-installer-power.gschema.override <<'EOF'
[org.gnome.settings-daemon.plugins.power]
sleep-inactive-ac-type='nothing'
sleep-inactive-battery-type='nothing'
sleep-inactive-ac-timeout=0
sleep-inactive-battery-timeout=0
[org.gnome.desktop.session]
idle-delay=uint32 0
EOF
glib-compile-schemas /usr/share/glib-2.0/schemas
# -------------------------------------------------------------------
# Install Anaconda (GNOME backend is implicit)
# -------------------------------------------------------------------
2026-03-08 20:25:14 +01:00
dnf install -y \
2026-03-10 20:24:14 +01:00
dnf install -y \
anaconda-webui \
cockpit-ws \
cockpit-bridge \
2026-03-09 21:10:02 +01:00
libblockdev-btrfs \
libblockdev-lvm \
libblockdev-dm \
2026-03-09 19:56:42 +01:00
firefox
2026-03-09 21:10:02 +01:00
# -------------------------------------------------------------------
# Anaconda profile (Fluffy Pancake)
# -------------------------------------------------------------------
tee /etc/anaconda/profile.d/fluffy-pancake.conf <<'EOF'
[Profile]
profile_id = fluffy-pancake
2026-03-09 19:56:42 +01:00
2026-03-09 21:10:02 +01:00
[Profile Detection]
os_id = fluffy-pancake
2026-03-09 19:56:42 +01:00
2026-03-09 21:10:02 +01:00
[Network]
default_on_boot = FIRST_WIRED_WITH_LINK
[Bootloader]
efi_dir = fedora
menu_auto_hide = True
[Storage]
default_scheme = BTRFS
btrfs_compression = zstd:1
[Localization]
use_geolocation = False
2026-03-09 19:56:42 +01:00
EOF
2026-03-09 21:10:02 +01:00
# -------------------------------------------------------------------
# OS identity (installer + installed system)
# -------------------------------------------------------------------
sed -i 's/^ID=.*/ID=fluffy-pancake/' /usr/lib/os-release
grep -q '^VARIANT_ID=' /usr/lib/os-release || \
echo 'VARIANT_ID=fluffy-pancake' >> /usr/lib/os-release
2026-03-09 19:56:42 +01:00
2026-03-09 21:10:02 +01:00
. /etc/os-release
echo "Fluffy Pancake release $VERSION_ID ($VERSION_CODENAME)" > /etc/system-release
# -------------------------------------------------------------------
# Minimal Anaconda branding (no GNOME UX tweaks)
# -------------------------------------------------------------------
sed -i -e 's/Fedora/Fluffy Pancake/g' \
-e 's/CentOS/Fluffy Pancake/g' \
/usr/share/anaconda/gnome/org.fedoraproject.welcome-screen.desktop || true
# -------------------------------------------------------------------
# Kickstart: install THIS image
# -------------------------------------------------------------------
tee /usr/share/anaconda/interactive-defaults.ks <<EOF
ostreecontainer --url=$IMAGE_REF:$IMAGE_TAG --transport=containers-storage --no-signature-verification
%end
2026-03-08 16:11:49 +01:00
EOF
2026-03-08 20:00:41 +01:00
2026-03-09 21:10:02 +01:00
tee /usr/share/anaconda/post-scripts/install-configure-upgrade.ks <<EOF
%post --erroronfail
bootc switch --mutate-in-place --transport registry $IMAGE_REF:$IMAGE_TAG
%end
EOF