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/base/polycrystal.sh b/katsu/modules/base/polycrystal.sh new file mode 100644 index 0000000..1684304 --- /dev/null +++ b/katsu/modules/base/polycrystal.sh @@ -0,0 +1,31 @@ +#!/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 + umount /mnt/mock-mount + umount /mnt/mock-mount +} + +if [ -x "$(command -v polycrystal)" ]; then + 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 dev dev/pts; do + mount --bind /$mnt /mnt/mock-mount/$mnt + done + + # 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 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)