-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(-dx): Workaround swtpm SELinux issues (#764)
Co-authored-by: Brian Ketelsen <[email protected]>
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Unit] | ||
Description=Workaround swtpm not having the correct label | ||
ConditionFileIsExecutable=/usr/bin/swtpm | ||
After=local-fs.target | ||
|
||
[Service] | ||
Type=oneshot | ||
# Copy if it doens't exist | ||
ExecStartPre=/usr/bin/bash -c "[ -x /usr/local/bin/.swtpm ] || /usr/bin/cp /usr/bin/swtpm /usr/local/bin/.swtpm" | ||
# This is faster than using .mount unit. Also allows for the previous line/cleanup | ||
ExecStartPre=/usr/bin/mount --bind /usr/local/bin/.swtpm /usr/bin/swtpm | ||
# Fix SELinux label | ||
ExecStart=/usr/sbin/restorecon /usr/bin/swtpm | ||
# Clean-up after ourselves | ||
ExecStop=/usr/bin/umount /usr/bin/swtpm | ||
ExecStop=/usr/bin/rm /usr/local/bin/.swtpm | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
C /usr/local/bin/.swtpm - - - - /usr/bin/swtpm | ||
d /var/lib/swtpm-localca 0750 tss tss - - |