fix asset mounts

This commit is contained in:
Aiden McClelland
2024-08-06 13:21:12 -06:00
parent 93640bb08e
commit 4427aeac54

View File

@@ -170,17 +170,17 @@ impl PersistentContainer {
.arg(&mountpoint) .arg(&mountpoint)
.invoke(crate::ErrorKind::Filesystem) .invoke(crate::ErrorKind::Filesystem)
.await?; .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( assets.insert(
asset.clone(), asset.clone(),
MountGuard::mount( MountGuard::mount(
&Bind::new( &IdMapped::new(LoopDev::from(&**sqfs), 0, 100000, 65536),
asset_dir(
&ctx.datadir,
&s9pk.as_manifest().id,
&s9pk.as_manifest().version,
)
.join(asset),
),
mountpoint, mountpoint,
MountType::ReadWrite, MountType::ReadWrite,
) )