Add support for running a custom init (including systemd)#202
Draft
valpackett wants to merge 7 commits intoAsahiLinux:mainfrom
Draft
Add support for running a custom init (including systemd)#202valpackett wants to merge 7 commits intoAsahiLinux:mainfrom
valpackett wants to merge 7 commits intoAsahiLinux:mainfrom
Conversation
1b4e3c2 to
adeadc7
Compare
4aeec04 to
8be45f2
Compare
Contributor
Author
|
ping. any general feedback on this direction of work, on the changes currently on this branch? |
Collaborator
|
LGTM so far! |
0393a2e to
1c57e86
Compare
1c57e86 to
0a04990
Compare
Allow the user to replace muvm-guest with a custom init process. With updated libkrun, it will even run as PID 1, making it possible to run systemd. Of course, this is not the suggested way to use muvm, but some use cases necesitate the use of systemd. The next few commits will facilitate running individual parts of muvm-guest as separate processes under a custom service manager. Signed-off-by: Val Packett <val@invisiblethingslab.com>
…-network To better support running under a custom service manager (e.g. systemd), allow running individual functions of the guest binary when called with distinct binary names. Signed-off-by: Val Packett <val@invisiblethingslab.com>
Support running the PipeWire bridge as a separate process, optionally with systemd socket activation. Signed-off-by: Val Packett <val@invisiblethingslab.com>
This is how OnceLock is really meant to be used.. This will be helpful for the custom init support, where various ways of starting the bridge loop will be used. Signed-off-by: Val Packett <val@invisiblethingslab.com>
Signed-off-by: Val Packett <val@invisiblethingslab.com>
Signed-off-by: Val Packett <val@invisiblethingslab.com>
Signed-off-by: Val Packett <val@invisiblethingslab.com>
0a04990 to
ae7dbd4
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
..yeah, you might say that this has really gone off the rails :) but we want to be able to ship apps with background services, configured the usual nix way just like on the host (which means systemd units are used to make them run).
Since containers/libkrun#424 libkrun can run a custom init as PID 1, so now we can run systemd. It turned out to be quite easy to "disaggregate" muvm-guest into separate services that systemd can manage.. well, separately. Here I made it work like a busybox-style "mega binary" where what it does depends on what it's called as (
argv[0]). I haven't yet added all the services, but I've already included pwbridge here as an example of supporting socket activation.muvm-systemd-pwb.av1.webm
fun fact: I only found #201 because I went to implement this. :) and I did replicate that feature in systemd: