#!/bin/sh

# loads modules for network cards and nfs

# copyright 2004 vagrant@freegeek.org, distributed under the terms of the
# GNU General Public License version 2 or any later version.

if [ -r /etc/lessdisks/mkinitrd/initrd-netboot.conf ]; then
  . /etc/lessdisks/mkinitrd/initrd-netboot.conf
fi

if [ -r "$cmdline_opts" ]; then
  . "$cmdline_opts"
fi

if [ "$rootdev" != "/dev/nfs" ]; then
  echo "not loading ethernet modules, root not set to /dev/nfs"
  exit 0
fi

# TODO support NIC="module io=0x???" from kernel commandline
for module in $net_modules $nic_modules ; do
  case $module in
    # support for ne2000 card in qemu, maybe others
    ne|eexpress) module="$module io=0x300" 
  esac
  modprobe -q -k $module > /dev/null 2>&1
done
