summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/sparse-gunzip6
-rw-r--r--tests.as-root/lib4
2 files changed, 8 insertions, 2 deletions
diff --git a/scripts/sparse-gunzip b/scripts/sparse-gunzip
new file mode 100755
index 00000000..b6e1aa16
--- /dev/null
+++ b/scripts/sparse-gunzip
@@ -0,0 +1,6 @@
+#!/usr/bin/python
+from morphlib.util import copyfileobj
+import gzip, sys
+infh = gzip.GzipFile(fileobj=sys.stdin)
+copyfileobj(infh, sys.stdout)
+infh.close()
diff --git a/tests.as-root/lib b/tests.as-root/lib
index 6818abde..2492bb53 100644
--- a/tests.as-root/lib
+++ b/tests.as-root/lib
@@ -21,8 +21,8 @@ loopback_rootfs() {
# Find offset partition offset in a rootfs and mount it
ROOTFS="$1"
- mv "$ROOTFS" "$ROOTFS-unzipped.gz"
- gunzip "$ROOTFS-unzipped.gz"
+ PYTHONPATH="$SRCDIR" "$SRCDIR/scripts/sparse-gunzip" \
+ <"$ROOTFS" >"$ROOTFS-unzipped"
OFFSET=$(sfdisk -d "$ROOTFS-unzipped" | \
grep -m 1 -o 'start=\s\+\([0-9]\+\)' | awk '{ print $2 }')