Skip to contentSkip to conversation

sysctl: kselftests: use kernel module instead of built-in

PATCH In review Lei Yang 2 participants 3 messages Sep 5, 2018 – Sep 6, 2018

Subsystems (2)
lore
Share & tools
lore

Lei Yang

author
#0 lore raw

PATCH 1/1 sysctl: kselftests: use kernel module instead of built-in

It uses modprobe $TEST_DRIVER in sysctl.sh, so update config to use "m" instead

---
 tools/testing/selftests/sysctl/config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/sysctl/config +1 -1
index 6ca1480..fc263ef 100644
@@ -1 +1 @@
-CONFIG_TEST_SYSCTL=y
+CONFIG_TEST_SYSCTL=m
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 14 lines · Lei Yang

It uses modprobe $TEST_DRIVER in sysctl.sh, so update config to use "m" instead

Signed-off-by Lei Yang <Lei.Yang at windriver.com>
---
 tools/testing/selftests/sysctl/config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/sysctl/config +0 -0
index 6ca1480..fc263ef 100644

tools/testing/selftests/sysctl/config line 1

Quoted 2 lines
tools/testing/selftests/sysctl/config +1 -1
@@ -1 +1 @@
-CONFIG_TEST_SYSCTL=y
+CONFIG_TEST_SYSCTL=m

What happens if it is a built-in? Can you elaborate in the changelog

On that note we might have other cases that do modprobe in scripts and run into the same issue you are trying to solve. :)

thanks,
-- Shuah

author
#2 lore raw
Quoted 19 lines · Shuah Khan
Quoted 14 lines · Lei Yang

It uses modprobe $TEST_DRIVER in sysctl.sh, so update config to use "m" instead

---
  tools/testing/selftests/sysctl/config | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/sysctl/config +0 -0
index 6ca1480..fc263ef 100644

tools/testing/selftests/sysctl/config line 1

Quoted 2 lines
tools/testing/selftests/sysctl/config +1 -1
@@ -1 +1 @@
-CONFIG_TEST_SYSCTL=y
+CONFIG_TEST_SYSCTL=m

What happens if it is a built-in? Can you elaborate in the changelog

Quoted 2 lines

On that note we might have other cases that do modprobe in scripts and run into the same issue you are trying to solve. :)

I double-checked again, found that it doesn't work on either with built-in or kernel module if it's built-in, modprobe test_sysctl still return 0, so it doesn't matter it's a built-in or module.

but the problem is that test_modprobe check module load before modprobe execute , I'll sent a V2 patch to fix this and keep its build-in config untouched

if changes nothing

1) when CONFIG_TEST_SYSCTL=y

root@intel-x86-64:/tmp/sysctl# ./sysctl.sh
Checking production write strict setting ... ok
./sysctl.sh: /sys/module/test_sysctl/ not present
You must have the following enabled in your kernel:
CONFIG_TEST_SYSCTL=y
root@intel-x86-64:/tmp/sysctl# zcat /proc/config.gz |grep TEST_SYS
CONFIG_TEST_SYSCTL=y

2) when CONFIG_TEST_SYSCTL=m

root@intel-x86-64:/tmp/sysctl# ./sysctl.sh
Checking production write strict setting ... ok
./sysctl.sh: /sys/module/test_sysctl/ not present
You must have the following enabled in your kernel:
CONFIG_TEST_SYSCTL=y
root@intel-x86-64:/tmp/sysctl# zcat /proc/config.gz |grep TEST_SYS
CONFIG_TEST_SYSCTL=m

Lei

Quoted 3 lines

thanks,

-- Shuah