From 37695278694d79532016f93986c16b95eac40fbd Mon Sep 17 00:00:00 2001 From: oxmc7769 Date: Sat, 11 Apr 2026 05:29:20 -0700 Subject: [PATCH] Add flatpaks --- exports/squashfs/04-export/01-run.sh | 4 +-- stage0/00-configure-apt/00-run.sh | 11 ++++++++ stage0/00-configure-apt/01-packages | 1 + stage3/00-install-packages/00-packages | 1 + stage3/00-install-packages/01-packages-amd64 | 4 +-- stage3/01-install-desktop/00-packages-nr | 2 +- stage3/01-install-desktop/02-run.sh | 28 +++++++++++++++++++ .../files/flatpack-apps.txt | 1 + .../files/flatpak-firstboot.service | 14 ++++++++++ 9 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 stage0/00-configure-apt/01-packages create mode 100755 stage3/01-install-desktop/02-run.sh create mode 100644 stage3/01-install-desktop/files/flatpack-apps.txt create mode 100644 stage3/01-install-desktop/files/flatpak-firstboot.service diff --git a/exports/squashfs/04-export/01-run.sh b/exports/squashfs/04-export/01-run.sh index 600dc2b..5a2da6c 100755 --- a/exports/squashfs/04-export/01-run.sh +++ b/exports/squashfs/04-export/01-run.sh @@ -147,10 +147,8 @@ EOF # Add calamares installer and related packages to the live image on_chroot << EOF -apt-get install --no-install-recommends -y \ - calamares calamares-settings-vesperos \ +apt-get install -y calamares calamares-settings-vesperos \ libcrack2 cracklib-runtime \ - squashfs-tools \ grub-efi-amd64 grub-pc-bin efibootmgr \ parted gdisk dosfstools e2fsprogs EOF diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index b8165a9..0b59de0 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -45,6 +45,8 @@ sed -i "s/RELEASE/${RELEASE}/g" "${ROOTFS_DIR}/etc/apt/preferences.d/apt-vespero # Add additional architectures if needed, update and upgrade and cache policy on_chroot <<- \EOF SYSTEM_ARCH="$(dpkg --print-architecture)" + + # If we're building for rpi, we want to add both armhf and arm64 architectures to allow installing packages from both architectures if [ "${PLATFORM}" == "rpi" ]; then if [ "$SYSTEM_ARCH" = "armhf" ]; then dpkg --add-architecture arm64 @@ -52,6 +54,15 @@ on_chroot <<- \EOF dpkg --add-architecture armhf fi fi + + # If we're building for amd64, we want to add i386 architecture to allow installing packages from both architectures + if [ "$SYSTEM_ARCH" = "amd64" ]; then + dpkg --add-architecture i386 + elif [ "$SYSTEM_ARCH" = "i386" ]; then + dpkg --add-architecture amd64 + fi + + # Update and upgrade packages and show cache policy apt-get update apt-get dist-upgrade -y apt-cache policy diff --git a/stage0/00-configure-apt/01-packages b/stage0/00-configure-apt/01-packages new file mode 100644 index 0000000..1458b1b --- /dev/null +++ b/stage0/00-configure-apt/01-packages @@ -0,0 +1 @@ +tailscale-repo diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index 33464f0..6c61d8c 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -1,6 +1,7 @@ gstreamer1.0-x gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav gtk2-engines alsa-utils plymouth plymouth-themes desktop-base +flatpak git gvfs rfkill diff --git a/stage3/00-install-packages/01-packages-amd64 b/stage3/00-install-packages/01-packages-amd64 index d159dda..bcf22a0 100644 --- a/stage3/00-install-packages/01-packages-amd64 +++ b/stage3/00-install-packages/01-packages-amd64 @@ -1,3 +1,3 @@ firefox-esr -spice-vdagent -open-vm-tools-desktop \ No newline at end of file +steam-installer +spice-vdagent open-vm-tools-desktop \ No newline at end of file diff --git a/stage3/01-install-desktop/00-packages-nr b/stage3/01-install-desktop/00-packages-nr index 354f1f0..e71bf5c 100644 --- a/stage3/01-install-desktop/00-packages-nr +++ b/stage3/01-install-desktop/00-packages-nr @@ -1,2 +1,2 @@ -gnome-session gnome-shell libpam-gnome-keyring gnome-control-center gnome-software network-manager-gnome pulseaudio gnome-terminal gnome-online-accounts gnome-initial-setup gnome-tweaks gnome-shell-extension-manager gnome-shell-extension-user-theme vesperos-taskbar gnome-shell-extension-no-annoyance gnome-shell-extension-gsconnect gnome-shell-extension-dash-to-panel gnome-shell-extension-appindicator +gnome-session gnome-shell libpam-gnome-keyring gnome-control-center gnome-software gnome-software-plugin-flatpak network-manager-gnome pulseaudio gnome-terminal gnome-online-accounts gnome-initial-setup gnome-tweaks gnome-shell-extension-manager gnome-shell-extension-user-theme vesperos-taskbar gnome-shell-extension-no-annoyance gnome-shell-extension-gsconnect gnome-shell-extension-dash-to-panel gnome-shell-extension-appindicator #gnome-shell-extension-desktop-icons-ng diff --git a/stage3/01-install-desktop/02-run.sh b/stage3/01-install-desktop/02-run.sh new file mode 100755 index 0000000..1c81b96 --- /dev/null +++ b/stage3/01-install-desktop/02-run.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Install the default flatpak repos and pre-install apps in chroot +on_chroot <<- EOF + flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo +EOF + +# Copy app list +# Format: "repo: app.id1 app.id2 ..." — lines starting with "#" are comments +mkdir -p "${ROOTFS_DIR}/etc/flatpak" +install -m 644 files/flatpack-apps.txt "${ROOTFS_DIR}/etc/flatpak/apps.txt" + +# Pre-install flatpaks in chroot (post-install apply_extra scripts may fail without bwrap, +# but apps are fully usable — a first-boot service runs flatpak update to complete them) +on_chroot <<- EOF + while IFS=: read -r repo apps; do + [[ "\$repo" =~ ^[[:space:]]*# ]] && continue + [ -z "\${repo// /}" ] && continue + flatpak install -y --noninteractive "\${repo// /}" \$apps + done < /etc/flatpak/apps.txt +EOF + +# First-boot service: runs flatpak update once network is available to complete +# any apply_extra steps (e.g. openh264) that couldn't run in the chroot +install -m 644 files/flatpak-firstboot.service "${ROOTFS_DIR}/etc/systemd/system/flatpak-firstboot.service" +on_chroot <<- EOF + systemctl enable flatpak-firstboot.service +EOF diff --git a/stage3/01-install-desktop/files/flatpack-apps.txt b/stage3/01-install-desktop/files/flatpack-apps.txt new file mode 100644 index 0000000..6d79088 --- /dev/null +++ b/stage3/01-install-desktop/files/flatpack-apps.txt @@ -0,0 +1 @@ +flathub: org.gnome.Loupe com.bitwarden.desktop org.mozilla.Thunderbird diff --git a/stage3/01-install-desktop/files/flatpak-firstboot.service b/stage3/01-install-desktop/files/flatpak-firstboot.service new file mode 100644 index 0000000..649869c --- /dev/null +++ b/stage3/01-install-desktop/files/flatpak-firstboot.service @@ -0,0 +1,14 @@ +[Unit] +Description=Complete Flatpak post-install steps on first boot +After=network-online.target +Wants=network-online.target +ConditionPathExists=!/var/lib/flatpak-firstboot-done + +[Service] +Type=oneshot +ExecStart=flatpak update -y --noninteractive +ExecStartPost=/bin/touch /var/lib/flatpak-firstboot-done +ExecStartPost=/bin/systemctl disable flatpak-firstboot.service + +[Install] +WantedBy=multi-user.target