mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
chown volume mountpoints
This commit is contained in:
@@ -116,6 +116,16 @@ impl PersistentContainer {
|
|||||||
.await?;
|
.await?;
|
||||||
let mut volumes = BTreeMap::new();
|
let mut volumes = BTreeMap::new();
|
||||||
for volume in &s9pk.as_manifest().volumes {
|
for volume in &s9pk.as_manifest().volumes {
|
||||||
|
let mountpoint = lxc_container
|
||||||
|
.rootfs_dir()
|
||||||
|
.join("media/startos/volumes")
|
||||||
|
.join(volume);
|
||||||
|
tokio::fs::create_dir_all(&mountpoint).await?;
|
||||||
|
Command::new("chown")
|
||||||
|
.arg("100000:100000")
|
||||||
|
.arg(&mountpoint)
|
||||||
|
.invoke(crate::ErrorKind::Filesystem)
|
||||||
|
.await?;
|
||||||
let mount = MountGuard::mount(
|
let mount = MountGuard::mount(
|
||||||
&IdMapped::new(
|
&IdMapped::new(
|
||||||
Bind::new(data_dir(&ctx.datadir, &s9pk.as_manifest().id, volume)),
|
Bind::new(data_dir(&ctx.datadir, &s9pk.as_manifest().id, volume)),
|
||||||
@@ -123,10 +133,7 @@ impl PersistentContainer {
|
|||||||
100000,
|
100000,
|
||||||
65536,
|
65536,
|
||||||
),
|
),
|
||||||
lxc_container
|
mountpoint,
|
||||||
.rootfs_dir()
|
|
||||||
.join("media/startos/volumes")
|
|
||||||
.join(volume),
|
|
||||||
MountType::ReadWrite,
|
MountType::ReadWrite,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
@@ -134,6 +141,16 @@ impl PersistentContainer {
|
|||||||
}
|
}
|
||||||
let mut assets = BTreeMap::new();
|
let mut assets = BTreeMap::new();
|
||||||
for asset in &s9pk.as_manifest().assets {
|
for asset in &s9pk.as_manifest().assets {
|
||||||
|
let mountpoint = lxc_container
|
||||||
|
.rootfs_dir()
|
||||||
|
.join("media/startos/assets")
|
||||||
|
.join(asset);
|
||||||
|
tokio::fs::create_dir_all(&mountpoint).await?;
|
||||||
|
Command::new("chown")
|
||||||
|
.arg("100000:100000")
|
||||||
|
.arg(&mountpoint)
|
||||||
|
.invoke(crate::ErrorKind::Filesystem)
|
||||||
|
.await?;
|
||||||
assets.insert(
|
assets.insert(
|
||||||
asset.clone(),
|
asset.clone(),
|
||||||
MountGuard::mount(
|
MountGuard::mount(
|
||||||
@@ -145,10 +162,7 @@ impl PersistentContainer {
|
|||||||
)
|
)
|
||||||
.join(asset),
|
.join(asset),
|
||||||
),
|
),
|
||||||
lxc_container
|
mountpoint,
|
||||||
.rootfs_dir()
|
|
||||||
.join("media/startos/assets")
|
|
||||||
.join(asset),
|
|
||||||
MountType::ReadWrite,
|
MountType::ReadWrite,
|
||||||
)
|
)
|
||||||
.await?,
|
.await?,
|
||||||
|
|||||||
Reference in New Issue
Block a user