]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: vm: Simplify parameter passing
authorJohannes Berg <johannes.berg@intel.com>
Tue, 12 Jul 2022 21:44:19 +0000 (23:44 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 16 Sep 2022 18:28:23 +0000 (21:28 +0300)
Since the kernel  actually passes the command-line parameters
as environment variables to the init script, there's no need
to parse them out of /proc/cmdline.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
tests/hwsim/vm/inside.sh
tests/hwsim/vm/vm-run.sh

index 9c6a9572b8d8ae3634afd72f42042f93573382d8..d813cf065f7483a1eb83b89956ecefa27bef0ab5 100755 (executable)
@@ -30,19 +30,6 @@ export HOME=/tmp
 sysctl kernel.panic_on_oops=1
 sysctl kernel.panic=1
 
-# get extra command line variables from /proc/cmdline
-TESTDIR=$(sed 's/.*testdir=\([^ ]*\) .*/\1/' /proc/cmdline)
-TIMEWARP=$(sed 's/.*timewarp=\([^ ]*\) .*/\1/' /proc/cmdline)
-EPATH=$(sed 's/.*EPATH=\([^ ]*\) .*/\1/' /proc/cmdline)
-TELNET=$(sed 's/.*TELNET=\([^ ]*\) .*/\1/' /proc/cmdline)
-ARGS=$(sed 's/.*ARGS=\([^ ]*\)\( \|$\).*/\1/' /proc/cmdline)
-LOGDIR=$(sed 's/.*LOGDIR=\([^ ]*\)\( \|$\).*/\1/' /proc/cmdline)
-if grep -q "commitid=" /proc/cmdline; then
-    COMMITID=$(sed 's/.*commitid=\([^ ]*\)\( \|$\).*/\1/' /proc/cmdline)
-else
-    COMMITID=
-fi
-
 mount --bind "$TESTDIR/vm/regdb/" /lib/firmware
 
 if [ "$MODULEDIR" != "" ] ; then
index defea43e87236249c96437c8780db2f10eaac9ff..a4d5a8e762e33e2f587bfcfb521e8b2c0c160f82 100755 (executable)
@@ -148,8 +148,8 @@ A+="cfg80211.dyndbg=+p "
 A+="mac80211.dyndbg=+p "
 A+="mac80211_hwsim.dyndbg=+p "
 A+="init=$CMD "
-A+="testdir=$TESTDIR "
-A+="timewarp=$TIMEWARP "
+A+="TESTDIR=$TESTDIR "
+A+="TIMEWARP=$TIMEWARP "
 A+="MODULEDIR=$MODULEDIR "
 A+="TELNET=$TELNET_ARG "
 A+="EPATH=$EPATH "
@@ -157,7 +157,7 @@ A+="ARGS=$argsfile "
 A+="console=$KVMOUT "
 COMMITID="$(git rev-parse HEAD)"
 if [ -n "$COMMITID" ]; then
-    A+="commitid=$COMMITID "
+    A+="COMMITID=$COMMITID "
 fi
 A+="ro"