diff options
author | Dirk von Suchodoletz | 2007-02-26 14:58:43 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-02-26 14:58:43 +0100 |
commit | afbc62590be2211a9843687f05010600d41d4cb3 (patch) | |
tree | abf2ac086ccb2ec4b8a4aec3e380f30d35bc533e | |
parent | Restructured hwautocfg (moved hw related parts of init into it) - (diff) | |
download | core-afbc62590be2211a9843687f05010600d41d4cb3.tar.gz core-afbc62590be2211a9843687f05010600d41d4cb3.tar.xz core-afbc62590be2211a9843687f05010600d41d4cb3.zip |
Bit of cleanup for hwautocfg ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@722 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-x | initramfs/initrd-stuff/bin/hwautocfg | 83 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/init | 6 |
2 files changed, 38 insertions, 51 deletions
diff --git a/initramfs/initrd-stuff/bin/hwautocfg b/initramfs/initrd-stuff/bin/hwautocfg index 3fd50d93..bfbbe59f 100755 --- a/initramfs/initrd-stuff/bin/hwautocfg +++ b/initramfs/initrd-stuff/bin/hwautocfg @@ -331,11 +331,11 @@ fi # 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 & +[ -x /bin/mdev ] && mdev -s 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 +hwsetup -v > /tmp/hwsetup.info [ $DEBUGLEVEL -eq 21 ] && echo "** finished 2nd hwdetection at $(sysup)" # load IDE high level drivers @@ -361,7 +361,33 @@ if strinfile "SCSI" /tmp/hwsetup.info ; then >> /tmp/scanner-udev fi [ -x /bin/mdev ] && mdev -s -[ $DEBUGLEVEL -eq 21 ] && echo "** finished module loading 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 5; } + driverlist="${driverlist} ${driver}" + fi + fi +done ) & +[ $DEBUGLEVEL -eq 21 ] && echo "** finished most of module loading at $(sysup)" + # 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)" @@ -388,6 +414,8 @@ for hd in $(cat /tmp/hwsetup.info|sed -n -e '/HD$/,/device:/p'| \ part44=yes break done + # determine if tmp preparation should wait for format/mount or not + [ -z "$part44" ] && echo "finished at $(sysup)" > /tmp/tmpready # put detected linux partitions into /etc/fstab with "noauto" for hdpartnr in $(cat /tmp/hd_part | \ sed -n -e "/ 83 /p"|sed -e "s/[[:space:]].*//") ; do @@ -396,36 +424,8 @@ for hd in $(cat /tmp/hwsetup.info|sed -n -e '/HD$/,/device:/p'| \ noexec\t 0 0" >> /tmp/fstab done done -# determine if tmp preparation should wait for format/mount or not -[ -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 || \ @@ -453,17 +453,6 @@ else ( 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 ] && \ -# echo -e "** if you did not run hwautocfg in background and exited the \n\ -#debug shell, expect to wait from now on a while ..." -#waitfor /tmp/fscmpl 40000 -#[ -f /tmp/fstab ] && cat /tmp/fstab >> /mnt/etc/fstab -#[ -f /tmp/scanner-udev ] && cat /tmp/scanner-udev \ -# >> /mnt/etc/udev/rules.d/04-scanner.rules - # add entries to initialize keytable and consolefont to boot.ld # postpone some commands into normal bootup environment #echo -e "\t# entries added by $0: $date" >> /mnt/etc/${D_INITDIR}/boot.ld @@ -494,26 +483,28 @@ return 0 # script run timer [ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \ - echo "** HW setup started at $(sysup)" + echo "** HW $1 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 initializsation: loading USB base modules, starting hwsetup pre) hwpre ;; + # loading network modules nwmod) nwmod ;; + # main part of hardware setup including Xorg main) hwmain # main script run timer or debug information - [ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \ + [ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \ echo "** HW setup finished at $(sysup)" - echo "hwsetup finished at $(sysup)" > /tmp/hwcfg + echo "hwsetup finished at $(sysup)" > /tmp/hwcfg ;; esac - diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index 65ee9687..cdd6ec79 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -76,11 +76,6 @@ 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 ) & hwautocfg pre # run pre init script and user defined preinit.local, copied by mkdxsinitrd @@ -448,6 +443,7 @@ mount -n --bind /mnt/lib/modules/${KERNEL} /lib/modules/${KERNEL} || \ # start hardware configuration as background process if not a special # debuglevel (21) is used for the option of manual hwautocfg start if [ ${DEBUGLEVEL} = 21 ] ; then + echo "You can run 'hwautocfg main &' manually now ..." /bin/sh else [ $DEBUGLEVEL -eq 20 ] && echo "** started hwautocfg in background at \ |