diff options
author | proski <proski> | 2006-08-02 05:50:08 +0000 |
---|---|---|
committer | proski <proski> | 2006-08-02 05:50:08 +0000 |
commit | fc48650caf91651b619ab8b531ccdce8d8279929 (patch) | |
tree | 7b2901d378d182f6a713100619a10a2ccf19f0d9 | |
parent | d77168cef44ea6ecef4d4f4344f50d4253c5d263 (diff) |
Remove old kernel patching facility, add a new kernel patch
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | Makefile.k26 | 2 | ||||
-rw-r--r-- | kernel_patch.diff | 31 | ||||
-rwxr-xr-x | kernel_patch.sh | 103 |
4 files changed, 32 insertions, 109 deletions
@@ -97,10 +97,7 @@ dist: cp -f $(DISTFILES) $(DISTNAME) tar zcvf $(DISTNAME).tar.gz $(DISTNAME) -kernel_patch: - DRV_SRC="$(SRCS)" DRV_HDR="$(HDRS)" ./kernel_patch.sh $(KERNEL_PATH) - rmmod: -rmmod $(obj-m:%.o=%) -.PHONY: all modules check install uninstall clean dist kernel_patch rmmod +.PHONY: all modules check install uninstall clean dist rmmod diff --git a/Makefile.k26 b/Makefile.k26 deleted file mode 100644 index 1d535a7..0000000 --- a/Makefile.k26 +++ /dev/null @@ -1,2 +0,0 @@ -obj-$(CONFIG_USB_ATMEL) += at76c503.o at76_usbdfu.o - diff --git a/kernel_patch.diff b/kernel_patch.diff new file mode 100644 index 0000000..8395028 --- /dev/null +++ b/kernel_patch.diff @@ -0,0 +1,31 @@ +diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig +--- a/drivers/net/wireless/Kconfig ++++ b/drivers/net/wireless/Kconfig +@@ -405,6 +405,14 @@ config PCI_ATMEL + Enable support for PCI and mini-PCI cards containing the + Atmel at76c506 chip. + ++config USB_ATMEL ++ tristate "Atmel at76c503/at76c505/at76c505a USB cards" ++ depends on NET_RADIO && USB ++ select FW_LOADER ++ ---help--- ++ Enable support for USB Wireless devices using Atmel at76c503, ++ at76c505 or at76c505a chip. ++ + # If Pcmcia is compiled in, offer Pcmcia cards... + comment "Wireless 802.11b Pcmcia/Cardbus cards support" + depends on NET_RADIO && PCMCIA +diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile +--- a/drivers/net/wireless/Makefile ++++ b/drivers/net/wireless/Makefile +@@ -31,6 +31,9 @@ obj-$(CONFIG_AIRO_CS) += airo_cs.o airo + obj-$(CONFIG_ATMEL) += atmel.o + obj-$(CONFIG_PCI_ATMEL) += atmel_pci.o + obj-$(CONFIG_PCMCIA_ATMEL) += atmel_cs.o ++obj-$(CONFIG_USB_ATMEL) += at76_usb.o ++ ++at76_usb-objs := at76c503.o at76_usbdfu.o + + obj-$(CONFIG_PRISM54) += prism54/ + obj-$(CONFIG_PRISM54_USB) += prism54usb/ diff --git a/kernel_patch.sh b/kernel_patch.sh deleted file mode 100755 index be43610..0000000 --- a/kernel_patch.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -# arg1: kernel source root dir -# arg2..n: files to copy - -#set -x -if [ $# -ne 1 ]; then - echo "#ERR call $0 kernel_root_dir" - echo "set environment vars DRV_SRC, DRV_HDR to the file names" - exit 1 -fi - -KSRC=$1 -DEST=$KSRC/drivers/net/wireless -# subdir created in the above path -SUBDIR=at76c503 -# source of the makefile for the kernel subdir -KMAKEFILE=Makefile.k26 - -if [ "$DRV_SRC" == "" ]; then echo "#ERR env var DRV_SRC not set or empty"; exit 1; fi - -if [ "$DRV_HDR" == "" ]; then echo "#ERR env var DRV_HDR not set or empty"; exit 1; fi - -if [ ! -r at76c503.h ]; then echo "#ERR cannot read at76c503.h"; exit 2; fi - -if [ ! -d $DEST ]; then echo "#ERR $DEST is no directory"; exit 3; fi - -if [ ! -w $DEST ]; then echo "#ERR cannot write to directory $DEST"; exit 4; fi - -if [ ! -d $DEST/$SUBDIR ]; then - echo "creating $DEST/$SUBDIR" - if mkdir -p $DEST/$SUBDIR; then true; else echo "#ERR cannot create dir $DEST/$SUBDIR" && exit 5; fi -else - if [ ! -d $DEST/$SUBDIR ]; then - echo "#ERR $DEST/$SUBDIR exists and is no directory"; exit 5 - fi - if [ ! -w $DEST/$SUBDIR ]; then - echo "#ERR dir $DEST/$SUBDIR exists and is not writable"; exit 5 - fi -fi - -VERSION=`grep '^#define DRIVER_VERSION' at76c503.h | sed 's/#define.*DRIVER_VERSION.*\"\(.*\)\".*$/\1/g'` - -echo "patching driver version $VERSION into kernel source $KSRC" - -echo "copying $DRV_SRC $DRV_HDR $KMAKEFILE into $DEST/$SUBDIR" - -# for tests only -#exit 0 - -for f in $DRV_SRC $DRV_HDR; do - if cp -v $f $DEST/$SUBDIR; then true; else echo "#ERR cannot copy $i into $DEST/$SUBDIR"; exit 5; fi -done - -# copy the Makefile -if cp -v $KMAKEFILE $DEST/$SUBDIR/Makefile; then - true; -else - echo "#ERR cannot copy $KMAKEFILE into $DEST/$SUBDIR/Makefile" - exit 5 -fi - -# patch Kconfig -PWD=`pwd` -cd $DEST -if grep "^config USB_ATMEL" Kconfig; then - echo "found \"config USB_ATMEL\" in $DEST/Kconfig - leave it untouched" -else - echo "going to patch $DEST/Kconfig (original copied into Kconfig.orig)" - - mv Kconfig Kconfig.orig -# remove the last endmenu in Kconfig - head -$((`grep -n endmenu Kconfig.orig | tail -1 | sed 's/\([0-9]*\).*/\1/'`-1)) Kconfig.orig > Kconfig - (cat <<"EOF" -config USB_ATMEL - tristate "Atmel at76c503a/505/505a USB adapter" - depends on NET_RADIO && ATMEL && USB - select FW_LOADER - ---help--- - Enable support for WLAN USB adapters containing the - Atmel at76c503a, 505 and 505a chips. - -endmenu -EOF - ) >> Kconfig -fi - -# patch the Makefile -if grep "CONFIG_USB_ATMEL" Makefile; then - echo "found \"config CONFIG_USB_ATMEL\" in $DEST/Makefile - leave it untouched" -else - echo "going to patch $DEST/Makefile (original copied into Makefile.orig)" - - cp Makefile Makefile.orig - (cat <<EOF - -obj-\$(CONFIG_USB_ATMEL) += $SUBDIR/ - -EOF - ) >> Makefile - -fi - - |