From 4427aeac54476088931fb8c6cf18298320cdff72 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Tue, 6 Aug 2024 13:21:12 -0600 Subject: [PATCH] fix asset mounts --- core/startos/src/service/persistent_container.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/startos/src/service/persistent_container.rs b/core/startos/src/service/persistent_container.rs index 23f01605e..c81322719 100644 --- a/core/startos/src/service/persistent_container.rs +++ b/core/startos/src/service/persistent_container.rs @@ -170,17 +170,17 @@ impl PersistentContainer { .arg(&mountpoint) .invoke(crate::ErrorKind::Filesystem) .await?; + let s9pk_asset_path = Path::new("assets").join(asset).with_extension("squashfs"); + let sqfs = s9pk + .as_archive() + .contents() + .get_path(&s9pk_asset_path) + .and_then(|e| e.as_file()) + .or_not_found(s9pk_asset_path.display())?; assets.insert( asset.clone(), MountGuard::mount( - &Bind::new( - asset_dir( - &ctx.datadir, - &s9pk.as_manifest().id, - &s9pk.as_manifest().version, - ) - .join(asset), - ), + &IdMapped::new(LoopDev::from(&**sqfs), 0, 100000, 65536), mountpoint, MountType::ReadWrite, )