File: parallel-build-hdc-img.sh

package info (click to toggle)
busybox 1%3A1.37.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,684 kB
  • sloc: ansic: 190,169; sh: 10,414; cpp: 1,428; makefile: 1,005; asm: 798; yacc: 570; lex: 355; perl: 334; python: 112; awk: 29
file content (40 lines) | stat: -rwxr-xr-x 722 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

export HDBMEGS=100
keep_hdb=false

build_in_dir()
{
	cd "$1" || exit 1
	rm -f hdb.img
	nice -n10 time ./native-build.sh ../hdc.img
	$keep_hdb || rm -f hdb.img
	echo >&3 "Finished: $1"
}

test "$1" = "-s" && {
	dir="$2"
	# single mode: build one directory, show output
	test -d "$dir" || exit 1
	test -e "$dir/native-build.sh" || exit 1
	build_in_dir "$dir"
	exit $?
}

started=false
for dir; do
	test -d "$dir" || continue
	test -e "$dir/native-build.sh" || continue
	echo "Starting: $dir"
	build_in_dir "$dir" 3>&1 </dev/null >"$dir.log" 2>&1 &
	started=true
done

$started || {
	echo "Give me system-image-ARCH directories on command line"
	exit 1
}

echo "Waiting to finish"
wait
echo "Done, check the logs"