#!/bin/bash if [ ! -f MAINTAINERS ]; then echo "Run this in a kernel root directory!" 1>&2 exit 1 fi set -xe canned='i386 x86_64 i386-pae' special='i386-allconfig x86_64-allconfig i386-modconfig x86_64-modconfig i386-noconfig x86_64-noconfig' if [ -z "$ALL" ]; then ALL="$canned $special" fi here="$(cd "$(dirname "$0")" && pwd)" if [ -z "$JOBS" ]; then cpus=$(grep '^processor' < /proc/cpuinfo | wc -l) JOBS=$((cpus)) fi # This can be 'ccache gcc' gcc=gcc # # Canned configurations # for c in $canned; do mkdir -p o.$c if [ ! -f o.$c/.config ]; then cp "$here"/config.$c o.$c/.config fi if grep -q -s '^CONFIG_X86_64=' o.$c/.config; then yes '' | make ARCH=x86_64 O=o.$c CC="$gcc" oldconfig else yes '' | make ARCH=i386 O=o.$c CC="$gcc -m32" oldconfig fi done # # Automatic configurations # for a in x86_64 i386; do if [ "$a" = i386 ]; then gccopt=' -m32'; else gccopt=''; fi mkdir -p o.$a-allconfig o.$a-modconfig o.$a-noconfig KCONFIG_ALLCONFIG="$here"/override.yes make ARCH=$a O=o.$a-allconfig CC="$gcc$gccopt" allyesconfig KCONFIG_ALLCONFIG="$here"/override.mod make ARCH=$a O=o.$a-modconfig CC="$gcc$gccopt" allmodconfig KCONFIG_ALLCONFIG="$here"/override.no make ARCH=$a O=o.$a-noconfig CC="$gcc$gccopt" allnoconfig done MKFILE=/tmp/allmake.$$ rm -f $MKFILE fdargs='ro root=/dev/sda1 console=tty0 console=ttyS0,115200 earlyprintk=serial,ttyS0 debug' cat > $MKFILE <> $MKFILE <&1 | tee \$(TEEOPT) o.\$@/make.log EOF done make -j$JOBS -f $MKFILE "$@" make -j$JOBS -f $MKFILE FDARGS="$fdargs" TARGET=isoimage TEEOPT='-a' "$@" rm -f $MKFILE