File: bootcdmodprobe

package info (click to toggle)
bootcd 6.9.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 520 kB
  • sloc: sh: 1,940; makefile: 49
file content (55 lines) | stat: -rwxr-xr-x 1,390 bytes parent folder | download | duplicates (4)
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
51
52
53
54
55
#!/bin/sh
#        file: /usr/share/bootcd/bootcdmodprobe
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2001-2020)
#     license: GNU General Public License, version 3
# description: bootcdmodprobe - functions needed by bootcd scripts

VERSION=##BOOTCD.VERSION##

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 sr_mod aufs overlay"
        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