WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: loading driver with modeprobe or insmod with parameters  (Read 5227 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: loading driver with modeprobe or insmod with parameters
« Reply #15 on: April 30, 2022, 03:55:40 AM »
Hmm - I didn't unset that option, which suggests that when it was introduced the default was the opposite to what existed previously...

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: loading driver with modeprobe or insmod with parameters
« Reply #16 on: April 30, 2022, 08:14:42 AM »
Maybe you could try tc-13.1rc1 to check if things now work with busybox modprobe?

It seems to work for me:
Code: [Select]
sudo modprobe ipv6 disable_ipv6=1
cat /sys/module/ipv6/parameters/disable_ipv6
1
« Last Edit: April 30, 2022, 08:31:48 AM by Juanito »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11634
Re: loading driver with modeprobe or insmod with parameters
« Reply #17 on: April 30, 2022, 08:45:21 AM »
Hi Juanito
It worked under TC4, but not under TC9:
Code: [Select]
tc@box:~$ sudo modprobe usblp
tc@box:~$ cat /sys/module/usblp/parameters/proto_bias
-1
tc@box:~$ sudo modprobe -r usblp
tc@box:~$ sudo modprobe usblp proto_bias=1
tc@box:~$ cat /sys/module/usblp/parameters/proto_bias
-1
tc@box:~$

Offline gharig

  • Newbie
  • *
  • Posts: 24
Re: loading driver with modeprobe or insmod with parameters
« Reply #18 on: April 30, 2022, 07:40:06 PM »
Hi Rich and everyone else....

So today I wanted to verify what Rich suggested by adding options to the /etc/modprobe.conf  And slicker that slick it worked.
I did not load the module_init_tools.tcz.  I'm running Tinycore 13 and I'm only loading compile.tcz

So I added a line to modprobe.conf for my test.ko kernel module which can take two parameters Param1 and Param2, my default values for the test module program are Param1=10 and Param2=20.

Code: [Select]
# /etc/modprobe.conf: Modeprobe config file.
#
options test Param1=345 Param2=789

and when I ran dmesg:
Param1=345
Param2=789

Rich also talked about adding a boot code.
So I commented out the options I added to /etc/modprobe.conf earlier.

Then I modified the file /mnt/sda1/tce/boot/etxlinux/etxlinux.conf

Code: [Select]
#orignal
DEFAULT core
LABEL core
KERNEL /tce/boot/vmlinuz
INITRD /tce/boot/coregz
APPEND quiet syslog waitsub=5:UUID="some long guid" tce=UUID="some long guid"

and changed it to:
Code: [Select]
#new
DEFAULT core
LABEL core
KERNEL /tce/boot/vmlinuz
INITRD /tce/boot/coregz
APPEND quiet syslog test.Param1=111 test.Param2=222 waitsub=5:UUID="some long guid" tce=UUID="some long guid"

 I then rebooted Tinycore13, and reloaded my test module
Code: [Select]
#run as root
 modeprobe test


And the results in dmesg were:
Param1=111
Param2=222

This was success

I then uncommented out the /etc/modprobe.config file and unloaded my test module and made sure everything is clear.
I'm testing to see which has precedence, the boot code vs the modprobe.conf
I reloaded the test module looked at dmesg
And saw
Param1=111
Param2=222

The boot code is the winner it has precedence over modprobe.conf

Now I went to test insmod to see if it to would use the boot code or modprobe.conf
Code: [Select]
#run as root
 insmod ./test.ko
insmod  dose not use the bootcode nor dose it use modprobe.conf, the values in dmesg were the default value for the test module program
Param1=10
Param2=20

So Rich the boot codes work too.

Thanks Everyone
gharig

PS
cant wait to see Tinycore 13.1