Lines Matching +full:build +full:- +full:in
2 # SPDX-License-Identifier: GPL-2.0+
4 # Run a kvm-based test of the specified tree on the specified configs.
7 # Execute this in the source tree. Do not run it as a background task
10 # Usage: kvm-test-1-run.sh config resdir seconds qemu-args boot_args_in
12 # qemu-args defaults to "-enable-kvm -display none -no-reboot", along
19 # Anything you specify for either qemu-args or boot_args_in is appended to
20 # the default values. The "-smp" value is deduced from the contents of
29 T="`mktemp -d ${TMPDIR-/tmp}/kvm-test-1-run.sh.XXXXXX`"
30 trap 'rm -rf $T' 0
36 config_dir=`echo $config_template | sed -e 's,/[^/]*$,,'`
37 title=`echo $config_template | sed -e 's/^.*\///'`
39 if test -z "$resdir" -o ! -d "$resdir" -o ! -w "$resdir"
41 echo "kvm-test-1-run.sh :$resdir: Not a writable directory, cannot store results into it"
44 echo ' ---' `date`: Starting build, PID $$
45 echo ' ---' Kconfig fragment at: $config_template >> $resdir/log
50 # second the to-be-updated file within $T, and the third and final the
54 if test -n "$3"
56 echo $3 | sed -e 's/^ *//' -e 's/ *$//' | tr -s " " "\012" > $T/Kconfig_args
57 echo " --- $1" >> $resdir/ConfigFragment.input
67 config_override_param "--gdb options" KcList "$TORTURE_KCONFIG_GDB_ARG"
68 config_override_param "--kasan options" KcList "$TORTURE_KCONFIG_KASAN_ARG"
69 config_override_param "--kcsan options" KcList "$TORTURE_KCONFIG_KCSAN_ARG"
70 config_override_param "--kconfig argument" KcList "$TORTURE_KCONFIG_ARG"
71 config_override_param "$config_dir/CFcommon.$(uname -m)" KcList \
72 "`cat $config_dir/CFcommon.$(uname -m) 2> /dev/null`"
75 base_resdir=`echo $resdir | sed -e 's/\.[0-9]\+$//'`
76 if test "$base_resdir" != "$resdir" && (test -f $base_resdir/bzImage || test -f $base_resdir/Image) && test -f $base_resdir/vmlinux
82 ln -s $base_resdir/Make*.out $resdir # for kvm-recheck.sh
83 ln -s $base_resdir/.config $resdir # for kvm-recheck.sh
84 # Arch-independent indicator
88 # Rerunning previous test for which build failed
89 ln -s $base_resdir/Make*.out $resdir # for kvm-recheck.sh
90 ln -s $base_resdir/.config $resdir # for kvm-recheck.sh
91 echo Initial build failed, not running KVM, see $resdir.
92 if test -f $resdir/build.wait
94 mv $resdir/build.wait $resdir/build.ready
97 elif kvm-build.sh $T/KcList $resdir
99 # Had to build a kernel for this test.
106 if test -n "$BOOT_IMAGE"
110 # Arch-independent indicator
116 parse-build.sh $resdir/Make.out $title
118 # Build failed.
120 echo Build failed, not running KVM, see $resdir.
121 if test -f $resdir/build.wait
123 mv $resdir/build.wait $resdir/build.ready
127 if test -f $resdir/build.wait
129 mv $resdir/build.wait $resdir/build.ready
131 while test -f $resdir/build.ready
139 if test -z "$TORTURE_BUILDONLY"
141 echo ' ---' `date`: Starting kernel
144 # Generate -smp qemu argument.
145 qemu_args="-enable-kvm -display none -no-reboot $qemu_args"
148 if test "$cpu_count" -gt "$TORTURE_ALLOTED_CPUS"
150 echo CPU count limited from $cpu_count to $TORTURE_ALLOTED_CPUS | tee -a $resdir/Warnings
156 # Generate architecture-specific and interaction-specific qemu arguments
159 # Generate qemu -append arguments
162 # Pull in Kconfig-fragment boot parameters
164 # Generate kernel-version-specific boot parameters
166 if test -n "$TORTURE_BOOT_GDB_ARG"
171 # Give bare-metal advice
172 modprobe_args="`echo $boot_args | tr -s ' ' '\012' | grep "^$TORTURE_MOD\." | sed -e "s/$TORTURE_MOD\.//g"`"
173 kboot_args="`echo $boot_args | tr -s ' ' '\012' | grep -v "^$TORTURE_MOD\."`"
175 touch $resdir/bare-metal
176 echo To run this scenario on bare metal: >> $resdir/bare-metal
177 echo >> $resdir/bare-metal
178 echo " 1." Set your bare-metal build tree to the state shown in this file: >> $resdir/bare-metal
179 echo " " $testid_txt >> $resdir/bare-metal
180 echo " 2." Update your bare-metal build tree"'"s .config based on this file: >> $resdir/bare-metal
181 echo " " $resdir/ConfigFragment >> $resdir/bare-metal
182 echo " 3." Make the bare-metal kernel"'"s build system aware of your .config updates: >> $resdir/bare-metal
183 echo " " $ 'yes "" | make oldconfig' >> $resdir/bare-metal
184 echo " 4." Build your bare-metal kernel. >> $resdir/bare-metal
185 echo " 5." Boot your bare-metal kernel with the following parameters: >> $resdir/bare-metal
186 echo " " $kboot_args >> $resdir/bare-metal
187 echo " 6." Start the test with the following command: >> $resdir/bare-metal
188 echo " " $ modprobe $TORTURE_MOD $modprobe_args >> $resdir/bare-metal
189 echo " 7." After some time, end the test with the following command: >> $resdir/bare-metal
190 echo " " $ rmmod $TORTURE_MOD >> $resdir/bare-metal
191 echo " 8." Copy your bare-metal kernel"'"s .config file, overwriting this file: >> $resdir/bare-metal
192 echo " " $resdir/.config >> $resdir/bare-metal
193 echo " 9." Copy the console output from just before the modprobe to just after >> $resdir/bare-metal
194 echo " " the rmmod into this file: >> $resdir/bare-metal
195 echo " " $resdir/console.log >> $resdir/bare-metal
196 echo "10." Check for runtime errors using the following command: >> $resdir/bare-metal
197 echo " " $ tools/testing/selftests/rcutorture/bin/kvm-recheck.sh `dirname $resdir` >> $resdir/bare-metal
198 echo >> $resdir/bare-metal
199 echo Some of the above steps may be skipped if you build your bare-metal >> $resdir/bare-metal
200 echo kernel here: `head -n 1 $testid_txt | sed -e 's/^Build directory: //'` >> $resdir/bare-metal
202 echo $QEMU $qemu_args -m $TORTURE_QEMU_MEM -kernel $KERNEL -append \"$qemu_append $boot_args\" $TORTURE_QEMU_GDB_ARG > $resdir/qemu-cmd
203 echo "# TORTURE_SHUTDOWN_GRACE=$TORTURE_SHUTDOWN_GRACE" >> $resdir/qemu-cmd
204 echo "# seconds=$seconds" >> $resdir/qemu-cmd
205 echo "# TORTURE_KCONFIG_GDB_ARG=\"$TORTURE_KCONFIG_GDB_ARG\"" >> $resdir/qemu-cmd
206 echo "# TORTURE_JITTER_START=\"$TORTURE_JITTER_START\"" >> $resdir/qemu-cmd
207 echo "# TORTURE_JITTER_STOP=\"$TORTURE_JITTER_STOP\"" >> $resdir/qemu-cmd
208 echo "# TORTURE_TRUST_MAKE=\"$TORTURE_TRUST_MAKE\"; export TORTURE_TRUST_MAKE" >> $resdir/qemu-cmd
209 echo "# TORTURE_CPU_COUNT=$cpu_count" >> $resdir/qemu-cmd
211 if test -n "$TORTURE_BUILDONLY"
213 echo Build-only run specified, boot/test omitted.
218 kvm-test-1-run-qemu.sh $resdir
219 parse-console.sh $resdir/console.log $title