torture: Make --bootargs override .boot file entries
If there are kernel boot parameter values specified via --bootargs that
conflict with those in the .boot file, both parameters are passed to the
kernel, which might or might not be desirable. This commit therefore
modifies the configfrag_boot_params() sh function to eliminate an kernel
boot parameters given via --bootargs from the .boot file.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index 07a1377..aaf1a8a 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -56,11 +56,20 @@
#
# Adds boot parameters from the .boot file, if any.
configfrag_boot_params () {
- if test -r "$2.boot"
+ local T=/tmp/T-configfrag_boot_params.$$
+ if ! test -r "$2.boot"
then
- echo $1 `grep -v '^#' "$2.boot" | tr '\012' ' '`
+ echo "$1"
else
- echo $1
+ mkdir $T
+ grep -v '^#' < $2.boot | tr -s " " "\012" |
+ sed -e 's/$/ /' > $T/boot.configparams
+ echo "$1" | tr -s ' ' '\012' | sed -e 's/=.*$//' |
+ sed -e 's/^/grep -v "/' -e 's/$/[ =]" |/' \
+ > $T/boot.script
+ echo "cat" >> $T/boot.script
+ echo `sh $T/boot.script < $T/boot.configparams` $1
+ rm -rf $T
fi
}