2 # SPDX-License-Identifier: GPL-2.0+
4 # Build a kvm-ready Linux kernel from the tree in the current directory.
6 # Usage: kvm-build.sh config-template resdir
8 # Copyright (C) IBM Corporation, 2011
10 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
13 if test -z "$config_template" -o ! -f "$config_template" -o ! -r "$config_template"
15 echo "kvm-build.sh :$config_template: Not a readable file"
20 T
=${TMPDIR-/tmp}/test-linux.sh.$$
24 cp ${config_template} $T/config
25 cat << ___EOF___ >> $T/config
26 CONFIG_INITRAMFS_SOURCE="$TORTURE_INITRD"
28 CONFIG_VIRTIO_CONSOLE=y
31 configinit.sh
$T/config
$resdir
38 make -j$ncpus $TORTURE_KMAKE_ARG > $resdir/Make.out
2>&1
40 if test $retval -ne 0 ||
grep "rcu[^/]*": < $resdir/Make.out |
egrep -q "Stop|Error|error:|warning:" ||
egrep -q "Stop|Error|error:" < $resdir/Make.out
42 echo Kernel build error
43 egrep "Stop|Error|error:|warning:" < $resdir/Make.out