2014-07-11 15:31:27 -06:00
|
|
|
#!/bin/bash
|
2019-02-11 08:14:09 -07:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2013-09-28 15:12:21 -06:00
|
|
|
#
|
torture: Run kernel build in source directory
For historical reasons, rcutorture places its build products in a
tools/testing/selftests/rcutorture/b1 directory using the O= kbuild
command-line argument. However, doing this requires that the source
directory be pristine: Not just "make clean" pristine, but instead "make
mrproper" (or, equivalently, "make distclean") pristine. Therefore,
rcutorture executes a "make mrproper" before each build. Unfortunately,
"make mrproper" has the side effect of removing pretty much everything,
including tags files and cscope databases, which can be inconvenient
to people whose workflow centers around a single source tree.
This commit therefore makes rcutorture do the build directly in the
source directory, removing the need for "make mrproper". This works
because all needed build products are moved to their proper place in the
"res" directory immediately after the build completes, so that multiple
rcutorture kernels can still run concurrently.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-10 22:31:52 -06:00
|
|
|
# Usage: configinit.sh config-spec-file results-dir
|
2013-09-28 15:12:21 -06:00
|
|
|
#
|
|
|
|
# Create a .config file from the spec file. Run from the kernel source tree.
|
|
|
|
# Exits with 0 if all went well, with 1 if all went well but the config
|
|
|
|
# did not match, and some other number for other failures.
|
|
|
|
#
|
|
|
|
# The first argument is the .config specification file, which contains
|
|
|
|
# desired settings, for example, "CONFIG_NO_HZ=y". For best results,
|
|
|
|
# this should be a full pathname.
|
|
|
|
#
|
2013-12-03 10:54:18 -07:00
|
|
|
# Copyright (C) IBM Corporation, 2013
|
|
|
|
#
|
2019-02-11 08:14:09 -07:00
|
|
|
# Authors: Paul E. McKenney <paulmck@linux.ibm.com>
|
2013-09-28 15:12:21 -06:00
|
|
|
|
2017-08-30 16:33:49 -06:00
|
|
|
T=${TMPDIR-/tmp}/configinit.sh.$$
|
2013-09-28 15:12:21 -06:00
|
|
|
trap 'rm -rf $T' 0
|
|
|
|
mkdir $T
|
|
|
|
|
|
|
|
# Capture config spec file.
|
|
|
|
|
|
|
|
c=$1
|
torture: Run kernel build in source directory
For historical reasons, rcutorture places its build products in a
tools/testing/selftests/rcutorture/b1 directory using the O= kbuild
command-line argument. However, doing this requires that the source
directory be pristine: Not just "make clean" pristine, but instead "make
mrproper" (or, equivalently, "make distclean") pristine. Therefore,
rcutorture executes a "make mrproper" before each build. Unfortunately,
"make mrproper" has the side effect of removing pretty much everything,
including tags files and cscope databases, which can be inconvenient
to people whose workflow centers around a single source tree.
This commit therefore makes rcutorture do the build directly in the
source directory, removing the need for "make mrproper". This works
because all needed build products are moved to their proper place in the
"res" directory immediately after the build completes, so that multiple
rcutorture kernels can still run concurrently.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-10 22:31:52 -06:00
|
|
|
resdir=$2
|
2013-09-28 15:12:21 -06:00
|
|
|
|
|
|
|
sed -e 's/^\(CONFIG[0-9A-Z_]*\)=.*$/grep -v "^# \1" |/' < $c > $T/u.sh
|
|
|
|
sed -e 's/^\(CONFIG[0-9A-Z_]*=\).*$/grep -v \1 |/' < $c >> $T/u.sh
|
|
|
|
grep '^grep' < $T/u.sh > $T/upd.sh
|
|
|
|
echo "cat - $c" >> $T/upd.sh
|
2019-05-11 21:18:00 -06:00
|
|
|
if test -z "$TORTURE_TRUST_MAKE"
|
|
|
|
then
|
|
|
|
make clean > $resdir/Make.clean 2>&1
|
|
|
|
fi
|
torture: Run kernel build in source directory
For historical reasons, rcutorture places its build products in a
tools/testing/selftests/rcutorture/b1 directory using the O= kbuild
command-line argument. However, doing this requires that the source
directory be pristine: Not just "make clean" pristine, but instead "make
mrproper" (or, equivalently, "make distclean") pristine. Therefore,
rcutorture executes a "make mrproper" before each build. Unfortunately,
"make mrproper" has the side effect of removing pretty much everything,
including tags files and cscope databases, which can be inconvenient
to people whose workflow centers around a single source tree.
This commit therefore makes rcutorture do the build directly in the
source directory, removing the need for "make mrproper". This works
because all needed build products are moved to their proper place in the
"res" directory immediately after the build completes, so that multiple
rcutorture kernels can still run concurrently.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-10 22:31:52 -06:00
|
|
|
make $TORTURE_DEFCONFIG > $resdir/Make.defconfig.out 2>&1
|
|
|
|
mv .config .config.sav
|
|
|
|
sh $T/upd.sh < .config.sav > .config
|
|
|
|
cp .config .config.new
|
|
|
|
yes '' | make oldconfig > $resdir/Make.oldconfig.out 2> $resdir/Make.oldconfig.err
|
2013-09-28 15:12:21 -06:00
|
|
|
|
|
|
|
# verify new config matches specification.
|
torture: Run kernel build in source directory
For historical reasons, rcutorture places its build products in a
tools/testing/selftests/rcutorture/b1 directory using the O= kbuild
command-line argument. However, doing this requires that the source
directory be pristine: Not just "make clean" pristine, but instead "make
mrproper" (or, equivalently, "make distclean") pristine. Therefore,
rcutorture executes a "make mrproper" before each build. Unfortunately,
"make mrproper" has the side effect of removing pretty much everything,
including tags files and cscope databases, which can be inconvenient
to people whose workflow centers around a single source tree.
This commit therefore makes rcutorture do the build directly in the
source directory, removing the need for "make mrproper". This works
because all needed build products are moved to their proper place in the
"res" directory immediately after the build completes, so that multiple
rcutorture kernels can still run concurrently.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-10 22:31:52 -06:00
|
|
|
configcheck.sh .config $c
|
2013-09-28 15:12:21 -06:00
|
|
|
|
|
|
|
exit 0
|