forked from tytso/xfstests-bld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-tarball
executable file
·109 lines (100 loc) · 2.6 KB
/
gen-tarball
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
set -e
if test -f config.custom ; then
. config.custom
else
. config
fi
if test -n "$ACCEL_BIN" -a -d "$ACCEL_BIN" ; then
PATH="$ACCEL_BIN:$PATH"
if test -x "$ACCEL_BIN/bash" ; then
SHELL="$ACCEL_BIN/bash"
fi
fi
if test -n "$TOOLCHAIN_DIR" -a -d "$TOOLCHAIN_DIR"; then
PATH=$TOOLCHAIN_DIR/bin:$PATH
fi
if test -n "$CROSS_COMPILE" ; then
STRIP=$CROSS_COMPILE-strip
else
STRIP=strip
fi
while [ "$1" != "" ];
do
case $1 in
--fast)
fast=yes
;;
*)
echo "unknown option: $1"
exit 1
;;
esac
shift
done
if type -P pigz >/dev/null; then
GZIP="pigz -9nT"
else
GZIP="gzip -9n"
fi
if test -z "$SOURCE_DATE_EPOCH" ; then
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
fi
echo "GEN xfstests"
rm -rf xfstests
if test "$fast" = "yes"
then
cp -r xfstests-dev xfstests
rm -rf xfstests/.git xfstests/autom4te.cache
else
(D=$(pwd) ; cd xfstests-dev ; make install PKG_LIB_DIR=$D/xfstests \
INSTALL=install SHELL=$SHELL)
cp xfstests-dev/README* xfstests
fi
echo "xfstests-bld $(git describe --always --dirty) ($(git log -1 --pretty=%cD))" > xfstests-bld.ver
if test -e kvm-xfstests/test-appliance/debs ; then
debs_vers=$(find kvm-xfstests/test-appliance/debs -name "*.ver" -print)
else
debs_vers=
fi
cat *.ver $debs_vers | sort > xfstests/git-versions
if test -f build-distro ; then
cp build-distro xfstests/build-distro
else
rm -f xfstests/build-distro
fi
mkdir -p xfstests/bin xfstests/lib
cp bld/bin/* bld/sbin/* xfstests/bin
if test -d bld/usr/bin ; then
cp bld/usr/bin/* xfstests/bin
fi
cp bld/lib/client.txt xfstests/lib
if test -d bld/share/man ; then
mkdir -p xfstests/share/man
cp -r bld/share/man/* xfstests/share/man
fi
if test -d bld/man ; then
mkdir -p xfstests/share/man
cp -r bld/man/* xfstests/share/man
fi
if test -d xfstests/share/man ; then
find xfstests/share/man -type f | xargs gzip -9
fi
# ima-evm-utils is optional.
if test -e bld/lib/libimaevm.so.0.0.0; then
cp bld/lib/libimaevm.so.0.0.0 xfstests/lib
ln -s libimaevm.so.0.0.0 xfstests/lib/libimaevm.so.0
fi
rm -f xfstests/bin/compile_et xfstests/bin/mk_cmds
for i in ltp/fsstress ltp/fsx ltp/aio-stress src/godown
do
ln -s ../$i xfstests/bin
done
echo "STRIP xfstests/*"
find xfstests -mindepth 2 -type f -perm /0111 | xargs $STRIP 2> /dev/null \
|| true
echo "TAR xfstests"
find xfstests blktests -path blktests/.git -prune -o -print0 | \
LC_ALL=C sort -z | \
tar c --owner=0 --group=0 --numeric-owner --mtime="@${SOURCE_DATE_EPOCH}" \
--mode=go+u-w --null --no-recursion -T - | $GZIP > xfstests.tar.gz