added cups
[fai-configs.git] / class / 20-hwdetect.source
CommitLineData
2d1f8014 1#! /bin/bash
2
3# (c) Thomas Lange, 2002-2009, lange@informatik.uni-koeln.de
4
5# NOTE: Files named *.source will be evaluated, but their output ignored. Instead
6# the contents of $newclasses will be added to the list of defined classes.
7
8[ $do_init_tasks -eq 1 ] || return 0 # Do only execute when doing install
9
10echo 0 > /proc/sys/kernel/printk
11
12# load all IDE drivers
13
14# DMA does not work if we load all modules in drivers/ide, so only try pci modules
15if [ -d /lib/modules/$(uname -r)/kernel/drivers/ide/pci ] ; then
16 mod=$(find /lib/modules/$(uname -r)/kernel/drivers/ide/pci -type f | sed 's/\.ko$//' | sed 's/.*\///')
17 for i in $mod; do
18 modprobe $i 1>/dev/null 2>&1
19 done
20fi
21
22# Booting from CD does not always enable DMA.
23for d in $( echo /proc/ide/hd[a-z] 2>/dev/null); do
24 [ -d $d ] && echo "using_dma:1" > $d/settings
25done
26
27# load additional kernel modules
28kernelmodules="usbkbd ide-disk"
29case $(uname -r) in
30 2.6*) kernelmodules="$kernelmodules mptspi dm-mod md-mod aes dm-crypt" ;;
31esac
32
33for mod in $kernelmodules; do
34 [ "$verbose" ] && echo loading kernel module $mod
35 modprobe -a $mod 1>/dev/null 2>&1
36done
37
38# let discover do most of the job
39#[ -x /sbin/discover-modprobe ] && /sbin/discover-modprobe
40
41# now we can mount the USB filesystem
42mount -t usbfs usbfs /proc/bus/usb
43
44modprobe -a sd_mod sr_mod
45
46echo $printk > /proc/sys/kernel/printk
47
48set_disk_info # calculate number of available disks
49save_dmesg # save new boot messages (from loading modules)
50