xref: /freebsd/tools/boot/universe.sh (revision 4f351c1ddcfbd74a93e9969ab7b99f09e785de55)
1c02a64d8SWarner Losh#!/bin/sh
2c02a64d8SWarner Losh
3c02a64d8SWarner Losh#
49e9ba3cdSWarner Losh# Full list of all arches we don't build.
5c02a64d8SWarner Losh#
6*4f351c1dSAndrew Turner#	powerpc/powerpcspe
7c02a64d8SWarner Losh#
8ca987d46SWarner Losh# This script is expected to be run in stand (though you could run it anywhere
9ca987d46SWarner Losh# in the tree). It does a full clean build. For stand you can do all the archs in
10c02a64d8SWarner Losh# about a minute or two on a fast machine. It's also possible that you need a full
11c02a64d8SWarner Losh# make universe for this to work completely.
12c02a64d8SWarner Losh#
13c02a64d8SWarner Losh# Output is put into _.boot.$TARGET_ARCH.log in sys.boot.
14c02a64d8SWarner Losh#
15c02a64d8SWarner Losh
1622ea5a72SWarner Loshdie()
1722ea5a72SWarner Losh{
1822ea5a72SWarner Losh    echo $*
1922ea5a72SWarner Losh    exit 1
2022ea5a72SWarner Losh}
2122ea5a72SWarner Losh
22a179cd91SWarner Loshdobuild()
23a179cd91SWarner Losh{
24a179cd91SWarner Losh    local ta=$1
25a179cd91SWarner Losh    local lf=$2
26a179cd91SWarner Losh    local opt=$3
27a179cd91SWarner Losh
28a179cd91SWarner Losh    echo -n "Building $ta ${opt} ... "
291f99cce2SWarner Losh    objdir=$(make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -V .OBJDIR" | tail -1)
3022ea5a72SWarner Losh    case ${objdir} in
3122ea5a72SWarner Losh	/*) ;;
3222ea5a72SWarner Losh	make*) echo Error message from make: $objdir
3322ea5a72SWarner Losh	       continue ;;
3422ea5a72SWarner Losh	*) die Crazy object dir: $objdir ;;
3522ea5a72SWarner Losh    esac
3602cfd604SWarner Losh    rm -rf ${objdir}
37a179cd91SWarner Losh    if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend"  \
38a179cd91SWarner Losh	 > $lf 2>&1; then
39a179cd91SWarner Losh	echo "Fail (cleanup)"
40a179cd91SWarner Losh	continue
41a179cd91SWarner Losh    fi
429e9ba3cdSWarner Losh    if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make ${opt} -j 40 all"  \
43a179cd91SWarner Losh	 >> $lf 2>&1; then
44a179cd91SWarner Losh	echo "Fail (build)"
45a179cd91SWarner Losh	continue
46a179cd91SWarner Losh    fi
47a179cd91SWarner Losh    echo "Success"
48a179cd91SWarner Losh}
49a179cd91SWarner Losh
509bd6ac8dSWarner Loshtop=$(make -V SRCTOP)
51ca987d46SWarner Loshcd $top/stand
529bd6ac8dSWarner Losh
53ac20456cSWarner Losh# Build without forth
54ac20456cSWarner Loshfor i in \
559e9ba3cdSWarner Losh	arm64/aarch64 \
56ac20456cSWarner Losh	amd64/amd64 \
57ac20456cSWarner Losh	i386/i386 \
58ac20456cSWarner Losh	; do
59ac20456cSWarner Losh    ta=${i##*/}
60ac20456cSWarner Losh    dobuild $ta _.boot.${ta}.no_forth.log "WITHOUT_FORTH=yes"
61ac20456cSWarner Loshdone
6202cfd604SWarner Losh
6302cfd604SWarner Losh# Build without GELI
6402cfd604SWarner Loshfor i in \
659e9ba3cdSWarner Losh	arm64/aarch64 \
6602cfd604SWarner Losh	amd64/amd64 \
6702cfd604SWarner Losh	i386/i386 \
6802cfd604SWarner Losh	; do
6902cfd604SWarner Losh    ta=${i##*/}
7002cfd604SWarner Losh    dobuild $ta _.boot.${ta}.no_geli.log "WITHOUT_LOADER_GEIL=yes"
7102cfd604SWarner Loshdone
7202cfd604SWarner Losh
739e9ba3cdSWarner Losh# Default build for a almost all architectures
74c02a64d8SWarner Loshfor i in \
75c02a64d8SWarner Losh	amd64/amd64 \
76ce6fd199SWarner Losh	arm/armv7 \
77c02a64d8SWarner Losh	arm64/aarch64 \
78c02a64d8SWarner Losh	i386/i386 \
799e9ba3cdSWarner Losh	powerpc/powerpc \
809e9ba3cdSWarner Losh	powerpc/powerpc64 \
819e9ba3cdSWarner Losh	powerpc/powerpc64le \
829e9ba3cdSWarner Losh	riscv/riscv64 \
83c02a64d8SWarner Losh	; do
84c02a64d8SWarner Losh    ta=${i##*/}
85a179cd91SWarner Losh    dobuild $ta _.boot.${ta}.log ""
86c02a64d8SWarner Loshdone
87a179cd91SWarner Losh
88a179cd91SWarner Losh# Build w/o ZFS
89a179cd91SWarner Loshfor i in \
909e9ba3cdSWarner Losh	arm64/aarch64 \
91a179cd91SWarner Losh	amd64/amd64 \
92a179cd91SWarner Losh	i386/i386 \
93a179cd91SWarner Losh	; do
94a179cd91SWarner Losh    ta=${i##*/}
9508585e77SWarner Losh    dobuild $ta _.boot.${ta}.no_zfs.log "MK_LOADER_ZFS=no"
96a179cd91SWarner Loshdone
97078a3113SWarner Losh
98078a3113SWarner Losh# Build w/ LOADER_BIOS_TEXTONLY
99078a3113SWarner Loshfor i in \
100078a3113SWarner Losh	amd64/amd64 \
101078a3113SWarner Losh	i386/i386 \
102078a3113SWarner Losh	; do
103078a3113SWarner Losh    ta=${i##*/}
104078a3113SWarner Losh    dobuild $ta _.boot.${ta}.no_zfs.log "MK_LOADER_BIOS_TEXTONLY=yes"
105078a3113SWarner Loshdone
106