diff mbox series

tests: vm: simplify parameter passing

Message ID 20220712234419.c4b7ade0fae2.If0ade1e796a14f1996d43248a72d583c740cff17@changeid
State Accepted
Headers show
Series tests: vm: simplify parameter passing | expand

Commit Message

Johannes Berg July 12, 2022, 9:44 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

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 | 13 -------------
 tests/hwsim/vm/vm-run.sh |  6 +++---
 2 files changed, 3 insertions(+), 16 deletions(-)

Comments

Jouni Malinen Sept. 16, 2022, 7:21 p.m. UTC | #1
On Tue, Jul 12, 2022 at 11:44:19PM +0200, Johannes Berg wrote:
> 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.

Thanks, applied.
diff mbox series

Patch

diff --git a/tests/hwsim/vm/inside.sh b/tests/hwsim/vm/inside.sh
index 9c6a9572b8d8..d813cf065f74 100755
--- a/tests/hwsim/vm/inside.sh
+++ b/tests/hwsim/vm/inside.sh
@@ -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
diff --git a/tests/hwsim/vm/vm-run.sh b/tests/hwsim/vm/vm-run.sh
index b79e1d8f890b..e891676a4dfd 100755
--- a/tests/hwsim/vm/vm-run.sh
+++ b/tests/hwsim/vm/vm-run.sh
@@ -152,8 +152,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 "
@@ -161,7 +161,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"