summaryrefslogtreecommitdiff
path: root/build_all.sh
blob: 6371093e2ab74ea990a1a4494d61bbf1cc569695 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh

# Script to build images for all archs

. ./CONF.sh

rm -rf "$TDIR"
rm -rf "$OUT"
TMP_OUT=$OUT

if [ -z "$ARCHES" ]; then
	export ARCHES='amd64 i386 powerpc'
fi

for FULLARCH in $ARCHES
do
	export ARCH="${FULLARCH%%+*}"
	if [ "$ARCH" = "$FULLARCH" ]; then
		export SUBARCH=
	else
		export SUBARCH="${FULLARCH#*+}"
	fi
	echo "Now we're going to build CD for $FULLARCH !"
	CDREV=`git rev-parse HEAD`
	echo "Using revision $CDREV of debian-cd"

	echo " ... cleaning"
	make distclean
	make init

	echo " ... selecting packages to include"
	make bin-list
	echo " ... building the images"
	export OUT=$TMP_OUT/$FULLARCH; mkdir -p $OUT
	make bin-official_images
	if [ $? -gt 0 ]; then
		echo "ERROR WHILE BUILDING OFFICIAL IMAGES !!" >&2
		# exit 1
		continue
	fi
	echo Generating list files for images
	make pi-makelist
	# XXX: even when we build images for mulitple arches, we only want to
	#  compress those that have IMAGE_FORMAT=img, but that is a per-arch
	#  thing. Right now that's just for riscv64 images.
	#  Let's do this better and allow setting these per-single-arch
	#  somehow nicely.
	if [ "$CDIMAGE_COMPRESS" = 1 ] || [ "$ARCH" = "riscv64" ]; then
		echo Compressing CD images
		make bin-compress_images
	fi
	echo "--------------- `date` ---------------"
done