-
-
Notifications
You must be signed in to change notification settings - Fork 47
Add support for running a custom init (including systemd) #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
valpackett
wants to merge
15
commits into
AsahiLinux:main
Choose a base branch
from
valpackett:custom-init
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
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! |
8be45f2 to
0393a2e
Compare
This is particularly useful for Nix, to avoid patching code when building. Signed-off-by: Val Packett <[email protected]>
Signed-off-by: Val Packett <[email protected]>
And use it for MUVM_UDEVD_PATH Signed-off-by: Val Packett <[email protected]>
To remove the need for a sysctl binary. Signed-off-by: Val Packett <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Running x86_64 emulators on x86_64 is not typically desired, so only try initializing them without flags on aarch64. While here, let's call Box64 Box64 and not Box. Signed-off-by: Val Packett <[email protected]>
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 <[email protected]>
…-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 <[email protected]>
Support running the PipeWire bridge as a separate process, optionally with systemd socket activation. Signed-off-by: Val Packett <[email protected]>
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 <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Signed-off-by: Val Packett <[email protected]>
0393a2e to
1c57e86
Compare
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: