mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
fix uid mapping in squashfs's made from tarballs (#2710)
This commit is contained in:
@@ -47,6 +47,7 @@ smartmontools
|
|||||||
socat
|
socat
|
||||||
sqlite3
|
sqlite3
|
||||||
squashfs-tools
|
squashfs-tools
|
||||||
|
squashfs-tools-ng
|
||||||
sudo
|
sudo
|
||||||
systemd
|
systemd
|
||||||
systemd-resolved
|
systemd-resolved
|
||||||
|
|||||||
@@ -60,14 +60,20 @@ impl SqfsDir {
|
|||||||
.get_or_try_init(|| async move {
|
.get_or_try_init(|| async move {
|
||||||
let guid = Guid::new();
|
let guid = Guid::new();
|
||||||
let path = self.tmpdir.join(guid.as_ref()).with_extension("squashfs");
|
let path = self.tmpdir.join(guid.as_ref()).with_extension("squashfs");
|
||||||
let mut cmd = Command::new("mksquashfs");
|
|
||||||
if self.path.extension().and_then(|s| s.to_str()) == Some("tar") {
|
if self.path.extension().and_then(|s| s.to_str()) == Some("tar") {
|
||||||
cmd.arg("-tar");
|
Command::new("tar2sqfs")
|
||||||
|
.arg(&path)
|
||||||
|
.input(Some(&mut open_file(&self.path).await?))
|
||||||
|
.invoke(ErrorKind::Filesystem)
|
||||||
|
.await?;
|
||||||
|
} else {
|
||||||
|
Command::new("mksquashfs")
|
||||||
|
.arg(&self.path)
|
||||||
|
.arg(&path)
|
||||||
|
.invoke(ErrorKind::Filesystem)
|
||||||
|
.await?;
|
||||||
}
|
}
|
||||||
cmd.arg(&self.path)
|
|
||||||
.arg(&path)
|
|
||||||
.invoke(ErrorKind::Filesystem)
|
|
||||||
.await?;
|
|
||||||
Ok(MultiCursorFile::from(
|
Ok(MultiCursorFile::from(
|
||||||
open_file(&path)
|
open_file(&path)
|
||||||
.await
|
.await
|
||||||
@@ -507,7 +513,7 @@ impl ImageSource {
|
|||||||
Command::new(CONTAINER_TOOL)
|
Command::new(CONTAINER_TOOL)
|
||||||
.arg("export")
|
.arg("export")
|
||||||
.arg(container.trim())
|
.arg(container.trim())
|
||||||
.pipe(Command::new("mksquashfs").arg("-").arg(&dest).arg("-tar"))
|
.pipe(Command::new("tar2sqfs").arg(&dest))
|
||||||
.capture(false)
|
.capture(false)
|
||||||
.invoke(ErrorKind::Docker)
|
.invoke(ErrorKind::Docker)
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user