#!/usr/bin/bash # Turns quine-linux into the live ISO's root filesystem (live/Containerfile): # boots from the ISO into a KDE session as the live user, with Anaconda WebUI # to install $PAYLOAD_IMAGE. Adapted from Aurora's live ISO, # github.com/get-aurora-dev/iso (Apache-2.0), iso_files/*.sh at bee017f. # # Installed systems get their first user from plasma-setup at first boot, so # the installer hides its account pages, as Aurora's does. set -exo pipefail SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Create the directory that /root is symlinked to mkdir -p "$(realpath /root)" # bwrap (flatpak) writes /proc/sys/user/max_user_namespaces, read-only here mount -o remount,rw /proc/sys # ── The image to install, and the system Flatpaks to copy over ───────────── # Both land in this filesystem, so installing needs no network. podman pull "$PAYLOAD_IMAGE" grep -v '#' /usr/share/ublue-os/homebrew/system-flatpaks.Brewfile | grep '^flatpak' | sed 's/flatpak //' | tr -d '"' >/tmp/flatpaks.list curl --retry 3 -Lo /etc/flatpak/remotes.d/flathub.flatpakrepo https://dl.flathub.org/repo/flathub.flatpakrepo xargs -r flatpak install -y --noninteractive /etc/systemd/system/var-tmp.mount <<'EOF' [Unit] Description=Larger tmpfs for /var/tmp on live system [Mount] What=tmpfs Where=/var/tmp Type=tmpfs Options=size=50%,nr_inodes=1m,x-systemd.graceful-option=usrquota [Install] WantedBy=local-fs.target EOF systemctl enable var-tmp.mount rm -f /etc/localtime systemd-firstboot --timezone UTC mkdir -p /usr/lib/bootc-image-builder cp "$SRC/iso.yaml" /usr/lib/bootc-image-builder/iso.yaml # ── What a live session shouldn't do ─────────────────────────────────────── for unit in tailscaled.service brew-upgrade.timer brew-update.timer brew-setup.service \ uupd.timer ublue-system-setup.service flatpak-preinstall.service; do systemctl disable "$unit" || true done systemctl --global disable podman-auto-update.timer ublue-user-setup.service || true rm -f /usr/share/applications/dev.getaurora.system-update.desktop rm -f /usr/lib/systemd/system/flatpak-add-fedora-repos.service # Only the system Flatpaks above get copied to the installed system, not # what the live user installs. cat >/usr/lib/systemd/system/var-lib-flatpak.mount <<'EOF' [Unit] Description=tmpfs so only the system Flatpaks are transferred to the installed system Conflicts=umount.target [Mount] Type=overlay What=overlay Where=/var/lib/flatpak Options=lowerdir=/var/lib/flatpak,upperdir=/run/overlay/flatpak,workdir=/run/overlay/flatpak.work [Install] WantedBy=local-fs.target EOF cat >/usr/lib/tmpfiles.d/quine-live-flatpak.conf <<'EOF' d /run/overlay/flatpak 0755 - - - d /run/overlay/flatpak.work 0755 - - - EOF systemctl enable var-lib-flatpak.mount # ── KDE in the live session ──────────────────────────────────────────────── # The installer in Kickoff's favourites; no wallet prompts sed -i '2s/$/;liveinst.desktop/' /usr/share/kde-settings/kde-profile/default/xdg/kicker-extra-favoritesrc tee -a /etc/xdg/kwalletrc <<'EOF' [Wallet] Enabled=false EOF . /etc/os-release echo "Quine Linux $VERSION_ID" >/etc/system-release # plasma-welcome crashes with --live-environment unless given its pages # (github.com/ublue-os/aurora/issues/2624, bugs.kde.org/523540) cat >/usr/bin/plasma-welcome <<'EOF' #!/usr/bin/env bash exec /usr/bin/plasma-welcome-original --pages Live,Welcome,SimpleByDefault,PowerfulWhenNeeded,Enjoy "$@" EOF rm -f /usr/share/plasma/plasma-welcome/intro-customization.desktop # ── The installer ────────────────────────────────────────────────────────── sed -i 's/ANACONDA_PRODUCTVERSION=.*/ANACONDA_PRODUCTVERSION=""/' /usr/{,s}bin/liveinst || true # The profile matches os-release's ID (Aurora's, which quine-linux keeps). mkdir -p /etc/anaconda/profile.d tee /etc/anaconda/profile.d/quine-linux.conf <