aboutsummaryrefslogtreecommitdiff
path: root/tests/pack_dir_root.sh.in
blob: ad0a08540747253ab1484f52a6e8d94f62bf813c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

set -e

LICDIR="@abs_top_srcdir@/licenses"
REFFILE="@abs_top_srcdir@/tests/pack_dir_root.txt.ref"
GENSQFS="@abs_top_builddir@/gensquashfs"
RDSQFS="@abs_top_builddir@/rdsquashfs"
IMAGE="pack_dir_root.sqfs"
SED="@SED@"

if [ ! -f "$GENSQFS" -a -f "${GENSQFS}.exe" ]; then
	GENSQFS="${GENSQFS}.exe"
	RDSQFS="${RDSQFS}.exe"
fi

"$GENSQFS" --all-root --pack-dir "$LICDIR" --defaults mtime=0 \
	   -c gzip -q "$IMAGE"

"$RDSQFS" -l / "$IMAGE" | "$SED" 's/^-[rwx-]* //g' > "${IMAGE}.txt"

diff "$REFFILE" "${IMAGE}.txt"
rm "$IMAGE" "${IMAGE}.txt"