xref: /freebsd/tools/boot/universe.sh (revision 61da91207d30f84533b0943ca66be8e1b51d5112)
1#!/bin/sh
2
3# $FreeBSD$
4
5#
6# Full list of all arches, but we only build a subset. All different mips add any
7# value, and there's a few others we just don't support.
8#
9#	mips/mipsel mips/mips mips/mips64el mips/mips64 mips/mipsn32 \
10#	mips/mipselhf mips/mipshf mips/mips64elhf mips/mips64hf \
11#	powerpc/powerpc powerpc/powerpc64 powerpc/powerpcspe \
12#	riscv/riscv64 riscv/riscv64sf
13#
14# This script is expected to be run in stand (though you could run it anywhere
15# in the tree). It does a full clean build. For stand you can do all the archs in
16# about a minute or two on a fast machine. It's also possible that you need a full
17# make universe for this to work completely.
18#
19# Output is put into _.boot.$TARGET_ARCH.log in sys.boot.
20#
21
22dobuild()
23{
24    local ta=$1
25    local lf=$2
26    local opt=$3
27
28    echo -n "Building $ta ${opt} ... "
29    objdir=$(make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -V .OBJDIR")
30    rm -rf ${objdir}
31    if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend"  \
32	 > $lf 2>&1; then
33	echo "Fail (cleanup)"
34	continue
35    fi
36    if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make ${opt} -j 20 all"  \
37	 >> $lf 2>&1; then
38	echo "Fail (build)"
39	continue
40    fi
41    echo "Success"
42}
43
44top=$(make -V SRCTOP)
45cd $top/stand
46
47
48# Build without GELI
49for i in \
50	amd64/amd64 \
51	i386/i386 \
52	; do
53    ta=${i##*/}
54    dobuild $ta _.boot.${ta}.no_geli.log "WITHOUT_LOADER_GEIL=yes"
55done
56
57# Default build for a goodly selection of architectures
58for i in \
59	amd64/amd64 \
60	arm/arm arm/armeb arm/armv7 \
61	arm64/aarch64 \
62	i386/i386 \
63	mips/mips mips/mips64 \
64	powerpc/powerpc powerpc/powerpc64 \
65	sparc64/sparc64 \
66	; do
67    ta=${i##*/}
68    dobuild $ta _.boot.${ta}.log ""
69done
70
71# Build w/o ZFS
72for i in \
73	amd64/amd64 \
74	i386/i386 \
75	sparc64/sparc64 \
76	; do
77    ta=${i##*/}
78    dobuild $ta _.boot.${ta}.no_zfs.log "MK_ZFS=no"
79done
80
81# Build with firewire
82for i in \
83	amd64/amd64 \
84	i386/i386 \
85	; do
86    ta=${i##*/}
87    dobuild $ta _.boot.${ta}.firewire.log "MK_LOADER_FIREWIRE=yes"
88done
89