summaryrefslogtreecommitdiffstats
path: root/install/autodetect
blob: c851a4b40e0e72f954f30d8320992d65162f2a38 (plain)
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
# vim: set ft=sh:

install ()
{
    msg ":: Autodetecting modules"
    #blegh, we'll let /tmp clean itself up
    modtmp=$( mktemp /tmp/initcpio_modules.XXXXXX )
    modall=$( mktemp /tmp/initcpio_modulesall.XXXXXX )
    AUTODETECT=" $(auto_modules "/scsi/" | grep -v "imm"| grep -v "pcmcia" | grep -v "ide" && echo "sd_mod sr_mod") 
                 $(auto_modules "/block/" && echo "sd_mod sr_mod")
                 $(auto_modules "/fusion/" && echo "sd_mod sr_mod")
                 $(auto_modules "/usb/" && echo "usb_storage usbhid sd_mod sr_mod")
                 $(auto_modules "/ide/")
                 $(auto_modules "/ieee1394/" && echo "sbp2 sd_mod sr_mod")
                 $(auto_modules "/cdrom/") 
                 $(cat /proc/filesystems | grep -v nodev) "
              
    for m in $AUTODETECT; do
        echo $(basename ${m//\.ko/}) >> $modtmp
        [ "$m" == "ext3" ] && echo "jbd" >> $modtmp
    done

    grep "file /lib/modules" ${FILELIST} >>$modall
	for i in `cat $modtmp`; do
        sed -i -e "\=/$i=d" $modall
    done
	for i in `grep "file /lib/modules" $modall | awk '{print $2}'`; do
        sed -i -e "\=$i=d" ${FILELIST}
	done
	msg "Included MODULES:"
	msg "-----------------"
	msg "$(grep "file /lib/modules/" ${FILELIST} | awk '{print $2}')"
	msg "-----------------"
    BINARIES=""
    FILES=""
    SCRIPT=""
}