Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add polycrystal post script #63

Merged
merged 8 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions katsu/modules/base/desktop.yaml
Original file line number Diff line number Diff line change
@@ -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"
31 changes: 31 additions & 0 deletions katsu/modules/base/polycrystal.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions katsu/modules/flagship/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Flagship Edition)
import:
- ../base/base.yaml
- ../base/base-disk.yaml
- ../base/desktop.yaml
- flagship.yaml

scripts:
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/flagship/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Flagship Edition)
import:
- ../base/base.yaml
- ../base/base-disk.yaml
- ../base/desktop.yaml
- flagship.yaml

scripts:
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/flagship/flagship-live.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ builder: dnf
import:
- ../base/base.yaml
- ../live/live.yaml
- ../base/desktop.yaml
- flagship.yaml

distro: Ultramarine Linux 41 (Flagship Edition)
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/gnome/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (GNOME Edition)
import:
- ../base/base.yaml
- ../base/base-disk.yaml
- ../base/desktop.yaml
- gnome.yaml

scripts:
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/gnome/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (GNOME Edition)
import:
- ../base/base.yaml
- ../base/base-disk.yaml
- ../base/desktop.yaml
- gnome.yaml

scripts:
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/gnome/gnome-live.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ builder: dnf
import:
- ../base/base.yaml
- ../live/live.yaml
- ../base/desktop.yaml
- gnome.yaml

distro: Ultramarine GNOME 41
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/plasma/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions katsu/modules/plasma/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions katsu/modules/plasma/plasma-live.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ builder: dnf
import:
- ../base/base.yaml
- ../live/live.yaml
- ../base/desktop.yaml
- plasma.yaml

distro: Ultramarine Linux 41 (Plasma Edition)
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/xfce/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Xfce Edition)
import:
- ../base/base.yaml
- ../base/base-disk.yaml
- ../base/desktop.yaml
- xfce.yaml

scripts:
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/xfce/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ distro: Ultramarine Linux 41 (Xfce Edition)
import:
- ../base/base.yaml
- ../base/base-disk.yaml
- ../base/desktop.yaml
- xfce.yaml

scripts:
Expand Down
1 change: 1 addition & 0 deletions katsu/modules/xfce/xfce-live.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ builder: dnf
import:
- ../base/base.yaml
- ../live/live.yaml
- ../base/desktop.yaml
- xfce.yaml

distro: Ultramarine Linux 41 (Xfce Edition)
Expand Down
Loading