Skip to content

Commit

Permalink
Merge pull request #63 from Ultramarine-Linux/polycrystal
Browse files Browse the repository at this point in the history
add polycrystal post script
  • Loading branch information
madonuko authored Dec 17, 2024
2 parents cdc979a + cd36b2b commit d72c1fe
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 0 deletions.
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

0 comments on commit d72c1fe

Please sign in to comment.