From ab602fc64bb5d60eb2599785ea05a0ceef832944 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Sun, 22 Sep 2024 16:37:22 +0200 Subject: [PATCH] live: change the way flatpak setup works instead of seeding the flatpaks manually let's just use the tree from installation. we'll put that into /@flatpak and then mount it into place as part of the live generator. we'll see how it goes. if this works out we may then btrfs receive the volume into the installed system and handle it similar to @snap as a special subvol --- mkosi.extra/usr/bin/_kde-linux-live-setup | 2 -- .../system-generators/kde-linux-live-generator | 18 ++++++++++++++++++ mkosi.postinst.chroot | 3 +-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/mkosi.extra/usr/bin/_kde-linux-live-setup b/mkosi.extra/usr/bin/_kde-linux-live-setup index f9834dc..1868d4b 100755 --- a/mkosi.extra/usr/bin/_kde-linux-live-setup +++ b/mkosi.extra/usr/bin/_kde-linux-live-setup @@ -52,5 +52,3 @@ cp /usr/share/applications/calamares.desktop /home/live/Desktop/ chmod +x /home/live/Desktop/calamares.desktop # without this there'd be a dialog asking if it really should execute chown -R live:live /home/live/ - -_kde-linux-install-flatpaks diff --git a/mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator b/mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator index e788811..4deb760 100755 --- a/mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator +++ b/mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator @@ -39,3 +39,21 @@ EOF mkdir "$normal_dir/multi-user.target.wants/" ln -s ../system.mount "$normal_dir/multi-user.target.wants/system.mount" + +cat <<- EOF > "$normal_dir/var-lib-flatpak.mount" +# Generated by $(basename "$0") +[Unit] +Description=Mount unit for /var/lib/flatpak + +[Mount] +What=/dev/disk/by-label/KDEOSLive +Where=/var/lib/flatpak +Type=btrfs +Options=rw,subvol=@flatpak + +[Install] +WantedBy=multi-user.target +EOF + +mkdir "$normal_dir/multi-user.target.wants/" +ln -s ../var-lib-flatpak.mount "$normal_dir/multi-user.target.wants/var-lib-flatpak.mount" diff --git a/mkosi.postinst.chroot b/mkosi.postinst.chroot index 3a3c25a..30ea561 100755 --- a/mkosi.postinst.chroot +++ b/mkosi.postinst.chroot @@ -211,8 +211,7 @@ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.f # Do this separately, when used as part of remote-add it complains about GPG for unknown reasons flatpak remote-modify --collection-id=org.flathub.Stable flathub flatpak install --noninteractive --assumeyes org.mozilla.firefox -flatpak create-usb flatpak org.mozilla.firefox -rm -rf /var/lib/flatpak # reset the state in the image +mv /var/lib/flatpak / # we'll extract this and later mount it into place plymouth-set-default-theme breeze-bgrt