Hi all, I created a kernel module which can be passed some command line arguments (I tried that with insmod and it works).
Now I would like, when I start the kernel with grub, to have this module loaded at boot time so I can pass, at boot time, a kernel boot option to it.
I mean having something like kernel vmlinuz root=/dev/ram0 initrd=linuxrc mymodule.param1="myparamvalue" initrd ....
is it possible?
Thanks, Luca
2010/1/9 Luca lucarx76@gmail.com:
Hi all, I created a kernel module which can be passed some command line arguments (I tried that with insmod and it works).
Now I would like, when I start the kernel with grub, to have this module loaded at boot time so I can pass, at boot time, a kernel boot option to it.
I think this usually happens in a modules configuration file. Something like this? "https://fedoraproject.org/wiki/KernelCommonProblems#How_to_set_module_option..."
-c
Thank you. I do not have the file /etc/modprobe.conf
Besides, I think what I want to do is little different, as I want to be able with grub to change the value assigned to mymodule's argument.
Essentially, I have mymodule.ko. If i do insmod mymodule.ko param="valueOfParam" I can see everything works (looking at /proc/devices I can see mymodule has registered) and I can read param (the read function implemented in mymodule just returns the value of the string module argument param.
What I would like to do now, is to use grub and do something like ttile Fedora root (hd1,0) kernel /vmlinuz-2.6.30.9 ro root=/dev/.... mymodule.param="valueOfParam" initrd /initrd-2.6.30.9
Tried several things so far, but with no luck.
Thank you Luca
On Fri, Jan 8, 2010 at 2:17 PM, Chris Smart mail@christophersmart.comwrote:
2010/1/9 Luca lucarx76@gmail.com:
Hi all, I created a kernel module which can be passed some command line
arguments
(I tried that with insmod and it works).
Now I would like, when I start the kernel with grub, to have this module loaded at boot time so I can pass, at boot time, a kernel boot option to
it.
I think this usually happens in a modules configuration file. Something like this? " https://fedoraproject.org/wiki/KernelCommonProblems#How_to_set_module_option... "
-c
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
On Mon, 11 Jan 2010, Luca wrote:
Thank you. I do not have the file /etc/modprobe.conf
Besides, I think what I want to do is little different, as I want to be able with grub to change the value assigned to mymodule's argument.
Essentially, I have mymodule.ko. If i do insmod mymodule.ko param="valueOfParam" I can see everything works (looking at /proc/devices I can see mymodule has registered) and I can read param (the read function implemented in mymodule just returns the value of the string module argument param.
What I would like to do now, is to use grub and do something like ttile Fedora root (hd1,0) kernel /vmlinuz-2.6.30.9 ro root=/dev/.... mymodule.param="valueOfParam" initrd /initrd-2.6.30.9
Tried several things so far, but with no luck.
i'm pretty sure that you can only use that "mymodule.param" notation on the kernel command line for modules that have been *compiled into* the kernel, no? that won't work for loadable modules, but i'm willing to be corrected.
rday --
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ========================================================================
You are right. My module has been compiled into the kernel though. But when the kernel starts I do not see it registered.
This is what I did 1)saved my module .c file in drivers/crypto/ 2)edited drivers/kernel/Makefile adding obj-$(CONFIG_CRYPTO_MYMODULE) += mymodule.o 3)edited the drivers/crypto/Kconfig adding config CRYPTO_MYMODULE tristate "My module test" help Enable to test it
4)make menuconfig => setting my module to be built into the kernel
Thank you, Luca
On Mon, Jan 11, 2010 at 6:55 AM, Robert P. J. Day rpjday@crashcourse.cawrote:
On Mon, 11 Jan 2010, Luca wrote:
Thank you. I do not have the file /etc/modprobe.conf
Besides, I think what I want to do is little different, as I want to be able with grub to change the value assigned to mymodule's argument.
Essentially, I have mymodule.ko. If i do insmod mymodule.ko param="valueOfParam" I can see everything works (looking at /proc/devices I can see mymodule has registered) and I can read param (the read function implemented in mymodule just returns the value of the string module argument param.
What I would like to do now, is to use grub and do something like ttile Fedora root (hd1,0) kernel /vmlinuz-2.6.30.9 ro root=/dev/....
mymodule.param="valueOfParam"
initrd /initrd-2.6.30.9
Tried several things so far, but with no luck.
i'm pretty sure that you can only use that "mymodule.param" notation on the kernel command line for modules that have been *compiled into* the kernel, no? that won't work for loadable modules, but i'm willing to be corrected.
rday
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ======================================================================== -- users mailing list users@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Sorry my bad. It actual works compiling the module into the kernel and then using module.param=value sintax.
Sorry again.
Thank you, Luca
On Mon, Jan 11, 2010 at 7:01 AM, Luca lucarx76@gmail.com wrote:
You are right. My module has been compiled into the kernel though. But when the kernel starts I do not see it registered.
This is what I did 1)saved my module .c file in drivers/crypto/ 2)edited drivers/kernel/Makefile adding obj-$(CONFIG_CRYPTO_MYMODULE) += mymodule.o 3)edited the drivers/crypto/Kconfig adding config CRYPTO_MYMODULE tristate "My module test" help Enable to test it
4)make menuconfig => setting my module to be built into the kernel
Thank you, Luca
On Mon, Jan 11, 2010 at 6:55 AM, Robert P. J. Day rpjday@crashcourse.cawrote:
On Mon, 11 Jan 2010, Luca wrote:
Thank you. I do not have the file /etc/modprobe.conf
Besides, I think what I want to do is little different, as I want to be able with grub to change the value assigned to mymodule's argument.
Essentially, I have mymodule.ko. If i do insmod mymodule.ko param="valueOfParam" I can see everything works (looking at /proc/devices I can see mymodule has registered) and I can read param (the read function implemented in mymodule just returns the value of the string module argument param.
What I would like to do now, is to use grub and do something like ttile Fedora root (hd1,0) kernel /vmlinuz-2.6.30.9 ro root=/dev/....
mymodule.param="valueOfParam"
initrd /initrd-2.6.30.9
Tried several things so far, but with no luck.
i'm pretty sure that you can only use that "mymodule.param" notation on the kernel command line for modules that have been *compiled into* the kernel, no? that won't work for loadable modules, but i'm willing to be corrected.
rday
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ======================================================================== -- users mailing list users@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
please don't top post.
On Mon, 11 Jan 2010, Luca wrote:
Sorry my bad. It actual works compiling the module into the kernel and then using module.param=value sintax.
Sorry again.
Thank you, Luca
On Mon, Jan 11, 2010 at 7:01 AM, Luca lucarx76@gmail.com wrote: You are right. My module has been compiled into the kernel though. But when the kernel starts I do not see it registered.
This is what I did 1)saved my module .c file in drivers/crypto/ 2)edited drivers/kernel/Makefile adding obj-$(CONFIG_CRYPTO_MYMODULE) += mymodule.o 3)edited the drivers/crypto/Kconfig adding config CRYPTO_MYMODULE tristate "My module test" help Enable to test it 4)make menuconfig => setting my module to be built into the kernel Thank you, Luca
can you be more specific? what *exactly* did you use to set that module parameter? what did you use for the "module" string, and how did that relate to the module you compiled into the kernel?
rday --
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ========================================================================
On Mon, 2010-01-11 at 09:55 -0500, Robert P. J. Day wrote:
On Mon, 11 Jan 2010, Luca wrote:
What I would like to do now, is to use grub and do something like ttile Fedora root (hd1,0) kernel /vmlinuz-2.6.30.9 ro root=/dev/.... mymodule.param="valueOfParam" initrd /initrd-2.6.30.9
Tried several things so far, but with no luck.
i'm pretty sure that you can only use that "mymodule.param" notation on the kernel command line for modules that have been *compiled into* the kernel, no? that won't work for loadable modules, but i'm willing to be corrected.
Sorry for the lag in replying, don't read fedora-users often.
Actually, it does work for loadable modules because since a while now modprobe will parse the kernel command line for parameters.
Jon.