blob: 4e0d57ac078815b8106d8ba2accfd46edb473574 (
plain)
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
|
#!/bin/bash
set -e
b=../scratch/dump-zero
gen() (
local tgt=$1; shift
local log=${tgt%.*}.log
if test -s "$tgt"; then
return
fi
{ set -x; command time --verbose "$@"; } \
>"$tgt" \
2> >(tee >&2 "$log")
)
set -x
go build ./cmd/btrfs-rec
mkdir -p "$b.gen"
{ set +x; } &>/dev/null
gen $b.gen/0.scandevices.json \
./btrfs-rec --pv=$b.img \
inspect scandevices
gen $b.gen/1.mappings.json \
./btrfs-rec --pv=$b.img \
inspect rebuild-mappings $b.gen/0.scandevices.json
gen $b.gen/2.nodes.json \
./btrfs-rec --pv=$b.img --mappings=$b.gen/1.mappings.json \
inspect rebuild-nodes $b.gen/0.scandevices.json
# gen $b.gen/3.ls-files.txt \
# ./btrfs-rec --pv=$b.img --mappings=$b.gen/1.mappings.json \
# inspect ls-files
# gen $b.gen/3.ls-trees.txt \
# ./btrfs-rec --pv=$b.img --mappings=$b.gen/1.mappings.json \
# inspect ls-trees
|