Update enable_anaconda.sh

This commit is contained in:
humocs-man
2026-03-09 21:10:02 +01:00
committed by GitHub
parent 06c375873c
commit c2824805be
+78 -45
View File
@@ -1,59 +1,92 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euxo pipefail set -eoux pipefail
# -------------------------------------------------------------------- # -------------------------------------------------------------------
# Phase 1: Rootfs vorbereiten Anaconda erwartet KEIN /home # Image metadata
# -------------------------------------------------------------------- # -------------------------------------------------------------------
rm -rf /home 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##*://}"
# -------------------------------------------------------------------- # -------------------------------------------------------------------
# Phase 2: Installer + Branding installieren # 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)
# -------------------------------------------------------------------
dnf install -y \ dnf install -y \
anaconda \
anaconda-live \ anaconda-live \
anaconda-webui \ libblockdev-btrfs \
anaconda-webui-branding-fedora \ libblockdev-lvm \
polkit \ libblockdev-dm \
firefox firefox
# -------------------------------------------------------------------- # -------------------------------------------------------------------
# Phase 3: WebUI systemd-Servicefile anlegen # Anaconda profile (Fluffy Pancake)
# -------------------------------------------------------------------- # -------------------------------------------------------------------
cat > /usr/lib/systemd/system/anaconda-webui.service <<'EOF' tee /etc/anaconda/profile.d/fluffy-pancake.conf <<'EOF'
[Unit] [Profile]
Description=Anaconda Web UI profile_id = fluffy-pancake
After=network.target graphical.target
[Service] [Profile Detection]
Type=simple os_id = fluffy-pancake
ExecStart=/usr/bin/anaconda-webui
Restart=on-failure
[Install] [Network]
WantedBy=graphical.target 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
EOF EOF
# -------------------------------------------------------------------- # -------------------------------------------------------------------
# Phase 4: Service aktivieren # OS identity (installer + installed system)
# -------------------------------------------------------------------- # -------------------------------------------------------------------
systemctl enable anaconda-webui.service 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
# -------------------------------------------------------------------- . /etc/os-release
# Phase 5: Desktop-Launcher für den Installer echo "Fluffy Pancake release $VERSION_ID ($VERSION_CODENAME)" > /etc/system-release
# --------------------------------------------------------------------
cat > /usr/share/applications/install-to-disk.desktop <<'EOF' # -------------------------------------------------------------------
[Desktop Entry] # Minimal Anaconda branding (no GNOME UX tweaks)
Name=Jetzt installieren # -------------------------------------------------------------------
Comment=Installiere das System auf die Festplatte sed -i -e 's/Fedora/Fluffy Pancake/g' \
Exec=xdg-open http://localhost:8080 -e 's/CentOS/Fluffy Pancake/g' \
Icon=system-installer /usr/share/anaconda/gnome/org.fedoraproject.welcome-screen.desktop || true
Terminal=false
Type=Application # -------------------------------------------------------------------
Categories=System; # 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
EOF EOF
# -------------------------------------------------------------------- tee /usr/share/anaconda/post-scripts/install-configure-upgrade.ks <<EOF
# Phase 6: Finalen Zielzustand herstellen %post --erroronfail
# -------------------------------------------------------------------- bootc switch --mutate-in-place --transport registry $IMAGE_REF:$IMAGE_TAG
mkdir -p /home %end
EOF