summarylogtreecommitdiffstats
path: root/dkms.conf
blob: 745b210cb32e784ca51f0326fe2d1e80562bccb9 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
kmajorminor=`echo $kernelver | cut -d . --complement -f 3-`
CONFIGURE_ARGS="--enable-sii-assign --disable-rt-syslog --disable-tool --disable-userlib --enable-generic --enable-ccat --disable-tty"
CONFIGURE_ARGS+=" --with-linux-dir=$kernel_source_dir"

PACKAGE_NAME="ethercat-dkms"
PACKAGE_VERSION="#MODULE_VERSION#"
AUTOINSTALL="YES"
BUILT_MODULE_NAME[0]="ec_master"
BUILT_MODULE_LOCATION[0]="master/"
DEST_MODULE_LOCATION[0]="/kernel/extra/ethercat"
BUILT_MODULE_NAME[1]="ec_generic"
BUILT_MODULE_LOCATION[1]="devices/"
DEST_MODULE_LOCATION[1]="/kernel/extra/ethercat"
BUILT_MODULE_NAME[2]="ec_ccat"
BUILT_MODULE_LOCATION[2]="devices/ccat/"
DEST_MODULE_LOCATION[2]="/kernel/extra/ethercat"
POST_BUILD="save_module_symvers $dkms_tree"

for km in e1000 igb igbvf ixgbevf igc; do
    if [ -r $source_tree/ethercat-dkms-#MODULE_VERSION#/devices/$km/$km-${kmajorminor}-ethercat.h ] && grep -i -q "^CONFIG_${km}=m$" $kernel_source_dir/.config; then
        idx=${#BUILT_MODULE_NAME[@]}
        BUILT_MODULE_NAME[$idx]="ec_$km"
        BUILT_MODULE_LOCATION[$idx]="devices/$km/"
        DEST_MODULE_LOCATION[$idx]="/kernel/extra/ethercat"
        CONFIGURE_ARGS+=" --enable-$km"
    else
        CONFIGURE_ARGS+=" --disable-$km"
    fi
done

if [ -r $source_tree/ethercat-dkms-#MODULE_VERSION#/devices/e1000e/e1000-${kmajorminor}-ethercat.h ] && grep -i -q "^CONFIG_E1000E=[my]$" $kernel_source_dir/.config; then
    idx=${#BUILT_MODULE_NAME[@]}
    BUILT_MODULE_NAME[$idx]="ec_e1000e"
    BUILT_MODULE_LOCATION[$idx]="devices/e1000e/"
    DEST_MODULE_LOCATION[$idx]="/kernel/extra/ethercat"
    CONFIGURE_ARGS+=" --enable-e1000e"
else
    CONFIGURE_ARGS+=" --disable-e1000e"
fi

for km in 8139too e100; do
    if [ -r $source_tree/ethercat-dkms-#MODULE_VERSION#/devices/$km-$kmajorminor-ethercat.c ] && grep -i -q "^CONFIG_${km}=m$" $kernel_source_dir/.config; then
        idx=${#BUILT_MODULE_NAME[@]}
        BUILT_MODULE_NAME[$idx]="ec_$km"
        BUILT_MODULE_LOCATION[$idx]="devices/"
        DEST_MODULE_LOCATION[$idx]="/kernel/extra/ethercat"
        CONFIGURE_ARGS+=" --enable-$km"
    else
        CONFIGURE_ARGS+=" --disable-$km"
    fi
done

if [ -r $source_tree/ethercat-dkms-#MODULE_VERSION#/devices/r8169-$kmajorminor-ethercat.c ] && grep -q "^CONFIG_R8169=m$" $kernel_source_dir/.config; then
    idx=${#BUILT_MODULE_NAME[@]}
    BUILT_MODULE_NAME[$idx]="ec_r8169"
    BUILT_MODULE_LOCATION[$idx]="devices/"
    DEST_MODULE_LOCATION[$idx]="/kernel/extra/ethercat"
    CONFIGURE_ARGS+=" --enable-r8169"
elif [ -r $source_tree/ethercat-dkms-#MODULE_VERSION#/devices/r8169/r8169-${kmajorminor}-ethercat.h ] && grep -q "^CONFIG_R8169=m$" $kernel_source_dir/.config; then
    idx=${#BUILT_MODULE_NAME[@]}
    BUILT_MODULE_NAME[$idx]="ec_r8169"
    BUILT_MODULE_LOCATION[$idx]="devices/r8169/"
    DEST_MODULE_LOCATION[$idx]="/kernel/extra/ethercat"
    CONFIGURE_ARGS+=" --enable-r8169"
else
    CONFIGURE_ARGS+=" --disable-r8169"
fi

if [ -r $source_tree/ethercat-dkms-#MODULE_VERSION#/devices/stmmac/stmmac_pci-$kmajorminor-ethercat.c ] && grep -q "^CONFIG_STMMAC_PCI=[my]$" $kernel_source_dir/.config; then
    idx=${#BUILT_MODULE_NAME[@]}
    BUILT_MODULE_NAME[$idx]="ec_stmmac-pci"
    BUILT_MODULE_LOCATION[$idx]="devices/stmmac/"
    DEST_MODULE_LOCATION[$idx]="/kernel/extra/ethercat"
    CONFIGURE_ARGS+=" --enable-stmmac-pci"
else
    CONFIGURE_ARGS+=" --disable-stmmac-pci"
fi

if [ -r $source_tree/ethercat-dkms-#MODULE_VERSION#/devices/stmmac/dwmac-intel-$kmajorminor-ethercat.c ] && grep -q "^CONFIG_DWMAC_INTEL=[my]$" $kernel_source_dir/.config; then
    idx=${#BUILT_MODULE_NAME[@]}
    BUILT_MODULE_NAME[$idx]="ec_dwmac-intel"
    BUILT_MODULE_LOCATION[$idx]="devices/stmmac/"
    DEST_MODULE_LOCATION[$idx]="/kernel/extra/ethercat"
    CONFIGURE_ARGS+=" --enable-dwmac-intel"
else
    CONFIGURE_ARGS+=" --disable-dwmac-intel"
fi

if [ -r $source_tree/ethercat-dkms-#MODULE_VERSION#/devices/genet/bcmgenet-$kmajorminor-ethercat.h ] && grep -q "^CONFIG_BCMGENET=m$" $kernel_source_dir/.config; then
    idx=${#BUILT_MODULE_NAME[@]}
    BUILT_MODULE_NAME[$idx]="ec_genet"
    BUILT_MODULE_LOCATION[$idx]="devices/genet/"
    DEST_MODULE_LOCATION[$idx]="/kernel/extra/ethercat"
    CONFIGURE_ARGS+=" --enable-genet"
else
    CONFIGURE_ARGS+=" --disable-genet"
fi

MAKE[0]="./configure ${CONFIGURE_ARGS} && make modules"