Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to modprobe a module from the kernel command line (in my case yaboot, but you are probably more familiar with grub). This is for a workaround for the live CD. I've seen some old advice that says this is possible in Ubuntu. However, it doesn't seem to work for me.

The module I want to load is a framebuffer (so it is normally blacklisted). I don't know if that complicates things, but I can't seem to modprobe any module from the kernel command line. Is there any other Command Line that would do it?

Does anybody know if this is possible, and how you would do it? Thanks.

share|improve this question
    
If you mean if it can be done from within grub (config files), then do remember that your module must be in your /boot/initrd.img-....... initial ramdisk image. –  jippie Apr 20 '12 at 17:21
    
I want to modprobe a module that is not in the initial ramdisk image. –  rsavage Apr 20 '12 at 18:12
    
Then you have to copy it to initrd. –  jippie Apr 20 '12 at 18:21
    
So are you saying the answer to the question is no then? –  rsavage Apr 20 '12 at 18:45
    
As far as my knowledges at this moment in time. –  jippie Apr 20 '12 at 18:46
show 1 more comment

3 Answers 3

Grub uses the insmod command to load up modules. Here's a real-world example from my /boot/grub/grub.cfg file:

menuentry 'Ubuntu, with Linux 3.2.0-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd8,msdos1)'
    search --no-floppy --fs-uuid --set=root 1b66bb9e-5b02-49f1-8cf9-bc3f649d70a6
    linux   /boot/vmlinuz-3.2.0-23-generic root=UUID=1b66bb9e-5b02-49f1-8cf9-bc3f649d70a6 ro   nomodeset pcie_aspm=force
    initrd  /boot/initrd.img-3.2.0-23-generic
}

Whether or not you can script that from yaboot, is another question. If it does work, please leave a comment saying so.

share|improve this answer
    
Thanks for the quick reply! Sadly insmod doesn't seem to work either. yaboot is much simpler than grub. I only have a single config line to play with. Imagine I'm adding the necessary command to the end of your "nomodeset pcie_aspm=force". What I'm doing at the moment is just tagging on: insmod module_name –  rsavage Apr 20 '12 at 17:38
    
All I can do is add to this one line (taken from my installed system): /pci@f4000000/ata-6@d/disk@0:3,/boot/vmlinux initrd=/pci@f4000000/ata-6@d/disk@0:3,/boot/initrd.img root="UUID=b1g-10ng-number-1000" ro –  rsavage Apr 20 '12 at 18:13
    
@Oli IIRC insmod has the same name as module-init-tools' insmod, but apart from that it has nothing to do with kernel module loading. –  Lekensteyn Apr 20 '12 at 19:53
    
That loads grub modules, not kernel modules. –  psusi Apr 20 '12 at 22:25
add comment

Add the module to initrd. There is thread on ServerFault. Refer to the answer that starts with "On a Debian system, you edit /etc/initramfs-tools/modules, and put one mo..."

Are you sure you can't just add your module to /etc/modules? That is the easiest way to go.

share|improve this answer
    
No I can't do that. This is for a workaround for the live CD. I would do what you suggest for the installed system though. –  rsavage Apr 20 '12 at 18:40
    
Is the alternate installation CD an option? It has a lot lower requirements. –  jippie Apr 20 '12 at 18:43
    
I want to replace one framebuffer with another. I can stop the default framebuffer from loading from the kernel command line, but I need to load the replacement too. –  rsavage Apr 20 '12 at 18:50
    
Yeah the alternate is obviously a backup, but I wanted to figure out a way of using the live CD easily. –  rsavage Apr 20 '12 at 18:51
add comment

To load a module when the kernel is called from the bootloader you have only to add the name of the module.

The syntax is the name of the module, if you want to pass an option to the module, type modulenameDOTmoduleoption.

For example, in my old computer I have an ISA Plug & Play Ethernet Adapter RTL8019/11901 that works with the NE module. On the kernel command line I add ne.irq=0x0220 and boot. Finally the card is recognized.

I hope it helps

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.