diff --git a/Containerfile b/Containerfile index 1affe2edb1..7f512eff90 100644 --- a/Containerfile +++ b/Containerfile @@ -464,6 +464,7 @@ RUN /tmp/image-info.sh && \ systemctl enable ublue-update.timer && \ systemctl enable gamescope-workaround.service && \ systemctl enable waydroid-workaround.service && \ + systemctl enable incus-workaround.service && \ systemctl enable bazzite-hardware-setup.service && \ systemctl enable tailscaled.service && \ systemctl enable dev-hugepages1G.mount && \ diff --git a/system_files/desktop/shared/usr/lib/systemd/system/incus-workaround.service b/system_files/desktop/shared/usr/lib/systemd/system/incus-workaround.service new file mode 100644 index 0000000000..e498c97ccf --- /dev/null +++ b/system_files/desktop/shared/usr/lib/systemd/system/incus-workaround.service @@ -0,0 +1,22 @@ +[Unit] +Description=Workaround SELinux issues with Incus... +ConditionPathExists=/usr/bin/incus +ConditionPathExists=/usr/bin/incus-agent +ConditionPathExists=/usr/lib/incus +After=local-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/mount --bind -o rw /usr/bin/incus /usr/bin/incus +ExecStart=/usr/bin/mount --bind -o rw /usr/bin/incus-agent /usr/bin/incus-agent +ExecStart=/usr/bin/mount --bind -o rw /usr/lib/incus /usr/lib/incus +ExecStart=/usr/sbin/restorecon -R -v /usr/bin/incus +ExecStart=/usr/sbin/restorecon -R -v /usr/bin/incus-agent +ExecStart=/usr/sbin/restorecon -R -v /usr/lib/incus +ExecStart=/usr/bin/umount /usr/bin/incus +ExecStart=/usr/bin/umount /usr/bin/incus-agent +ExecStart=/usr/bin/umount /usr/lib/incus +RemainAfterExit=true + +[Install] +WantedBy=multi-user.target