From cc980002cefeeabe8dfa5eeaafacbd2285897ebc Mon Sep 17 00:00:00 2001 From: "lleyton@fyralabs.com" Date: Fri, 22 Nov 2024 02:19:54 -0800 Subject: [PATCH 1/8] add polycrystal post script --- katsu/modules/base/base.yaml | 3 +++ katsu/modules/base/polycrystal.sh | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 katsu/modules/base/polycrystal.sh diff --git a/katsu/modules/base/base.yaml b/katsu/modules/base/base.yaml index a11810b..dfdc39e 100644 --- a/katsu/modules/base/base.yaml +++ b/katsu/modules/base/base.yaml @@ -3,6 +3,9 @@ scripts: - id: cleanup name: Clean up system file: cleanup.sh + - id: polycrystal + name: Install Flatpaks via Polycrystal + file: polycrystal.sh - id: selinux-setup name: Set up SELinux file: selinux.sh diff --git a/katsu/modules/base/polycrystal.sh b/katsu/modules/base/polycrystal.sh new file mode 100644 index 0000000..99e85ab --- /dev/null +++ b/katsu/modules/base/polycrystal.sh @@ -0,0 +1,3 @@ +if ! [ -x "$(command -v polycrystal)" ]; then + polycrystal +fi From 6c61697624e48cd0976b718c6bc3c1f6a8fb0826 Mon Sep 17 00:00:00 2001 From: lea Date: Fri, 22 Nov 2024 02:36:18 -0800 Subject: [PATCH 2/8] fix maybe --- katsu/modules/base/polycrystal.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/katsu/modules/base/polycrystal.sh b/katsu/modules/base/polycrystal.sh index 99e85ab..b6d1c6d 100644 --- a/katsu/modules/base/polycrystal.sh +++ b/katsu/modules/base/polycrystal.sh @@ -1,3 +1,4 @@ +#!/bin/bash -x if ! [ -x "$(command -v polycrystal)" ]; then polycrystal fi From 673474b0871748ced3c2d5fa10bed69a917353e3 Mon Sep 17 00:00:00 2001 From: lea Date: Fri, 22 Nov 2024 02:44:49 -0800 Subject: [PATCH 3/8] fix script --- katsu/modules/base/polycrystal.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/katsu/modules/base/polycrystal.sh b/katsu/modules/base/polycrystal.sh index b6d1c6d..0735f6c 100644 --- a/katsu/modules/base/polycrystal.sh +++ b/katsu/modules/base/polycrystal.sh @@ -1,4 +1,4 @@ #!/bin/bash -x -if ! [ -x "$(command -v polycrystal)" ]; then +if [ -x "$(command -v polycrystal)" ]; then polycrystal fi From 9987e72dfe028c5d75e3f884d7302313cf616c3e Mon Sep 17 00:00:00 2001 From: Lleyton Gray Date: Fri, 22 Nov 2024 17:01:43 -0800 Subject: [PATCH 4/8] try workaround --- katsu/modules/base/polycrystal.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/katsu/modules/base/polycrystal.sh b/katsu/modules/base/polycrystal.sh index 0735f6c..b056c63 100644 --- a/katsu/modules/base/polycrystal.sh +++ b/katsu/modules/base/polycrystal.sh @@ -1,4 +1,23 @@ #!/bin/bash -x +set -euo pipefail + +cleanup() { + for mnt in sys proc; do + umount /mnt/mock-mount/$mnt + done + umount /mnt/mock-mount + umount /mnt/mock-mount +} + if [ -x "$(command -v polycrystal)" ]; then - polycrystal + trap cleanup EXIT + mkdir -p /mnt/mock-mount + mount --bind / /mnt/mock-mount + mount --make-private /mnt/mock-mount + mount --bind /mnt/mock-mount /mnt/mock-mount + for mnt in proc sys; do + mount --bind /$mnt /mnt/mock-mount/$mnt + done + + chroot /mnt/mock-mount bash -c polycrystal fi From 3086687e044d030cf096a4bd39212b9b3d0146fd Mon Sep 17 00:00:00 2001 From: lea Date: Fri, 22 Nov 2024 17:16:43 -0800 Subject: [PATCH 5/8] hm? --- katsu/modules/base/polycrystal.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/katsu/modules/base/polycrystal.sh b/katsu/modules/base/polycrystal.sh index b056c63..e2b8c0a 100644 --- a/katsu/modules/base/polycrystal.sh +++ b/katsu/modules/base/polycrystal.sh @@ -19,5 +19,5 @@ if [ -x "$(command -v polycrystal)" ]; then mount --bind /$mnt /mnt/mock-mount/$mnt done - chroot /mnt/mock-mount bash -c polycrystal + chroot /mnt/mock-mount bash -c 'env GPGME_DEBUG=9 polycrystal' fi From 0263a642eba3f8a13ed1f382781959e5cfde486f Mon Sep 17 00:00:00 2001 From: lea Date: Fri, 22 Nov 2024 17:42:55 -0800 Subject: [PATCH 6/8] meow --- katsu/modules/base/polycrystal.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/katsu/modules/base/polycrystal.sh b/katsu/modules/base/polycrystal.sh index e2b8c0a..28b0823 100644 --- a/katsu/modules/base/polycrystal.sh +++ b/katsu/modules/base/polycrystal.sh @@ -2,7 +2,7 @@ set -euo pipefail cleanup() { - for mnt in sys proc; do + for mnt in sys proc dev/pts dev; do umount /mnt/mock-mount/$mnt done umount /mnt/mock-mount @@ -15,7 +15,7 @@ if [ -x "$(command -v polycrystal)" ]; then mount --bind / /mnt/mock-mount mount --make-private /mnt/mock-mount mount --bind /mnt/mock-mount /mnt/mock-mount - for mnt in proc sys; do + for mnt in proc sys dev dev/pts; do mount --bind /$mnt /mnt/mock-mount/$mnt done From e1a968efeec072efad8eb22aa8c82a2ce4c642d0 Mon Sep 17 00:00:00 2001 From: Lleyton Gray Date: Mon, 16 Dec 2024 21:38:23 -0800 Subject: [PATCH 7/8] fix: hack around bwrap issue --- katsu/modules/base/polycrystal.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/katsu/modules/base/polycrystal.sh b/katsu/modules/base/polycrystal.sh index 28b0823..1684304 100644 --- a/katsu/modules/base/polycrystal.sh +++ b/katsu/modules/base/polycrystal.sh @@ -1,7 +1,10 @@ #!/bin/bash -x set -euo pipefail +# Hack from https://gist.github.com/jlebon/fb6e7c6dcc3ce17d3e2a86f5938ec033 + cleanup() { + chmod u-s /mnt/mock-mount/usr/bin/bwrap for mnt in sys proc dev/pts dev; do umount /mnt/mock-mount/$mnt done @@ -19,5 +22,10 @@ if [ -x "$(command -v polycrystal)" ]; then mount --bind /$mnt /mnt/mock-mount/$mnt done - chroot /mnt/mock-mount bash -c 'env GPGME_DEBUG=9 polycrystal' + # For some reason, our hack to get bwrap to work in a chroot also breaks user namespaces + # I can't figure out why, so we'll just setuid bwrap for now + # YOU MUST REMOVE THE SETUID BIT AFTER RUNNING THIS SCRIPT WHICH WE DO IN THE CLEANUP FUNCTION AND HERE + chmod u+s /mnt/mock-mount/usr/bin/bwrap + chroot /mnt/mock-mount bash -c 'polycrystal' + chmod u-s /mnt/mock-mount/usr/bin/bwrap fi From cd36b2bc74dfc10fa820b6fef122f5fea9886944 Mon Sep 17 00:00:00 2001 From: Lleyton Gray Date: Mon, 16 Dec 2024 21:48:51 -0800 Subject: [PATCH 8/8] pull in flatpak support package --- katsu/modules/base/base.yaml | 3 --- katsu/modules/base/desktop.yaml | 11 +++++++++++ katsu/modules/flagship/base-disk-aarch64.yaml | 1 + katsu/modules/flagship/base-disk-x86_64.yaml | 1 + katsu/modules/flagship/flagship-live.yaml | 1 + katsu/modules/gnome/base-disk-aarch64.yaml | 1 + katsu/modules/gnome/base-disk-x86_64.yaml | 1 + katsu/modules/gnome/gnome-live.yaml | 1 + katsu/modules/plasma/base-disk-aarch64.yaml | 1 + katsu/modules/plasma/base-disk-x86_64.yaml | 1 + katsu/modules/plasma/plasma-live.yaml | 1 + katsu/modules/xfce/base-disk-aarch64.yaml | 1 + katsu/modules/xfce/base-disk-x86_64.yaml | 1 + katsu/modules/xfce/xfce-live.yaml | 1 + 14 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 katsu/modules/base/desktop.yaml diff --git a/katsu/modules/base/base.yaml b/katsu/modules/base/base.yaml index dfdc39e..a11810b 100644 --- a/katsu/modules/base/base.yaml +++ b/katsu/modules/base/base.yaml @@ -3,9 +3,6 @@ scripts: - id: cleanup name: Clean up system file: cleanup.sh - - id: polycrystal - name: Install Flatpaks via Polycrystal - file: polycrystal.sh - id: selinux-setup name: Set up SELinux file: selinux.sh diff --git a/katsu/modules/base/desktop.yaml b/katsu/modules/base/desktop.yaml new file mode 100644 index 0000000..2416dfc --- /dev/null +++ b/katsu/modules/base/desktop.yaml @@ -0,0 +1,11 @@ +scripts: + post: + - id: polycrystal + name: Install Flatpaks via Polycrystal + file: polycrystal.sh + +dnf: + releasever: 41 + exec: dnf4 + packages: + - "@default-flatpak-support" diff --git a/katsu/modules/flagship/base-disk-aarch64.yaml b/katsu/modules/flagship/base-disk-aarch64.yaml index 68e8dcd..ce1d8ce 100644 --- a/katsu/modules/flagship/base-disk-aarch64.yaml +++ b/katsu/modules/flagship/base-disk-aarch64.yaml @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Flagship Edition) import: - ../base/base.yaml - ../base/base-disk.yaml + - ../base/desktop.yaml - flagship.yaml scripts: diff --git a/katsu/modules/flagship/base-disk-x86_64.yaml b/katsu/modules/flagship/base-disk-x86_64.yaml index a8b293d..13875e2 100644 --- a/katsu/modules/flagship/base-disk-x86_64.yaml +++ b/katsu/modules/flagship/base-disk-x86_64.yaml @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Flagship Edition) import: - ../base/base.yaml - ../base/base-disk.yaml + - ../base/desktop.yaml - flagship.yaml scripts: diff --git a/katsu/modules/flagship/flagship-live.yaml b/katsu/modules/flagship/flagship-live.yaml index 9db8578..fc8e0b5 100644 --- a/katsu/modules/flagship/flagship-live.yaml +++ b/katsu/modules/flagship/flagship-live.yaml @@ -3,6 +3,7 @@ builder: dnf import: - ../base/base.yaml - ../live/live.yaml + - ../base/desktop.yaml - flagship.yaml distro: Ultramarine Linux 41 (Flagship Edition) diff --git a/katsu/modules/gnome/base-disk-aarch64.yaml b/katsu/modules/gnome/base-disk-aarch64.yaml index 2d39b64..7ff7d95 100644 --- a/katsu/modules/gnome/base-disk-aarch64.yaml +++ b/katsu/modules/gnome/base-disk-aarch64.yaml @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (GNOME Edition) import: - ../base/base.yaml - ../base/base-disk.yaml + - ../base/desktop.yaml - gnome.yaml scripts: diff --git a/katsu/modules/gnome/base-disk-x86_64.yaml b/katsu/modules/gnome/base-disk-x86_64.yaml index 8a01b58..fe4adc5 100644 --- a/katsu/modules/gnome/base-disk-x86_64.yaml +++ b/katsu/modules/gnome/base-disk-x86_64.yaml @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (GNOME Edition) import: - ../base/base.yaml - ../base/base-disk.yaml + - ../base/desktop.yaml - gnome.yaml scripts: diff --git a/katsu/modules/gnome/gnome-live.yaml b/katsu/modules/gnome/gnome-live.yaml index f42b5f9..f4be07e 100644 --- a/katsu/modules/gnome/gnome-live.yaml +++ b/katsu/modules/gnome/gnome-live.yaml @@ -3,6 +3,7 @@ builder: dnf import: - ../base/base.yaml - ../live/live.yaml + - ../base/desktop.yaml - gnome.yaml distro: Ultramarine GNOME 41 diff --git a/katsu/modules/plasma/base-disk-aarch64.yaml b/katsu/modules/plasma/base-disk-aarch64.yaml index c305ffb..23641f9 100644 --- a/katsu/modules/plasma/base-disk-aarch64.yaml +++ b/katsu/modules/plasma/base-disk-aarch64.yaml @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Plasma Edition) import: - ../base/base.yaml - ../base/base-disk.yaml + - ../base/desktop.yaml - plasma.yaml - plasma-disk.yaml diff --git a/katsu/modules/plasma/base-disk-x86_64.yaml b/katsu/modules/plasma/base-disk-x86_64.yaml index d3fcb41..e714274 100644 --- a/katsu/modules/plasma/base-disk-x86_64.yaml +++ b/katsu/modules/plasma/base-disk-x86_64.yaml @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Plasma Edition) import: - ../base/base.yaml - ../base/base-disk.yaml + - ../base/desktop.yaml - plasma.yaml - plasma-disk.yaml diff --git a/katsu/modules/plasma/plasma-live.yaml b/katsu/modules/plasma/plasma-live.yaml index 28405dc..72a567a 100644 --- a/katsu/modules/plasma/plasma-live.yaml +++ b/katsu/modules/plasma/plasma-live.yaml @@ -3,6 +3,7 @@ builder: dnf import: - ../base/base.yaml - ../live/live.yaml + - ../base/desktop.yaml - plasma.yaml distro: Ultramarine Linux 41 (Plasma Edition) diff --git a/katsu/modules/xfce/base-disk-aarch64.yaml b/katsu/modules/xfce/base-disk-aarch64.yaml index 1bde1d9..538ab25 100644 --- a/katsu/modules/xfce/base-disk-aarch64.yaml +++ b/katsu/modules/xfce/base-disk-aarch64.yaml @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Xfce Edition) import: - ../base/base.yaml - ../base/base-disk.yaml + - ../base/desktop.yaml - xfce.yaml scripts: diff --git a/katsu/modules/xfce/base-disk-x86_64.yaml b/katsu/modules/xfce/base-disk-x86_64.yaml index d7c03fa..3bdc81e 100644 --- a/katsu/modules/xfce/base-disk-x86_64.yaml +++ b/katsu/modules/xfce/base-disk-x86_64.yaml @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Xfce Edition) import: - ../base/base.yaml - ../base/base-disk.yaml + - ../base/desktop.yaml - xfce.yaml scripts: diff --git a/katsu/modules/xfce/xfce-live.yaml b/katsu/modules/xfce/xfce-live.yaml index a1e3bc7..0fde06a 100644 --- a/katsu/modules/xfce/xfce-live.yaml +++ b/katsu/modules/xfce/xfce-live.yaml @@ -3,6 +3,7 @@ builder: dnf import: - ../base/base.yaml - ../live/live.yaml + - ../base/desktop.yaml - xfce.yaml distro: Ultramarine Linux 41 (Xfce Edition)