summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinitrd/initrd-stuff/bin/hwautocfg20
-rw-r--r--initrd/initrd-stuff/etc/functions2
-rwxr-xr-xinitrd/initrd-stuff/init31
-rwxr-xr-xinitrd/mkdxsinitrd12
4 files changed, 41 insertions, 24 deletions
diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg
index 7bd7b7b5..660f201c 100755
--- a/initrd/initrd-stuff/bin/hwautocfg
+++ b/initrd/initrd-stuff/bin/hwautocfg
@@ -336,8 +336,12 @@ for DRIVER in ohci-hcd uhci-hcd ehci-hcd ohci1394; do
modprobe ${MODPRV} ${DRIVER}
DRIVERLIST="${DRIVERLIST} ${DRIVER}"; }
done
-# remove usb core if USB not present
-[ -z "$USB" ] && rmmod usbcore
+# load usbhid (for USB keyboard/mouse) or remove usbcore module if USB
+# not present
+if [ -n "$USB" ] ; then
+ modprobe ${MODPRV} usbhid &
+else rmmod usbcore
+fi
# remove unneeded network card modules
for DRIVER in ${NWMODULES}; do
strinfile " ${DRIVER}" /tmp/hwsetup.info || {
@@ -380,14 +384,12 @@ done
# is initialized
test -f /proc/bus/usb/devices || mount -n -t usbfs usbfs /proc/bus/usb
usleep 10 && hwsetup -v > /tmp/hwsetup.info
-# check if USB mouse and/or keyboard is connected
-if strinfile "genericwheelusb" /tmp/hwsetup.info ; then
- modprobe ${MODPRV} usbhid
-elif strinfile "keybdev" /tmp/hwsetup.info ; then
- modprobe ${MODPRV} usbhid
-fi
+# check if USB mouse and/or keyboard is connected and remove usbhid if
+# not
+strinfile "genericwheelusb" /tmp/hwsetup.info || \
+ strinfile "keybdev" /tmp/hwsetup.info || rmmod usbhid
-# fixme - usb keyboard??
+# load IDE high level drivers
if [ -n "$IDE" ] ; then
# you might want to check /etc/sysconfig/floppy for more info
strinfile "ZIP" /tmp/hwsetup.info && modprobe ${MODPRV} ide_floppy
diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions
index 586c1854..4125acf5 100644
--- a/initrd/initrd-stuff/etc/functions
+++ b/initrd/initrd-stuff/etc/functions
@@ -121,7 +121,7 @@ esac
nfsmnt()
{
local nfsroot=$1
-errmsg="Mount of root filesystem via NFS was requested via kernel command \
+errmsg=" Mount of root filesystem via NFS was requested via kernel command \
line\nbut failed. There might be the following reasons for that:\n\
* No nfs.ko module could be loaded and no NFS support was present in the\n\
running kernel - see error messages above\n\
diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init
index 704a7a18..34f01cce 100755
--- a/initrd/initrd-stuff/init
+++ b/initrd/initrd-stuff/init
@@ -102,6 +102,9 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup
dnbdroot=*)
NBD=dnbd # name of kernel module
NBDOPT=${opts#dnbdroot=};;
+ dcsize=*)
+ # size of cache dnbd should use within ram
+ DNBDCACHESIZE=${opts#dcsize=};;
# nbd server:port,filesystem (filesystem is optional)
nbdroot=*)
NBD=nbd # name of kernel module
@@ -122,6 +125,10 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup
VCI=${opts#vci=};;
esac
done
+# load block device driver if needed
+[ -n "$NBD" ] && modprobe ${MODPRV} ${NBD} || error " Failed to load \
+module ${NBD}.ko. It is needed if you intend to use\n network block \
+device (D)NBD for the client as root filesystem."
# check if at least one type of IP configuration is availabe
if [ -z "$DHCP" -a -z "$LDAP" -a -z "$IPINFO" ] ; then
if strinfile "clientip" /etc/machine-setup ; then
@@ -205,14 +212,11 @@ fi
# if root filesystem should be imported via (d) network block device
if [ -n "${NBD}" ] ; then
- modprobe ${MODPRV} ${NBD} || error " Failed to load module ${NBD}.ko. It \
-is needed if you intend to use\n network block device (D)NBD for the client \
-as root filesystem."
nbdhost=${NBDOPT%:*}
nbdopt=${NBDOPT#*:}
- nbdport=${NBDOPT%,*}
- nbdfs=${NBDOPT#*,}
- echo "Diskless client using ${NBD} server $nbdhost:$nbdport,$nbdfs"
+ nbdport=${nbdopt%,*}
+ nbdfs=${nbdopt#*,}
+ echo "Diskless client using ${NBD} on $nbdhost:$nbdport with $nbdfs"
if [ -z "$nbdfs" ]; then
RFST=ext2;
else
@@ -220,16 +224,23 @@ as root filesystem."
modprobe ${MODPRV} ${RFST} || error " Failed to load the requested \
filesystem module for the client root\n filesystem ontop of the (D)NBD."
fi
+ errmsg=" For some reason the network block device /dev/${NBD}0 never \
+appeared.\n You might want to check udev or your list of static device \
+files."
+
case "${NBD}" in
# network block device present in standard kernel
nbd)
- nbd-client $nbdhost $nbdport /dev/nbd0
+ waitfor /dev/nbd0 10000 || error $errmsg
+ nbd-client $nbdhost $nbdport /dev/nbd0 || error " Failed to start \
+the network block device client. Unable to mount root\n filesystem."
RDEV=/dev/nbd0
;;
# dnbd by Thorsten Zitterell
dnbd)
- mkdir /dnbd
- mount -t tmpfs tmpfs /dnbd
+ #mkdir /dnbd
+ #mount -n -t tmpfs tmpfs /dnbd
+ waitfor /dev/dnbd0 10000 || error $errmsg
while ! dnbd-client -b $dnbdhost -d /dev/dnbd0; do # -c /dnbd/cache
usleep 10
done
@@ -238,7 +249,7 @@ filesystem module for the client root\n filesystem ontop of the (D)NBD."
usleep 20
;;
esac
- mount -o ro $RDEV /mnt
+ mount -n -t $RFST -o ro $RDEV /mnt
fi
# if no type of root filesystem is passed via kernel command line try
# information gathered from dhcp process
diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd
index 7d1ba8f3..5670021b 100755
--- a/initrd/mkdxsinitrd
+++ b/initrd/mkdxsinitrd
@@ -416,8 +416,8 @@ mkdir -p ${INSTDIR}/var/lib/nfs/state
# if nbd
# cobi nbd-client bin
-if [ -n ${FSMODULES} ] ; then
- case ${FSMODULES} in
+if [ -n "${FSMODULES}" ] ; then
+ case "${FSMODULES}" in
dnbd*)
cobi dnbd-client bin
;;
@@ -463,9 +463,13 @@ if [ -z "$INITRD_PATH" ] ; then
INITRD_PATH="/tmp/dxsinitrd.gz"
fi
+# define modules to put into initial ramdisk for debugging
+#DEBUGMODULES="uhci_hcd usbhid"
+DEBUGMODULES=""
+
# put all needed modules into initial ramdisk
mkdir -p ${INSTDIR}/lib/modules/${KERNVER}
-for module in af_packet ${NWMODULES} ${FSMODULES}; do
+for module in af_packet ${NWMODULES} ${FSMODULES} ${DEBUGMODULES}; do
mod=`cd /${ROOTDIR}; find "lib/modules/${KERNVER}" -name ${module}.ko \
2>/dev/null`
if [ -n "$mod" ] ; then
@@ -475,7 +479,7 @@ for module in af_packet ${NWMODULES} ${FSMODULES}; do
# fixmee!! selection of dependent modules could be handled a little bi
# more clever
case "$module" in
- e100|8139too|via-rhine|sis900|epic100|sundance|8139cp|eepro100.ko|pcnet32)
+ e100|8139too|via-rhine|sis900|epic100|sundance|8139cp|eepro100|pcnet32)
cp ${ROOTDIR}/lib/modules/${KERNVER}/kernel/drivers/net/mii.ko \
${INSTDIR}/lib/modules/${KERNVER}/kernel/drivers/net &>/dev/null
;;