Re: kmod & initrd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




 
> I looked into kmod sources and it seems that it's impossible to load
> modules through kmod under initrd because of switching fs context to 
> init fs context before exec modprobe. Is it right ? If no how it is
> possible to do it ?

 use_init_fs_context() switches kmod's fs context to that of the
'init_task' (not the 'init' process). This will ensure that kmod refers
to the original root, even if the current process has done a chroot.
Since the initrd image is mounted as root initially, switching to 
init_task's fs context does not cause any problem.

 The linuxrc script that goes on the initrd image should load all
modules you need (using insmod) in the right order. Then there is no 
need for modprobe. Of course, some code can execute kmod without
checking whether the needed module is already present. But then, any 
error from kmod can be ignored.
 I believe this is what RedHat does. The mkinitrd script creates the
linuxrc script in a way that would make modprobe unnecessary. So they
can have a modprobe which does nothing.

Ravi.

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux