-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dx): rework dx incus/swtpm and systemd services. Make incus setup…
… work with Aurora (#1231)
- Loading branch information
Showing
10 changed files
with
52 additions
and
47 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
32 changes: 32 additions & 0 deletions
32
system_files/dx/usr/lib/systemd/system/incus-workaround.service
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,32 @@ | ||
[Unit] | ||
Description=Workaround swtpm not having the correct label | ||
ConditionFileIsExecutable=/usr/bin/incus | ||
ConditionFileIsExecutable=/usr/bin/incus-agent | ||
ConditionPathExists=/usr/lib/incus | ||
After=local-fs.target | ||
|
||
[Service] | ||
Type=oneshot | ||
# Copy if it doesn't exist | ||
ExecStartPre=/usr/bin/bash -c "[ -x /usr/local/bin/overrides/incus ] || /usr/bin/cp /usr/bin/incus /usr/local/bin/overrides/incus" | ||
ExecStartPre=/usr/bin/bash -c "[ -x /usr/local/bin/overrides/incus-agent ] || /usr/bin/cp /usr/bin/incus /usr/local/bin/overrides/incus-agent" | ||
ExecStartPre=/usr/bin/bash -c "[ -d /usr/local/lib/overrides/incus ] || /usr/bin/cp -R /usr/bin/incus /usr/local/lib/overrides/incus" | ||
# This is faster than using .mount unit. Also allows for the previous line/cleanup | ||
ExecStartPre=/usr/bin/mount --bind /usr/local/bin/overrides/incus /usr/bin/incus | ||
ExecStartPre=/usr/bin/mount --bind /usr/local/bin/overrides/incus-agent /usr/bin/incus-agent | ||
ExecStartPre=/usr/bin/mount --bind /usr/local/lib/overrides/incus /usr/lib/incus | ||
# Fix SELinux label | ||
ExecStart=/usr/sbin/restorecon /usr/bin/incus | ||
ExecStart=/usr/sbin/restorecon /usr/bin/incus-agent | ||
ExecStart=/usr/sbin/restorecon -R /usr/lib/incus | ||
# Clean-up after ourselves | ||
ExecStop=/usr/bin/umount /usr/bin/incus | ||
ExecStop=/usr/bin/umount /usr/bin/incus-agent | ||
ExecStop=/usr/bin/umount /usr/lib/incus | ||
ExecStop=/usr/bin/rm /usr/local/bin/overrides/incus | ||
ExecStop=/usr/bin/rm /usr/local/bin/overrides/incus-agent | ||
ExecStop=/usr/bin/rm -r /usr/local/lib/overrides/incus | ||
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
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,3 @@ | ||
C /usr/local/bin/overrides/incus - - - - /usr/bin/incus | ||
C /usr/local/bin/overrides/incus-agent - - - - /usr/bin/incus-agent | ||
C /usr/local/lib/overrides/incus - - - - /usr/lib/incus |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
C /usr/local/bin/.swtpm - - - - /usr/bin/swtpm | ||
C /usr/local/bin/overrides/swtpm - - - - /usr/bin/swtpm | ||
d /var/lib/swtpm-localca 0750 tss tss - - |
File renamed without changes.
File renamed without changes.
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