Skip to content

Commit

Permalink
muvm: init from krun as 0-unstable-2024-10-10
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Oct 17, 2024
1 parent a8a769d commit 4db4337
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,39 @@
, passt
, sommelier
, mesa
, replaceVars
, systemd
, opengl-driver ? mesa.drivers
, withSommelier ? false
}:

rustPlatform.buildRustPackage rec {
pname = "krun";
version = "0-unstable-2024-06-18";
pname = "muvm";
version = "0-unstable-2024-10-10";

src = fetchFromGitHub {
owner = "slp";
owner = "AsahiLinux";
repo = pname;
rev = "912afa5c6525b7c8f83dffd65ec4b1425b3f7521";
hash = "sha256-rDuxv3UakAemDnj4Nsbpqsykts2IcseuQmDwO24L+u8=";
rev = "98e2563f2380ff33eb4527c845f8792808c212c6";
hash = "sha256-KLHfm48a2/nPwnozMwpqxTFlvEezx9SbxI63yy7sxgc=";
};

cargoHash = "sha256-8Bj8tfFVUDMB2ixcvS7A/Y7Lev4vT1NGm6WiBzYmOSU=";

patches = [
(fetchpatch {
url = "https://github.com/slp/krun/pull/39.diff";
hash = "sha256-CV69L+VDDLRcWgpgDCAYKLlTU9ytFcHhzNgOibWD8KY=";
})
(fetchpatch {
url = "https://github.com/slp/krun/pull/38.diff";
hash = "sha256-cK3iDhh+33H16V65lWUXahjmpSxI1HhiLUmkjfkRB7A=";
(replaceVars ./replace-udevd.patch {
systemd-udevd = lib.getExe' systemd "systemd-udevd";
})
];

cargoHash = "sha256-NahnigxJaY2QwWnySCRrnf3JyqZ+7jRA1CpE7ON0OOE=";

nativeBuildInputs = [
rustPlatform.bindgenHook
makeWrapper
];

buildInputs = [
(libkrun.override {
withBlk = true;
withGpu = true;
withNet = true;
})
Expand All @@ -54,13 +52,13 @@ rustPlatform.buildRustPackage rec {
];

postFixup = ''
wrapProgram $out/bin/krun $wrapArgs \
wrapProgram $out/bin/muvm $wrapArgs \
--set-default OPENGL_DRIVER ${opengl-driver}
'';

meta = {
description = "Run programs from your system in a microVM";
homepage = "https://github.com/slp/krun";
homepage = "https://github.com/AsahiLinux/muvm";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ RossComputerGuy ];
platforms = libkrun.meta.platforms;
Expand Down
12 changes: 12 additions & 0 deletions pkgs/by-name/mu/muvm/replace-udevd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/crates/muvm/src/guest/bin/muvm-guest.rs b/crates/muvm/src/guest/bin/muvm-guest.rs
index 311b2ca..b726547 100644
--- a/crates/muvm/src/guest/bin/muvm-guest.rs
+++ b/crates/muvm/src/guest/bin/muvm-guest.rs
@@ -38,7 +38,7 @@ fn main() -> Result<()> {
if let Err(err) = mount_filesystems() {
return Err(err).context("Failed to mount filesystems, bailing out");
}
- Command::new("/usr/lib/systemd/systemd-udevd").spawn()?;
+ Command::new("@systemd-udevd@").spawn()?;

setup_fex()?;

0 comments on commit 4db4337

Please sign in to comment.