forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/tools/testing/selftests/rcutorture/bin/kvm-build.sh
....@@ -1,26 +1,19 @@
11 #!/bin/bash
2
+# SPDX-License-Identifier: GPL-2.0+
23 #
34 # Build a kvm-ready Linux kernel from the tree in the current directory.
45 #
5
-# Usage: kvm-build.sh config-template build-dir resdir
6
-#
7
-# This program is free software; you can redistribute it and/or modify
8
-# it under the terms of the GNU General Public License as published by
9
-# the Free Software Foundation; either version 2 of the License, or
10
-# (at your option) any later version.
11
-#
12
-# This program is distributed in the hope that it will be useful,
13
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
-# GNU General Public License for more details.
16
-#
17
-# You should have received a copy of the GNU General Public License
18
-# along with this program; if not, you can access it online at
19
-# http://www.gnu.org/licenses/gpl-2.0.html.
6
+# Usage: kvm-build.sh config-template resdir
207 #
218 # Copyright (C) IBM Corporation, 2011
229 #
23
-# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
10
+# Authors: Paul E. McKenney <paulmck@linux.ibm.com>
11
+
12
+if test -f "$TORTURE_STOPFILE"
13
+then
14
+ echo "kvm-build.sh early exit due to run STOP request"
15
+ exit 1
16
+fi
2417
2518 config_template=${1}
2619 if test -z "$config_template" -o ! -f "$config_template" -o ! -r "$config_template"
....@@ -28,8 +21,7 @@
2821 echo "kvm-build.sh :$config_template: Not a readable file"
2922 exit 1
3023 fi
31
-builddir=${2}
32
-resdir=${3}
24
+resdir=${2}
3325
3426 T=${TMPDIR-/tmp}/test-linux.sh.$$
3527 trap 'rm -rf $T' 0
....@@ -42,14 +34,14 @@
4234 CONFIG_VIRTIO_CONSOLE=y
4335 ___EOF___
4436
45
-configinit.sh $T/config O=$builddir $resdir
37
+configinit.sh $T/config $resdir
4638 retval=$?
4739 if test $retval -gt 1
4840 then
4941 exit 2
5042 fi
5143 ncpus=`cpus2use.sh`
52
-make O=$builddir -j$ncpus $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
44
+make -j$ncpus $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
5345 retval=$?
5446 if test $retval -ne 0 || grep "rcu[^/]*": < $resdir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $resdir/Make.out
5547 then