devices/e1000e/update.sh
author Florian Pose <fp@igh-essen.com>
Tue, 28 Oct 2014 16:31:44 +0100
branchstable-1.5
changeset 2587 afd76ee3aa87
parent 2586 5b89b4e38cdc
child 2588 792892ab4806
permissions -rwxr-xr-x
Added all drivers for kernel 3.14.
2546
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
#!/bin/bash
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
set -x
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
2587
afd76ee3aa87 Added all drivers for kernel 3.14.
Florian Pose <fp@igh-essen.com>
parents: 2586
diff changeset
     5
KERNELDIR=/data/kernel/linux-3.14.12
afd76ee3aa87 Added all drivers for kernel 3.14.
Florian Pose <fp@igh-essen.com>
parents: 2586
diff changeset
     6
PREVER=3.12
afd76ee3aa87 Added all drivers for kernel 3.14.
Florian Pose <fp@igh-essen.com>
parents: 2586
diff changeset
     7
KERNELVER=3.14
2546
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     9
for f in $KERNELDIR/drivers/net/ethernet/intel/e1000e/*.[ch]; do
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
    echo $f
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
    b=$(basename $f)
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
    o=${b/\./-$KERNELVER-orig.}
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
    e=${b/\./-$KERNELVER-ethercat.}
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
    cp -v $f $o
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
    chmod 644 $o
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
    cp -v $o $e
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
    op=${b/\./-$PREVER-orig.}
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
    ep=${b/\./-$PREVER-ethercat.}
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
    diff -u $op $ep | patch -p1 $e
2584
0e3d989ff233 Added all drivers for kernel 3.8.
Florian Pose <fp@igh-essen.com>
parents: 2546
diff changeset
    20
    sed -i s/$PREVER-ethercat.h/$KERNELVER-ethercat.h/ $e
0e3d989ff233 Added all drivers for kernel 3.8.
Florian Pose <fp@igh-essen.com>
parents: 2546
diff changeset
    21
    hg add $o $e
2546
2fa43746d972 Added e1000e driver for kernel 3.6.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
done