File: bootcdmodprobe

package info (click to toggle)
bootcd 3.10%2Bnmu1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 508 kB
  • ctags: 128
  • sloc: sh: 3,935; makefile: 117
file content (50 lines) | stat: -rwxr-xr-x 1,131 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# We need CDROM and FLOPPY

mydiscover1()
{
	discover --format="%m\n" --disable-all \
		--enable=pci,ide,scsi,pcmcia scsi cdrom 
}

mydiscover2()
{
	dpath=linux/module/name
	dver=`uname -r|cut -d. -f1,2` # Kernel version (e.g. 2.4)
	dflags="-d all -e ata -e pci -e pcmcia -e scsi -e usb \
		bridge broadband fixeddisk humaninput modem \
		network optical removabledisk"
	discover --data-path=$dpath --data-version=$dver $dflags |
		grep -v "^$"
}

mydiscover()
{
	if [ "$(discover --version 2>/dev/null | grep "discover 2\..*")" ]
	then
		echo "bootcdmodprobe uses discover v2" >&2
		mydiscover2
	else
		echo "bootcdmodprobe uses discover v1" >&2
		mydiscover1
	fi
}

manual()
{
        MANUAL_MODULES="scsi_mod usb-storage floppy ide-detect ide-generic ide-floppy ide-cd isofs ide-disk ehci-hcd ohci-hcd uhci-hcd usb-uhci uhci usb-ohci ehci-hcd"
        for i in $MANUAL_MODULES; do
                echo "$i"
        done
}


# set LD_LIBRARY_PATH
for i in $(find /usr/lib -type d); do
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$i
done

for i in $(mydiscover; manual); do
	echo "bootcdmodprobe $i" >&2
	modprobe $i
done