General TC > General TC Talk

loading driver with modeprobe or insmod with parameters

<< < (3/4) > >>

gharig:
Hi Juanito,

I have not tried the module-init-tools extensions, I'm did not know about this, but I will, and I will let you know my results.

Thanks
gharig

gharig:
Hi Juanito and Rich,

The suggestion that Juanito made, to install module_init_tools.tcz was just the ticket.
Now the test program that I created reports the correct values.

So when I run

--- Code: ---sudo insmod ./test.ko Param1=345 Param2=567

--- End code ---

In dmesg I see the following.


--- Code: ---Param1=345
Param2=567

--- End code ---

Thank You Very Much For your help.
Case Closed...


Thanks
gharig 

Rich:
Hi gharig

--- Quote from: gharig on April 29, 2022, 06:51:27 PM --- ... Case Closed...
--- End quote ---
Not so fast. Now that I know the problem wasn't the code, but a problem with the busybox loaders, I decided to
try something. I added the following to  /etc/modprobe.conf:

--- Code: ---options hello-5 myint=7
--- End code ---
Then I ran:

--- Code: ---modprobe hello-5
--- End code ---
Checking dmesg showed that  myint  had been changed from 1 to 7. So the busybox version of modprobe checks
/etc/modprobe.conf  for options.

Rich:
Hi gharig
Although I did not try it, passing options as kernel parameters is something else that should work.

According to  Kernel Parameters  found here:
https://mjmwired.net/kernel/Documentation/kernel-parameters.txt

--- Quote --- ... modprobe looks through the kernel command line (/proc/cmdline) and
collects module parameters when it loads a module ...
--- End quote ---

Adding this boot code should have the same effect as using  /etc/modprobe.conf:

--- Code: ---hello-5.myint=7
--- End code ---

curaga:
If there's a bug on busybox's modprobe params on command line, please report it to busybox.

edit: Oh, no bug, but a missing config option.
# CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS is not set

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version