summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-02-26 03:33:04 +0100
committerDirk von Suchodoletz2007-02-26 03:33:04 +0100
commite2e6a72fc2a0e57f8332ff18cf8e4c2bde47d6bd (patch)
tree6c941b52530fb7d267a2901a939e3f873764c94e
parentFirst draft of function to stack the root fs from different sources with unionfs (diff)
downloadcore-e2e6a72fc2a0e57f8332ff18cf8e4c2bde47d6bd.tar.gz
core-e2e6a72fc2a0e57f8332ff18cf8e4c2bde47d6bd.tar.xz
core-e2e6a72fc2a0e57f8332ff18cf8e4c2bde47d6bd.zip
Restructured hwautocfg (moved hw related parts of init into it) -
should fix hangs on certain hardware (not fully tested yet) ... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@721 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-xinitramfs/initrd-stuff/bin/hwautocfg229
-rw-r--r--initramfs/initrd-stuff/etc/functions11
-rwxr-xr-xinitramfs/initrd-stuff/init21
-rw-r--r--installer/distro-specs/exclude-suse-10.12
4 files changed, 145 insertions, 118 deletions
diff --git a/initramfs/initrd-stuff/bin/hwautocfg b/initramfs/initrd-stuff/bin/hwautocfg
index 8af598f9..3fd50d93 100755
--- a/initramfs/initrd-stuff/bin/hwautocfg
+++ b/initramfs/initrd-stuff/bin/hwautocfg
@@ -222,40 +222,40 @@ for section in Files ServerFlags Module InputDevice Monitor \
echo -e "EndSection\n" >>$xfc
done
}
-
#############################################################################
-# script starts here
-
-# functions common for all distros
-. /etc/functions
-# functions common for all distros, messages contains all error and
-# info output
-. /etc/messages
-# load distro specific configuration variables and functions. distro
-# specific functions may overwrite functions defined in /etc/functions
-. /etc/sysconfig/config
-. /etc/distro-functions
-
-# script run timer
-[ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \
- echo "** HW setup started at $(sysup)"
-
-# heavy debugging output in level 3 and above and specific for 11
-[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 11 ] && \
- set -x
-
-# set X11 configuration file
-if [ -n "${D_XF86CONFFILE}" ] ; then
- D_XF86CONFFILE="/mnt/${D_XF86CONFFILE}"
-else
- D_XF86CONFFILE="/mnt/etc/X11/xorg.conf"
- error "$hcfg_xcfg" nonfatal
-fi
+# pre part
+hwpre () {
+echo "0 0 0 0" >/proc/sys/kernel/printk
+# start the knoppix hardware autodetection tool
+driverlist="parport parport_pc "
+# hack for pseudo modules (not to load) hopefully "usbcore" is present
+# as a module, might be exchanged with any other existing ...
+for i in $driverlist ; do
+ echo -e "alias\t$i\tusbcore" >> /etc/modprobe.conf
+done
+( hwsetup -n -v > /tmp/hwsetup.info && echo "hwsetup" > /tmp/hwrun1 ) &
+( for mod in usbcore uhci-hcd ohci-hcd usbhid; do
+ modprobe -q $mod 2>/dev/null
+ usleep 5
+done; ) &
+return 0
+}
-# USB core is needed for presence of /proc/bus/usb (path seems to be deprecated
-# in recent kernels!?)
-modprobe ${MODPRV} usbcore &
+#############################################################################
+# network module part
+nwmod () {
+[ $DEBUGLEVEL -eq 20 ] && \
+ echo "** loading all defined network adaptor modules at $(sysup)"
+for mod in ${NWMODULES}; do
+ modprobe ${MODPRV} $mod || error "$init_errnwad"
+ usleep 5
+done
+return 0
+}
+#############################################################################
+# main part
+hwmain () {
# "drivers" (pseudo, placeholder strings, ...) to exclude from loading
# depending on distro more hw modules have to be excluded too. use the
# D_HWMODTOIGNORE for that purpose
@@ -277,14 +277,6 @@ done
[ -f /lib/modules/${KERNEL}/kernel/drivers/input/mousedev.ko ] && \
modprobe ${MODPRV} mousedev
-# start the knoppix hardware autodetection tool
-( hwsetup -v > /tmp/hwsetup.info && echo "hwsetup" > /tmp/hwrun1 ) &
-[ $DEBUGLEVEL -eq 21 ] && echo "** started 1st hwdetection at $(sysup)"
-
-# AGP configuration (agpgart and chipset specific driver) really needed?
-#modprobe ${MODPRV} agpgart || \
-# modprobe ${MODPRV} agpgart agp_try_unsupported=1
-
# wait for /tmp/hwsetup.info to appear
waitfor /tmp/hwrun1 50000 || \
error "$hcfg_hwsetup"
@@ -307,22 +299,16 @@ for driver in ata_piix sata_via sata_nv sata_sil sata_sis sata_svw \
modprobe ${MODPRV} ${driver} &
driverlist="${driverlist} ${driver}"; }
done
-# check for USB, pcmcia and ieee1394 hardware drivers
-for driver in ohci-hcd uhci-hcd ehci-hcd ohci1394; do
+# check for USB2.0, pcmcia and ieee1394 hardware drivers
+for driver in ehci-hcd ohci1394; do
strinfile " ${driver}" /tmp/hwsetup.info && {
USB="yes"
modprobe ${MODPRV} ${driver}
driverlist="${driverlist} ${driver}"; }
done
[ -x /bin/mdev ] && mdev -s &
-# load usbhid (for USB keyboard/mouse) or remove usbcore module if USB
-# is not present
-if [ -n "$USB" ] ; then
- modprobe ${MODPRV} usbhid &
-else rmmod usbcore
-fi
-# remove unneeded network card modules
-for driver in ${NWMODULES}; do
+# remove unneeded network card and USB 1.1 modules
+for driver in ${NWMODULES} ohci-hcd uhci-hcd ; do
strinfile " ${driver}" /tmp/hwsetup.info || {
rmmod ${driver} &
driverlist="${driverlist} ${driver}"; }
@@ -340,47 +326,17 @@ done
if [ -n "${pcmcia}" ] ; then
modprobe ${MODPRV} ds
fi
-# sound card setup (alsa and oss compatibility drivers)
-if [ -f /etc/sysconfig/sound ] ; then
- . /etc/sysconfig/sound
- driver=${DRIVER}
-else driver="snd-dummy"
-fi
-# problem with a specific module not disabled (via above trick) when
-# busybox is used
-# rmmod snd_atiixp_modem snd_atiixp
-modprobe ${MODPRV} ${driver}
-driverlist="${driverlist} ${driver}"
-modprobe ${MODPRV} snd-pcm-oss
-modprobe ${MODPRV} snd-mixer-oss
[ $DEBUGLEVEL -eq 21 ] && echo "** module loading finished at $(sysup)"
# rerun the knoppix hardware autodetection tool for USB and ide devices
# like dvd or harddisk - wait a few seconds so hopefully the ide driver
# is initialized
[ -x /bin/mdev ] && mdev -s &
-[ -n "$ide" ] && modprobe -q ide_generic 2>/dev/null
test -f /proc/bus/usb/devices || \
mount -n -t usbfs usbfs /proc/bus/usb 2>/dev/null
[ $DEBUGLEVEL -eq 21 ] && echo "** started 2nd hwdetection at $(sysup)"
usleep 200 && hwsetup -v > /tmp/hwsetup.info
[ $DEBUGLEVEL -eq 21 ] && echo "** finished 2nd hwdetection at $(sysup)"
-# remaining drivers listed in /tmp/hwsetup.info
-cat /tmp/hwsetup.info| while read line ; do
- if strinstr "driver:" "${line}"; then
- driver=${line##driver: }
- if ! strinstr " ${driver} " "${driverlist}"; then
- strinstr "Card:" "${driver}" || strinstr "ps/2" "${driver}" || {
- modprobe ${MODPRV} ${driver} &
- usleep 50; }
- driverlist="${driverlist} ${driver}"
- fi
- fi
-done
-# check if USB mouse and/or keyboard is connected and remove usbhid if
-# not (does not work properly)
-#strinfile "genericwheelusb" /tmp/hwsetup.info || \
-# (strinfile "keybdev" /tmp/hwsetup.info || rmmod usbhid)
# load IDE high level drivers
if [ -n "$ide" ] ; then
@@ -404,24 +360,8 @@ if strinfile "SCSI" /tmp/hwsetup.info ; then
echo -e 'KERNEL=="sg*",\t\tNAME="%k", GROUP="disk", MODE="666"' \
>> /tmp/scanner-udev
fi
-[ -x /bin/mdev ] && mdev -s &
+[ -x /bin/mdev ] && mdev -s
[ $DEBUGLEVEL -eq 21 ] && echo "** finished module loading at $(sysup)"
-
-# configure some variables from configuration file - wait for dhcp or ldap
-# confiurator to complete
-cfgcomplete
-. /etc/machine-setup
-[ $DEBUGLEVEL -eq 21 ] && echo "** finished waiting for config at $(sysup)"
-
-# run X11 / Xorg configurator if no xorg.conf file was provided by
-# ConfigTGZ (check for /rootfs/${D_XF86CONFFILE#/mnt})
-if [ -f /rootfs${D_XF86CONFFILE#/mnt} ] ; then
- echo "ready" > /tmp/xready
-else
- . /etc/sysconfig/xserver >/dev/null 2>&1 || error "$hcfg_hwsetup" nonfatal
- ( displaysetup /etc/xorg.conf; echo "ready" > /tmp/xready ) &
-fi
-
# get idea of availabe harddisk partitions, put swap partitions into
# (/mnt)/etc/fstab and format and mount partitions of type 44 (unknown)
[ $DEBUGLEVEL -eq 21 ] && echo "** starting hdd stuff at $(sysup)"
@@ -460,6 +400,60 @@ done
[ -z "$part44" ] && echo "finished at $(sysup)" > /tmp/tmpready
[ $DEBUGLEVEL -eq 21 ] && echo "** finished hdd stuff at $(sysup)"
+# sound card setup (alsa and oss compatibility drivers)
+if [ -f /etc/sysconfig/sound ] ; then
+ . /etc/sysconfig/sound
+ driver=${DRIVER}
+else driver="snd-dummy"
+fi
+# problem with a specific module not disabled (via above trick) when
+# busybox is used
+# rmmod snd_atiixp_modem snd_atiixp
+modprobe ${MODPRV} ${driver}
+driverlist="${driverlist} ${driver}"
+modprobe ${MODPRV} snd-pcm-oss
+modprobe ${MODPRV} snd-mixer-oss
+# remaining drivers listed in /tmp/hwsetup.info
+cat /tmp/hwsetup.info| while read line ; do
+ if strinstr "driver:" "${line}"; then
+ driver=${line##driver: }
+ if ! strinstr " ${driver} " "${driverlist}"; then
+ strinstr "Card:" "${driver}" || strinstr "ps/2" "${driver}" || {
+ modprobe ${MODPRV} ${driver} &
+ usleep 20; }
+ driverlist="${driverlist} ${driver}"
+ fi
+ fi
+done
+
+# check if USB mouse and/or keyboard is connected and remove usbhid if
+# not (does not work properly)
+#strinfile "genericwheelusb" /tmp/hwsetup.info || \
+# (strinfile "keybdev" /tmp/hwsetup.info || rmmod usbhid)
+
+# configure some variables from configuration file - wait for dhcp or ldap
+# confiurator to complete
+cfgcomplete
+. /etc/machine-setup
+[ $DEBUGLEVEL -eq 21 ] && echo "** finished waiting for config at $(sysup)"
+
+# run X11 / Xorg configurator if no xorg.conf file was provided by
+# ConfigTGZ (check for /rootfs/${D_XF86CONFFILE#/mnt})
+# set X11 configuration file
+if [ -n "${D_XF86CONFFILE}" ] ; then
+ D_XF86CONFFILE="/mnt/${D_XF86CONFFILE}"
+else
+ D_XF86CONFFILE="/mnt/etc/X11/xorg.conf"
+ error "$hcfg_xcfg" nonfatal
+fi
+if [ -f /rootfs${D_XF86CONFFILE#/mnt} ] ; then
+ echo "ready" > /tmp/xready
+else
+ . /etc/sysconfig/xserver >/dev/null 2>&1 || error "$hcfg_hwsetup" nonfatal
+ ( displaysetup /etc/xorg.conf; echo "ready" > /tmp/xready ) &
+fi
+
+
# wait for completion of clients root filesystem in /mnt and add
# previously generated files to /mnt/etc ...
#[ $DEBUGLEVEL -eq 21 ] && \
@@ -482,13 +476,44 @@ if [ -x /bin/mdev ] ; then
testmkd /dev/input
mknod /dev/input/mice c 13 63 2>/dev/null
fi
+return 0
+}
-# do not finish until tmp is setup properly
-#[ -n "$part44" ] && waitfor /tmp/tmpready 20000
-# not needed --> servconfig waits for it!
+#############################################################################
+# main script starts here
-# script run timer or debug information
+# functions common for all distros
+. /etc/functions
+# functions common for all distros, messages contains all error and
+# info output
+. /etc/messages
+# load distro specific configuration variables and functions. distro
+# specific functions may overwrite functions defined in /etc/functions
+. /etc/sysconfig/config
+. /etc/distro-functions
+
+# script run timer
[ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \
- echo "** HW setup finished at $(sysup)"
+ echo "** HW setup started at $(sysup)"
+
+# heavy debugging output in level 3 and above and specific for 11
+[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 11 ] && \
+ set -x
+
+case $1 in
+ pre)
+ hwpre
+ ;;
+ nwmod)
+ nwmod
+ ;;
+ main)
+ hwmain
+ # main script run timer or debug information
+ [ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \
+ echo "** HW setup finished at $(sysup)"
+ echo "hwsetup finished at $(sysup)" > /tmp/hwcfg
+ ;;
+esac
+
-echo "hwsetup finished at $(sysup)" > /tmp/hwcfg
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index bba03f4a..4dbaf746 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -204,7 +204,7 @@ esac
}
#############################################################################
# load a certain module - name of module with path in argument one, the
-# error message in second argument
+# error message in second argument -- fixme!!
loadmod () {
local modpath=$1
local module=`echo $modpath|sed -e "s,.*/,,"`
@@ -215,6 +215,15 @@ if [ -f $modpath ] ; then
echo "$error_modload '$module'. $msg"
fi
}
+modloader () {
+local path=$1
+local list=$2
+local mod
+for mod in $list ; do
+ insmod /lib/modules/${KERNEL}/${path}/${mod}.ko 2>/dev/null || \
+ modprobe ${MODPRV} ${mod} 2>/dev/null
+done
+}
#############################################################################
# compute prefix bit number from netmask
nm2pref () {
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index 663085c1..65ee9687 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -76,12 +76,12 @@ nfsro="nfs"
# load usb modules for keyboard (reenable usb keyboards, otherwise the
# admin has to wait until second run of hwsetup late in stage3)
-echo "0 0 0 0" >/proc/sys/kernel/printk
-( for mod in usbcore uhci-hcd ohci-hcd usbhid; do
- modprobe -q $mod 2>/dev/null
- usleep 5
-done; echo "1 4 1 7" >/proc/sys/kernel/printk ) &
-
+#echo "0 0 0 0" >/proc/sys/kernel/printk
+#( for mod in usbcore uhci-hcd ohci-hcd usbhid; do
+# modprobe -q $mod 2>/dev/null
+# usleep 5
+#done; echo "1 4 1 7" >/proc/sys/kernel/printk ) &
+hwautocfg pre
# run pre init script and user defined preinit.local, copied by mkdxsinitrd
# from /var/lib/openslx/config/... in stage2
@@ -283,12 +283,7 @@ else
[ "${DEBUGLEVEL}" != 8 ] && exec < /dev/console > /dev/null 2>&1
fi
# load network adaptor modules
-[ $DEBUGLEVEL -eq 20 ] && \
- echo "** loading all defined network adaptor modules at $(sysup)"
-for mod in ${NWMODULES}; do
- modprobe ${MODPRV} $mod || error "$init_errnwad"
- usleep 5
-done
+hwautocfg nwmod
# set up loopback networking (ipsetup - function defined in /etc/functions)
[ $DEBUGLEVEL -eq 20 ] && echo "** starting ip config at $(sysup)"
@@ -457,7 +452,7 @@ if [ ${DEBUGLEVEL} = 21 ] ; then
else
[ $DEBUGLEVEL -eq 20 ] && echo "** started hwautocfg in background at \
$(sysup)"
- hwautocfg &
+ hwautocfg main &
fi
# try to use unionfs for rw access if available
diff --git a/installer/distro-specs/exclude-suse-10.1 b/installer/distro-specs/exclude-suse-10.1
index 8a4c2666..587429ce 100644
--- a/installer/distro-specs/exclude-suse-10.1
+++ b/installer/distro-specs/exclude-suse-10.1
@@ -1,6 +1,4 @@
+ /media
-+ /lib/modules/*/misc/vmnet.o
-+ /lib/modules/*/misc/vmmon.o
+ /usr/lib/gcc/*/*/*.o
+ /usr/lib/*.o
+ /usr/lib/perl5/*/*/*/*.o