mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

  1. #!/bin/bash
  2. echo "Trying to autodetect hardware..."
  3. read a b version c < /proc/version
  4. /bin/hwscan -k ${version} >/tmp/hardware
  5. if [ `grep -c '^# ' /tmp/hardware` -gt 0 ] ; then
  6. echo 'Found the following:'
  7. grep '^# ' /tmp/hardware | sed 's,^# ,- ,g'
  8. echo 'Now trying to initialise them...'
  9. . /tmp/hardware
  10. fi
  11. # looks like hwscan just silently fails if something is missing
  12. # for example it says it found 0 modules, while executing that
  13. # find command brings up 400-odd files. We'll just load
  14. # _everything_ in that case.
  15. if [ ! -s /tmp/hardware ] ; then
  16. echo "EEP! hwscan screwed up!"
  17. echo -n "Trying emergency module loading ... "
  18. for x in `find /lib/modules/ -name '*.ko'` ; do
  19. insmod ${x} >/dev/null 2>&1
  20. done
  21. echo "done"
  22. fi
  23. if [ ! -e /dev/sound/dsp ] ; then
  24. echo 'EEP! We have no sound!'
  25. echo 'You can switch to another console with -<Alt>- + -<F2>- to try'
  26. echo 'and load a sound-module by hand.'
  27. echo
  28. echo 'Press -<Enter>- when done to continue ...'
  29. read
  30. fi
  31. if [ ! -e /dev/sound/dsp ] ; then
  32. echo "Still no sound. Continuing anyway"
  33. fi
  34. exit 0