spotlights-macbook-air: Initialize muvm
This commit is contained in:
parent
05a7847913
commit
b428477394
6 changed files with 248 additions and 2 deletions
32
hosts/linux/spotlights-macbook-air/muvm/run-passthru.patch
Normal file
32
hosts/linux/spotlights-macbook-air/muvm/run-passthru.patch
Normal file
|
@ -0,0 +1,32 @@
|
|||
diff --git a/crates/muvm/src/guest/mount.rs b/crates/muvm/src/guest/mount.rs
|
||||
index 02c507d..232299b 100644
|
||||
--- a/crates/muvm/src/guest/mount.rs
|
||||
+++ b/crates/muvm/src/guest/mount.rs
|
||||
@@ -14,6 +14,13 @@ use rustix::mount::{
|
||||
use rustix::path::Arg;
|
||||
use serde_json::json;
|
||||
|
||||
+/// A list of directories in /run to be passed through from the host.
|
||||
+const RUN_PASSTHRU: [&str; 2] = [
|
||||
+ // NixOS-specific directories.
|
||||
+ "current-system",
|
||||
+ "opengl-driver",
|
||||
+];
|
||||
+
|
||||
fn make_tmpfs(dir: &str) -> Result<()> {
|
||||
mount2(
|
||||
Some("tmpfs"),
|
||||
@@ -313,6 +320,13 @@ pub fn mount_filesystems(merged_rootfs: bool) -> Result<()> {
|
||||
)
|
||||
.context("Failed to mount `/dev/shm`")?;
|
||||
|
||||
+ for dir in RUN_PASSTHRU {
|
||||
+ let src = Path::new("/run/muvm-host/run").join(dir);
|
||||
+ if src.exists() {
|
||||
+ symlink(src, Path::new("/run").join(dir))?;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// Do this last so it can pick up all the submounts made above.
|
||||
if let Err(e) = mount_fex_rootfs(merged_rootfs) {
|
||||
println!("Failed to mount FEX rootfs, carrying on without. Error: {e}");
|
Loading…
Add table
Add a link
Reference in a new issue