power: supply: bq24190_charger: Add disable-reset device-property
[linux/fpc-iii.git] / tools / testing / selftests / rcutorture / bin / configinit.sh
blob50a6371b2b2e473e342072aead44bd1c61972321
1 #!/bin/bash
3 # Usage: configinit.sh config-spec-file [ build output dir ]
5 # Create a .config file from the spec file. Run from the kernel source tree.
6 # Exits with 0 if all went well, with 1 if all went well but the config
7 # did not match, and some other number for other failures.
9 # The first argument is the .config specification file, which contains
10 # desired settings, for example, "CONFIG_NO_HZ=y". For best results,
11 # this should be a full pathname.
13 # The second argument is a optional path to a build output directory,
14 # for example, "O=/tmp/foo". If this argument is omitted, the .config
15 # file will be generated directly in the current directory.
17 # This program is free software; you can redistribute it and/or modify
18 # it under the terms of the GNU General Public License as published by
19 # the Free Software Foundation; either version 2 of the License, or
20 # (at your option) any later version.
22 # This program is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
27 # You should have received a copy of the GNU General Public License
28 # along with this program; if not, you can access it online at
29 # http://www.gnu.org/licenses/gpl-2.0.html.
31 # Copyright (C) IBM Corporation, 2013
33 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
35 T=/tmp/configinit.sh.$$
36 trap 'rm -rf $T' 0
37 mkdir $T
39 # Capture config spec file.
41 c=$1
42 buildloc=$2
43 builddir=
44 if test -n $buildloc
45 then
46 if echo $buildloc | grep -q '^O='
47 then
48 builddir=`echo $buildloc | sed -e 's/^O=//'`
49 if test ! -d $builddir
50 then
51 mkdir $builddir
53 else
54 echo Bad build directory: \"$buildloc\"
55 exit 2
59 sed -e 's/^\(CONFIG[0-9A-Z_]*\)=.*$/grep -v "^# \1" |/' < $c > $T/u.sh
60 sed -e 's/^\(CONFIG[0-9A-Z_]*=\).*$/grep -v \1 |/' < $c >> $T/u.sh
61 grep '^grep' < $T/u.sh > $T/upd.sh
62 echo "cat - $c" >> $T/upd.sh
63 make mrproper
64 make $buildloc distclean > $builddir/Make.distclean 2>&1
65 make $buildloc $TORTURE_DEFCONFIG > $builddir/Make.defconfig.out 2>&1
66 mv $builddir/.config $builddir/.config.sav
67 sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
68 cp $builddir/.config $builddir/.config.new
69 yes '' | make $buildloc oldconfig > $builddir/Make.oldconfig.out 2> $builddir/Make.oldconfig.err
71 # verify new config matches specification.
72 configcheck.sh $builddir/.config $c
74 exit 0