summaryrefslogtreecommitdiffstats
path: root/development/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-20 16:34:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-20 16:34:05 +0000
commit17910b92b762000663c665fedbab30f7b1d41bdf (patch)
tree2e8c4fbab094dac1e376dc9395e3cf1cc5e40639 /development/test
parentInitial commit. (diff)
downloadusrmerge-upstream/39.tar.xz
usrmerge-upstream/39.zip
Adding upstream version 39.upstream/39upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'development/test')
-rwxr-xr-xdevelopment/test30
1 files changed, 30 insertions, 0 deletions
diff --git a/development/test b/development/test
new file mode 100755
index 0000000..101f6a1
--- /dev/null
+++ b/development/test
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+
+tmp_cleanup() {
+ [ -d "$BASE" ] || return
+ mountpoint -q "$BASE" || return
+ umount -l $BASE
+ rmdir $BASE
+}
+
+trap "tmp_cleanup" 0 1 2 3 15
+
+BASE=$(mktemp -d)
+mount -t tmpfs tmpfs $BASE -o mode=755,size=401276k
+mkdir $BASE/delta/ $BASE/.work/ $BASE/root/
+
+if [ "$1" ]; then
+ base_dir="$1"
+else
+ base_dir='/'
+fi
+
+mount -t overlay overlay $BASE/root/ \
+ -o workdir=$BASE/.work,lowerdir=$base_dir,upperdir=$BASE/delta
+
+systemd-nspawn --setenv=LANG=C.UTF-8 \
+ --tmpfs=/tmp/:mode=1777 \
+ --bind=/var/cache/apt/archives/ \
+ --register=no \
+ --directory=$BASE/root/ || true
+