| 1 |
#! /bin/sh
|
| 2 |
|
| 3 |
# (c) Thomas Lange, 2002-2004, lange@informatik.uni-koeln.de
|
| 4 |
|
| 5 |
# NOTE: Files named *.source will be evaluated, but their output ignored and instead
|
| 6 |
# the contents of $newclasses will be added to the list of defined classes.
|
| 7 |
|
| 8 |
echo 0 > /proc/sys/kernel/printk
|
| 9 |
|
| 10 |
# load all IDE drivers
|
| 11 |
|
| 12 |
# DMA does not work if we load all modules in drivers/ide, so only try pci modules
|
| 13 |
mod=$(find /lib/modules/$(uname -r)/kernel/drivers/ide/pci -type f | sed 's/\.o$//' | sed 's/\.ko$//' | sed 's/.*\///')
|
| 14 |
for i in $mod; do
|
| 15 |
modprobe $i
|
| 16 |
done
|
| 17 |
|
| 18 |
# load additional kernel modules (from old 11modules.source)
|
| 19 |
# this order should also enable DMA for all IDE drives
|
| 20 |
kernelmodules="rtc floppy usbkbd ide-disk ide-cd"
|
| 21 |
case `uname -r` in
|
| 22 |
2.4*) kernelmodules="$kernelmodules keybdev mousedev hid ide-detect isa-pnp" ;;
|
| 23 |
2.6*) kernelmodules="$kernelmodules usbhid usbmouse ide-generic" ;;
|
| 24 |
esac
|
| 25 |
|
| 26 |
for mod in $kernelmodules; do
|
| 27 |
[ "$verbose" ] && echo loading kernel module $mod
|
| 28 |
modprobe -a $mod
|
| 29 |
done
|
| 30 |
|
| 31 |
# let discover do most of the job
|
| 32 |
/etc/init.d/discover start
|
| 33 |
|
| 34 |
# now we can mount the usb file system
|
| 35 |
mount -t usbfs usbfs /proc/bus/usb
|
| 36 |
|
| 37 |
modprobe -a sd_mod sr_mod
|
| 38 |
# are any SCSI devices attached?
|
| 39 |
if grep -q "^Attached devices:[[:space:]]*$" /proc/scsi/scsi; then # 2.6 output
|
| 40 |
:
|
| 41 |
elif grep -q "^Attached devices: none" /proc/scsi/scsi; then # 2.4 output
|
| 42 |
:
|
| 43 |
newclasses="SCSI $newclasses"
|
| 44 |
# we want also get the filename in front of each line. So do not use cat, use grep
|
| 45 |
[ "$verbose" ] && cat /proc/scsi/scsi
|
| 46 |
[ "$debug" ] && grep -H . /proc/scsi/*/*
|
| 47 |
fi
|
| 48 |
echo 6 > /proc/sys/kernel/printk
|
| 49 |
|
| 50 |
# try to detect graphics card
|
| 51 |
# the variable videodrv may be used to generate the XF86config file
|
| 52 |
videodrv=`discover --data-path=xfree86/server/device/driver display`
|
| 53 |
[ -n "$videodrv" ] && echo "videodrv=$videodrv" >> $LOGDIR/additional.var
|
| 54 |
case "$videodrv" in
|
| 55 |
mga) newclasses="$newclasses MATROX"
|
| 56 |
esac
|
| 57 |
echo "Video card detected: $videodrv"
|
| 58 |
|
| 59 |
set_disk_info # calculate number of available disks
|
| 60 |
save_dmesg # save new boot messages (from loading modules)
|