]> oss.titaniummirror.com Git - cp210x.git/commitdiff
First pass at building a dkms package.
authorsmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Wed, 25 Nov 2009 20:10:50 +0000 (20:10 +0000)
committersmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Wed, 25 Nov 2009 20:10:50 +0000 (20:10 +0000)
Makefile [changed mode: 0755->0644]
Makefile.build [deleted file]
Makefile.dkms [new file with mode: 0755]
debian.in/control
debian.in/postinst
debian.in/rules
dkms.conf

old mode 100755 (executable)
new mode 100644 (file)
index 6488d65..5ffcc6c
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,93 @@
-#!/usr/bin/make -f
+# Makefile for newer cp2101 driver, we call cp210x
+# Essentially, it makes a debian source package which
+# then can be built by pbuilder, etc.
 
-STRIP  = strip --strip-unneeded --remove-section=.comment --remove-section=.note
+# Change or override these values as necessary for each package release
+
+PKGVER  = 0.11
+DEBDIST = hardy
+DEBRELEASE = 0tmi
+
+
+# No need to change anything below this line
+
+REPOID := $(shell svn info 2>/dev/null | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/svn:revision \1/')
+ifeq (,$(REPOID))
+  REPOID := $(shell git svn info 2>/dev/null | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/svn:revision \1/')
+ifeq (,$(REPOID))
+    REPOID := $(shell git log -n1 2>/dev/null | head -1 | sed -e s'/^/git:/')
+endif
+endif
+ifeq (,$(REPOID))
+  $(error You much check the code out via svn, git-svn, or git)
+endif
+
+BUILD := build
+DEBVER := $(PKGVER)-$(DEBRELEASE)
+RFC822DATE := $(shell date --rfc-822)
+ROOTNAME := cp210x
+PACKAGE := $(ROOTNAME)-module-dkms
+TARFILE := $(PACKAGE)_$(DEBVER).orig.tar.gz
+DEBSRC := $(PACKAGE)-$(PKGVER)
+ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEBFILE := $(BUILD)/$(PACKAGE)_$(DEBVER)_$(ARCH).deb
+DEBSRCFILE := $(BUILD)/$(PACKAGE)_$(DEBVER).dsc
+
+
+source: $(DEBSRCFILE)
+$(DEBSRCFILE): $(BUILD)/debian-stamp
+       cd $(BUILD) && dpkg-source -b $(DEBSRC)
+       touch $@
+
+
+binary: $(DEBFILE)
+$(DEBFILE): $(BUILD)/debian-stamp
+       cd $(BUILD)/$(DEBSRC) && dpkg-buildpackage -sa -us -uc 
+
+
+$(BUILD)/src-stamp: $(wildcard src/*) dkms.conf
+       mkdir -p $(BUILD)
+       rm -rf $(BUILD)/$(DEBSRC)
+       cp -a src $(BUILD)/$(DEBSRC)
+       cp -a dkms.conf $(BUILD)/$(DEBSRC)
+       perl -i -pe 's/xxDEBVERxx/$(DEBVER)/g' $(BUILD)/$(DEBSRC)/dkms.conf
+       find $(BUILD)/$(DEBSRC) -name .svn -type d -exec rm -rf "{}" ";" 2>/dev/null || exit 0
+       rm -rf $(BUILD)/$(DEBSRC)/.git || exit 0
+       tar -C $(BUILD) -czf $(BUILD)/$(TARFILE) $(DEBSRC)
+       touch $@
+
+
+configure: $(BUILD)/debian-stamp
+$(BUILD)/debian-stamp: $(BUILD)/src-stamp $(wildcard debian.in/*)
+       mkdir -p $(BUILD)/$(DEBSRC)/debian
+       rsync --quiet -avz --exclude=.svn/ --exclude=.git/ debian.in/ $(BUILD)/$(DEBSRC)/debian/
+       perl -i -pe 's/xxPACKAGExx/$(PACKAGE)/g' $(BUILD)/$(DEBSRC)/debian/*
+       perl -i -pe 's/xxROOTNAMExx/$(ROOTNAME)/g' $(BUILD)/$(DEBSRC)/debian/*
+       perl -i -pe 's/xxPKGVERxx/$(PKGVER)/g' $(BUILD)/$(DEBSRC)/debian/*
+       perl -i -pe 's/xxDEBVERxx/$(DEBVER)/g' $(BUILD)/$(DEBSRC)/debian/*
+       perl -i -pe 's/xxDEBDISTxx/$(DEBDIST)/g' $(BUILD)/$(DEBSRC)/debian/*
+       perl -i -pe 's/xxRFC822DATExx/$(RFC822DATE)/g' $(BUILD)/$(DEBSRC)/debian/*
+       perl -i -pe 's/xxREPOIDxx/$(REPOID)/g' $(BUILD)/$(DEBSRC)/debian/*
+       touch $@
 
-all:
-       -rm -rf builddir
-       cp -a src builddir
-       cd builddir && ./configure -kver $(KVER)
-       test -f builddir/Makefile.go
-       $(MAKE) -C builddir -f Makefile.go
-       cp builddir/cp2101.ko cp210x.ko
-       $(STRIP) cp210x.ko
 
 clean:
-       -rm -rf builddir cp210x.ko
+       rm -rf $(BUILD)
+
+
+debug:
+       @echo "BUILD = $(BUILD)"
+       @echo "PKGVER = $(PKGVER)"
+       @echo "REPOID = $(REPOID)"
+       @echo "DEBRELEASE = $(DEBRELEASE)"
+       @echo "DEBVER = $(DEBVER)"
+       @echo "RFC822DATE = $(RFC822DATE)"
+       @echo "PACKAGE = $(PACKAGE)"
+       @echo "TARFILE = $(TARFILE)"
+       @echo "DEBSRC = $(DEBSRC)"
+       @echo "ARCH = $(ARCH)"
+       @echo "DEBFILE = $(BUILD)/$(PACKAGE)_$(DEBVER)_$(ARCH).deb"
+       @echo "DEBSRCFILE = $(BUILD)/$(PACKAGE)_$(DEBVER).dsc"
 
 
-.PHONY: all clean
+.PHONY: clean binary source configure
diff --git a/Makefile.build b/Makefile.build
deleted file mode 100644 (file)
index 5ffb569..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-# Makefile for newer cp2101 driver, we call cp210x
-# Essentially, it makes a debian source package which
-# then can be built by pbuilder, etc.
-
-DEBDIST = hardy
-BUILD = build
-KVER := $(shell uname -r)
-PKGVER  = 0.11
-
-REPORELEASE := $(shell svn info 2>/dev/null | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/\1/')
-ifeq (,$(REPORELEASE))
-  REPORELEASE := $(shell git svn info 2>/dev/null | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/\1/')
-endif
-ifeq (,$(REPORELEASE))
-  $(error You much check the code out from svn using svn or git)
-endif
-
-DEBRELEASE := 0tmi$(REPORELEASE)
-DEBVER := $(PKGVER)-$(DEBRELEASE)
-RFC822DATE := $(shell date --rfc-822)
-ROOTNAME := cp210x
-PACKAGE := $(ROOTNAME)-module-$(KVER)
-TARFILE := $(PACKAGE)_$(DEBVER).orig.tar.gz
-DEBSRC := $(PACKAGE)-$(PKGVER)
-ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEBFILE := $(BUILD)/$(PACKAGE)_$(DEBVER)_$(ARCH).deb
-DEBSRCFILE := $(BUILD)/$(PACKAGE)_$(DEBVER).dsc
-
-
-source: $(DEBSRCFILE)
-$(DEBSRCFILE): $(BUILD)/debian-stamp
-       cd $(BUILD) && dpkg-source -b $(DEBSRC)
-       touch $@
-
-
-binary: $(DEBFILE)
-$(DEBFILE): $(BUILD)/debian-stamp
-       cd $(BUILD)/$(DEBSRC) && dpkg-buildpackage -sa -us -uc 
-
-
-$(BUILD)/src-stamp: $(wildcard src/*)
-       mkdir -p $(BUILD)
-       rm -rf $(BUILD)/$(DEBSRC)
-       cp -a src $(BUILD)/$(DEBSRC)
-       find $(BUILD)/$(DEBSRC) -name .svn -type d -exec rm -rf "{}" ";" 2>/dev/null || exit 0
-       rm -rf $(BUILD)/$(DEBSRC)/.git || exit 0
-       tar -C $(BUILD) -czf $(BUILD)/$(TARFILE) $(DEBSRC)
-       touch $@
-
-
-configure: $(BUILD)/debian-stamp
-$(BUILD)/debian-stamp: $(BUILD)/src-stamp $(wildcard debian.in/*)
-       mkdir -p $(BUILD)/$(DEBSRC)/debian
-       rsync --quiet -avz --exclude=.svn/ --exclude=.git/ debian.in/ $(BUILD)/$(DEBSRC)/debian/
-       perl -i -pe 's/xxPACKAGExx/$(PACKAGE)/g' $(BUILD)/$(DEBSRC)/debian/*
-       perl -i -pe 's/xxROOTNAMExx/$(ROOTNAME)/g' $(BUILD)/$(DEBSRC)/debian/*
-       perl -i -pe 's/xxPKGVERxx/$(PKGVER)/g' $(BUILD)/$(DEBSRC)/debian/*
-       perl -i -pe 's/xxKVERxx/$(KVER)/g' $(BUILD)/$(DEBSRC)/debian/*
-       perl -i -pe 's/xxDEBVERxx/$(DEBVER)/g' $(BUILD)/$(DEBSRC)/debian/*
-       perl -i -pe 's/xxDEBDISTxx/$(DEBDIST)/g' $(BUILD)/$(DEBSRC)/debian/*
-       perl -i -pe 's/xxRFC822DATExx/$(RFC822DATE)/g' $(BUILD)/$(DEBSRC)/debian/*
-       touch $@
-
-
-clean:
-       rm -rf $(BUILD)
-
-
-debug:
-       @echo "BUILD = $(BUILD)"
-       @echo "KVER = $(KVER)"
-       @echo "PKGVER = $(PKGVER)"
-       @echo "REPORELEASE = |$(REPORELEASE)|"
-       @echo "DEBRELEASE = $(DEBRELEASE)"
-       @echo "DEBVER = $(DEBVER)"
-       @echo "RFC822DATE = $(RFC822DATE)"
-       @echo "PACKAGE = $(PACKAGE)"
-       @echo "TARFILE = $(TARFILE)"
-       @echo "DEBSRC = $(DEBSRC)"
-       @echo "ARCH = $(ARCH)"
-       @echo "DEBFILE = $(BUILD)/$(PACKAGE)_$(DEBVER)_$(ARCH).deb"
-       @echo "DEBSRCFILE = $(BUILD)/$(PACKAGE)_$(DEBVER).dsc"
-
-
-.PHONY: clean binary source configure
diff --git a/Makefile.dkms b/Makefile.dkms
new file mode 100755 (executable)
index 0000000..6488d65
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/make -f
+
+STRIP  = strip --strip-unneeded --remove-section=.comment --remove-section=.note
+
+all:
+       -rm -rf builddir
+       cp -a src builddir
+       cd builddir && ./configure -kver $(KVER)
+       test -f builddir/Makefile.go
+       $(MAKE) -C builddir -f Makefile.go
+       cp builddir/cp2101.ko cp210x.ko
+       $(STRIP) cp210x.ko
+
+clean:
+       -rm -rf builddir cp210x.ko
+
+
+.PHONY: all clean
index 58ca2c4dd72266abb04c51613ee8b24116db45be..9acffae9d2bf63e94ea78368b14de982a9116f17 100644 (file)
@@ -3,15 +3,18 @@ Section: devel
 Priority: optional
 Maintainer: R. Steve McKown <rsmckown@gmail.com>
 Standards-Version: 3.7.2.0
-Build-Depends: dpkg-dev (>= 1.13.9), binutils (>= 2.9.5.0.12), gcc (>= 4:4.2.2), dpatch, file, bzip2, lsb-release, linux-headers-xxKVERxx
+Build-Depends: dpkg-dev (>= 1.13.9)
 
 Package: xxPACKAGExx
 Architecture: any
-Depends: linux-image-xxKVERxx
+Depends: dkms (>> 2.0.20), linux-headers, linux-image, binutils (>= 2.9.5.0.12), gcc (>= 4:4.2.2), dpatch, file, bzip2, lsb-release
+Conflicts: cp210x-module-2.6.24-19-generic, cp210x-module-2.6.24-21-generic, cp210x-module-2.6.24-22-generic, cp210x-module-2.6.24-23-generic, cp210x-module-2.6.24-24-generic, cp210x-module-2.6.24-25-generic
 Priority: extra
-Description: Enhanced USB/serial kernel module for xxROOTNAMExx based devices.
+Description: Enhanced USB/serial kernel module for cp210x based devices.
   This module blacklists the standard cp2101 module installed in the kernel,
-  effectively taking its place.  This package will be obsolete once the ioctl
-  calls supporting the advanced features of the xxROOTNAMExx appear in the mainline
-  kernel source.  This code is an enhanced version of Silicon Lab's xxPKGVERxx
-  driver.
+  effectively taking its place.  This code is an enhanced version of Silicon
+  Lab's v0.11 driver, released under the GPLv2 with their permission.  It
+  provides support for setting USB metadata, configuring port state, and
+  interacting with the GPIO pins.  This package will be obsolete once the
+  new features of this module have been incorporated into the mainline kernel
+  driver.  Built from xxREPOIDxx
index 77a08e60f7903319220d4422fa079c2d53bc0bf3..a818525b67f953af3779a9a58d511aefc96d0c5c 100755 (executable)
@@ -3,6 +3,5 @@
 set -e
 
 if [ "$1" = "configure" ]; then
-       depmod -q xxKVERxx || true
        modprobe -rq cp2101 || true
 fi
index 3eac6fca905b0d28cc08bd616b725141c8925dcd..e8b27ae90a26f3a188c5f9691fe5bd3770fd403e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/make -f
-# debian/rules file - for xxROOTNAMExx-module
+# debian/rules file - for cp210x-module-dkms
 # Based on sample debian/rules file - for GNU Hello (1.3).
 # Copyright 1994,1995 by Ian Jackson.
 # Copyright 1998-2007 James Troup
@@ -10,9 +10,7 @@
 # This file may have to be extensively modified
 
 package = xxPACKAGExx
-inst_dir = debian/tmp/lib/modules/xxKVERxx/kernel/drivers/usb/serial
-
-STRIP  = strip --strip-unneeded --remove-section=.comment --remove-section=.note
+inst_dir = debian/tmp/usr/src/xxPACKAGExx-xxDEBVERxx
 
 install_dir    = install -d -m 755
 install_file   = install -m 644
@@ -22,25 +20,13 @@ install_binary = install -m 755 -s
 DISTRIBUTION := $(shell lsb_release -is)
 
 
-# At the current time (20080828) this package has to build from the source
-# directory.  For now, the solution is quite hackish: copy the source
-# directory to the build directory before running configure.
-tempdir := $(shell tempfile $(package))
-
 configure-stamp:
-       $(checkdir)
-       rm -rf configure-stamp builddir
-       rm -f $(tempdir)
-       cp -a . $(tempdir)
-       mv -f $(tempdir) builddir
-       cd builddir && ./configure -kver xxKVERxx
        touch $@
 
 
 build: build-stamp
 build-stamp: configure-stamp
        $(checkdir)
-       $(MAKE) -C builddir -f Makefile.go
        touch $@
 
 
@@ -49,16 +35,9 @@ install-stamp: checkroot build-stamp
        $(checkdir)
        rm -rf debian/tmp
        $(install_dir) $(inst_dir)
-       chmod a+x builddir/installmod
-       $(MAKE) -C builddir -f Makefile.go \
-               INSTALL_PREFIX=$$(pwd)/debian/tmp install
-       mv $(inst_dir)/cp2101.ko $(inst_dir)/xxROOTNAMExx.ko
+       cp -a . $(inst_dir)
        $(install_dir) debian/tmp/etc/modprobe.d
        echo "blacklist cp2101" > debian/tmp/etc/modprobe.d/$(package)
-ifeq ($(with_strip),yes)
-       find debian/tmp -type f | xargs file | grep "ELF.*executable" | \
-               cut -f 1 -d : | xargs $(STRIP)
-endif
        touch $@
 
 
@@ -94,13 +73,13 @@ binary: binary-indep binary-arch
 
 clean:
        $(checkdir)
-       -rm -rf debian/tmp builddir
+       -rm -rf debian/tmp
        -rm -fr debian/patched debian/files* debian/substvars
        -rm -f *-stamp
 
 
 define checkdir
-        test -f Makefile.go -a -f debian/rules
+        test -f debian/rules
 endef
 
 
index 9593aa59d74391e33bd52f993b40d8563fcf3168..0daa7c6d3caf23c9dadd4ddc7d7e2a99ccb39964 100644 (file)
--- a/dkms.conf
+++ b/dkms.conf
@@ -1,5 +1,5 @@
-PACKAGE_VERSION="0.11-0tmi81"
-PACKAGE_NAME="cp210x-module"
+PACKAGE_VERSION="xxDEBVERxx"
+PACKAGE_NAME="cp210x-module-dkms"
 CLEAN="make clean"
 BUILT_MODULE_NAME[0]=cp210x
 DEST_MODULE_LOCATION[0]="/kernel/drivers/usb/serial/"