Skip to content

Commit 1606664

Browse files
committedJan 1, 2024
fix: Correct labels on waydroid for selinux (#639)
1 parent ca9d13e commit 1606664

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed
 

‎Containerfile

+1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ RUN /tmp/image-info.sh && \
422422
systemctl disable rpm-ostreed-automatic.timer && \
423423
systemctl enable ublue-update.timer && \
424424
systemctl enable gamescope-workaround.service && \
425+
systemctl enable waydroid-workaround.service && \
425426
systemctl enable bazzite-hardware-setup.service && \
426427
systemctl enable tailscaled.service && \
427428
systemctl enable dev-hugepages1G.mount && \

‎system_files/desktop/shared/usr/lib/systemd/system/gamescope-workaround.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ After=local-fs.target
55

66
[Service]
77
Type=oneshot
8-
# Copy if it doens't exist
8+
# Copy if it doesn't exist
99
ExecStartPre=/usr/bin/bash -c "[ -x /usr/local/bin/.gamescope ] || /usr/bin/cp /usr/bin/gamescope /usr/local/bin/.gamescope"
1010
# This is faster than using .mount unit. Also allows for the previous line/cleanup
1111
ExecStartPre=/usr/bin/mount --bind /usr/local/bin/.gamescope /usr/bin/gamescope
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[Unit]
2+
Description=Workaround waydroid not having the correct label
3+
ConditionPathExists=/usr/lib/waydroid
4+
After=local-fs.target
5+
6+
[Service]
7+
Type=oneshot
8+
# Copy if it doesn't exist
9+
ExecStartPre=/usr/bin/bash -c "[ -d /usr/local/lib/.waydroid ] || /usr/bin/cp -r /usr/lib/waydroid /usr/local/lib/.waydroid"
10+
# This is faster than using .mount unit. Also allows for the previous line/cleanup
11+
ExecStartPre=/usr/bin/mount --bind /usr/local/lib/.waydroid /usr/lib/waydroid
12+
# Fix SELinux label
13+
ExecStart=/usr/sbin/restorecon /usr/lib/waydroid
14+
# Clean-up after ourselves
15+
ExecStop=/usr/bin/umount /usr/lib/waydroid
16+
ExecStop=/usr/bin/rm -r /usr/local/lib/.waydroid
17+
RemainAfterExit=yes
18+
19+
[Install]
20+
WantedBy=multi-user.target
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C /usr/local/lib/.waydroid - - - - /usr/lib/waydroid

1 commit comments

Comments
 (1)

m2Giles commented on Jan 4, 2024

@m2Giles
Member

The /usr/sbin/restorecon might need a -R to recurse.

Please sign in to comment.