From 8b475b6cc4965126ba4721a617813577eee6ca9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 15 Mar 2025 17:26:46 +0100 Subject: [PATCH] Allow mounting with an offset When mounting squashfs images embedded in apptainer image, using offset means we don't need to use a temporary copy. --- cmd/go-unsquashfs/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/go-unsquashfs/main.go b/cmd/go-unsquashfs/main.go index 75be53f..0781bcc 100644 --- a/cmd/go-unsquashfs/main.go +++ b/cmd/go-unsquashfs/main.go @@ -11,6 +11,7 @@ import ( func main() { verbose := flag.Bool("v", false, "Verbose") + offset := flag.Int64("o", 0, "Offset") ignore := flag.Bool("ip", false, "Ignore Permissions and extract all files/folders with 0755") flag.Parse() if len(flag.Args()) < 2 { @@ -21,7 +22,7 @@ func main() { if err != nil { panic(err) } - r, err := squashfs.NewReader(f) + r, err := squashfs.NewReaderAtOffset(f, *offset) if err != nil { panic(err) }