[Peeweelinux] system initialization

Adi Linden [email protected]
Thu, 22 Aug 2002 13:00:15 -0500 (CDT)


>   - network card module present but I had to load it with "modprobe"
>   - modprobe fails because no modules.dep
>   - modules.dep is created by "depmod"
>   - have to run "depmod"
>   - have to run ifconfig to bring up network card

I usually use insmod and have it load the required modules in the 
proper sequence. This eliminates the need for depmod and /etc/modules.conf 
amongst things.

> The issue with ifconfig led me through the 10Network script, 
> wherein I found that it will find the ifcfg-eth0 file in
> /etc/config and use the contents of that to construct an
> appropriate ifconfig...up command.   The assumption that
> this would work by itself proved to be correct after I
> fixed the driver issue.   However, at this time I discovered
> the place to put the IP address (or to set dhcp if I wish
> to try that).

If you create /etc/config/ifcfg-eth0 with the appropriate content the 
network startup script will automatically configure the network interface. 
The syntax for the file is similar to RedHats. I.e.

  DEVICE=eth0
  IPADDR=192.168.1.1
  NETMASK=255.255.255.0
  
There is also support for specifying BROADCAST and NETWORK addresses if 
needed. If dhcp is used instead of static addressing do this instead:

  DEVICE=eth0
  BOOTPROTO=dhcp

This will reqire that either pump or dhcpcd are installed.

> The driver modules was a little more interesting.  Looking
> through the target scripts I find that there could be 
> an /etc/rc.modules, which, if present, will read a file
> /etc/modules and use that as a list of modules to
> be loaded.   This pair of files was not present in my 
> target system, nor was it present on my host RedHat system;
> but they were present on my Coyote (LRP) system.  So, 
> without any more clues, I decided to write my own rc.modules
> file which runs depmod, then loads the modules for the
> network card.  That way I have kept the customizations to a
> minimum.  
> 
> I know that insmod will load modules without the help of
> modules.dep   The issue of depmod was somewhat of an experimental
> investigation (I figured I should know about it).  One thing
> that seems to be likely is that depmod can be run on the
> kernel libraries after they are compiled, and possibly the
> resulting modules.dep can be copied to the target system and
> then no depmod is required.
> 
> The last issue is that I put "alias eth0 ne2k-pci" into modules.conf
> but I was unable to discover who reads that information.  That would
> be the other way these modules get loaded (and seems to be the way
> it's done in our real linux boxes.)
> 
> So the questions are:
>   - what runs depmod during startup?
>   - do embedded systems usually have a prebuilt modules.dep?
>   - what uses modules.conf to find out what modules to load?

There is no automatic way to run depmod since the intend was to run insmod 
instead. So you would create an /etc/rc.modules containing something like:

  insmod ne2k-pci
  
And what ever else modules you need to load. If there are module 
dependencies you would need to add insmod lines for those in the proper 
order to satisfy dependencies.

Hope this helps,
Adi