From 183e2857a37678554b0b0b80cdde97035c212d7b Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 12 Feb 2009 17:24:57 -0800 Subject: [PATCH] Add initial DKMS support and compress module source with bzip2 * Add initial DKMS support via an openafs-modules-dkms package, based on work by Robert Gerlach. (LP: #288743) * Compress the source in openafs-modules-source with bzip2 instead of gzip to reduce the package size. --- debian/changelog | 4 ++++ debian/control | 17 +++++++++++++++-- debian/dkms.conf.in | 14 ++++++++++++++ debian/openafs-client.init | 10 ++++++++-- debian/openafs-modules-dkms.postinst | 15 +++++++++++++++ debian/openafs-modules-dkms.prerm | 12 ++++++++++++ debian/rules | 18 ++++++++++++------ 7 files changed, 80 insertions(+), 10 deletions(-) create mode 100644 debian/dkms.conf.in create mode 100644 debian/openafs-modules-dkms.postinst create mode 100644 debian/openafs-modules-dkms.prerm diff --git a/debian/changelog b/debian/changelog index 3e28ed369..eb6869aea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,10 @@ openafs (1.4.8.dfsg1-1) UNRELEASED; urgency=low could result in reuse of freed memory. - STABLE14-rx-do-not-race-current-packet-20090105: fix rx race condition. + * Add initial DKMS support via an openafs-modules-dkms package, based on + work by Robert Gerlach. (LP: #288743) + * Compress the source in openafs-modules-source with bzip2 instead of + gzip to reduce the package size. * Make dynroot the default for new installations. It works much better with systems that don't bring up their network until late in the boot process, such as wireless laptops. (LP: #249240, #318605) diff --git a/debian/control b/debian/control index 342b65891..19e29d218 100644 --- a/debian/control +++ b/debian/control @@ -114,14 +114,27 @@ Description: AFS distributed filesystem development libraries Package: openafs-modules-source Priority: extra Depends: ${misc:Depends}, bison, flex, debhelper (>= 5), - kernel-package | module-assistant + module-assistant | kernel-package Architecture: all Description: AFS distributed filesystem kernel module source AFS is a distributed filesystem allowing cross-platform sharing of files among multiple computers. Facilities are provided for access control, authentication, backup and administrative management. . - This package provides source to the AFS kernel modules. + This package provides the source to the AFS kernel module in a form + suitable for use by module-assistant or kernel-package. + +Package: openafs-modules-dkms +Priority: extra +Depends: ${misc:Depends}, bison, flex +Architecture: all +Description: AFS distributed filesystem kernel module DKMS source + AFS is a distributed filesystem allowing cross-platform sharing of + files among multiple computers. Facilities are provided for access + control, authentication, backup and administrative management. + . + This package contains the source for the AFS kernel module, packaged with + approriate configuration for DKMS to build new modules dynamically. Package: libpam-openafs-kaserver Architecture: alpha amd64 arm armel i386 ia64 lpia powerpc ppc64 s390 s390x sparc diff --git a/debian/dkms.conf.in b/debian/dkms.conf.in new file mode 100644 index 000000000..0f0b3d76b --- /dev/null +++ b/debian/dkms.conf.in @@ -0,0 +1,14 @@ +# DKMS configuration for the OpenAFS kernel module. -*- sh -*- + +# The version is replaced at build time by debian/rules. +PACKAGE_NAME="openafs" +PACKAGE_VERSION="@VERSION@" + +BUILT_MODULE_NAME[0]="$PACKAGE_NAME" +DEST_MODULE_LOCATION[0]="/updates/dkms/" +AUTOINSTALL=yes + +MAKE[0]="./configure --with-linux-kernel-headers=${kernel_source_dir} + && make only_libafs + && mv src/libafs/MODLOAD-*/openafs.ko ." +CLEAN="rm -f openafs.ko && make distclean" diff --git a/debian/openafs-client.init b/debian/openafs-client.init index 69f4a1c95..e20317843 100755 --- a/debian/openafs-client.init +++ b/debian/openafs-client.init @@ -30,6 +30,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin CACHEINFO=${CACHEINFO:-/etc/openafs/cacheinfo} MODULEROOT=${MODULEROOT:-/lib/modules/`uname -r`} MODULEDIR=${MODULEDIR:-$MODULEROOT/fs} +DKMSDIR=${DKMSDIR:-$MODULEROOT/updates/dkms} exec 3>/dev/null exec &2 AFS module $MODULEDIR/$LIBAFS does not exist. diff --git a/debian/openafs-modules-dkms.postinst b/debian/openafs-modules-dkms.postinst new file mode 100644 index 000000000..b7de558f2 --- /dev/null +++ b/debian/openafs-modules-dkms.postinst @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +# Get the package version, which is the version of openafs-modules-dkms +# without the dfsg part and without the Debian version. +package=openafs-modules-dkms +version=`dpkg-query -W -f='${Version}' "$package" | sed 's/[.+-].*//'` + +dkms add -m openafs -v "$version" +if [ "$1" = 'configure' ] ; then + dkms build -m openafs -v "$version" + dkms install -m openafs -v "$version" --force +fi + +#DEBHELPER# diff --git a/debian/openafs-modules-dkms.prerm b/debian/openafs-modules-dkms.prerm new file mode 100644 index 000000000..317d2b71b --- /dev/null +++ b/debian/openafs-modules-dkms.prerm @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +# Get the package version, which is the version of openafs-modules-dkms +# without the dfsg part and without the Debian version. I hope this is always +# correct when running prerm and we won't get the new version. +package=openafs-modules-dkms +version=`dpkg-query -W -f='${Version}' "$package" | sed 's/[.+-].*//'` + +dkms remove -m openafs -v "$version" --all + +#DEBHELPER# diff --git a/debian/rules b/debian/rules index aae967749..77530cf04 100755 --- a/debian/rules +++ b/debian/rules @@ -31,6 +31,7 @@ SYS_NAME := $(shell sh debian/sysname) package = openafs srcpkg = openafs-modules-source +dkmspkg = openafs-modules-dkms # The /usr/share/doc directory for these packages should be a symlink to # /usr/share/doc/openafs-client. Any package on this list must depend on @@ -108,7 +109,9 @@ clean: || mv doc/man-pages/pod1/afs-up.pod doc/man-pages/pod1/up.pod dh clean -# Rules for building the openafs-modules-source package. +# Rules for building the openafs-modules-source package. We generate both a +# DKMS package and a typical source tarball package usable by +# module-assistant. install-source-stamp: dh_testdir dh_testroot @@ -132,11 +135,14 @@ install-source-stamp: find debian/$(srcpkg) -type f -perm -100 | xargs chmod 755 find debian/$(srcpkg) -type f -not -perm -100 | xargs chmod 644 chmod 775 debian/$(srcpkg)/usr/src/modules - cd debian/$(srcpkg)/usr/src && \ - tar cf $(package).tar modules && \ - rm -r modules - gzip -9 debian/$(srcpkg)/usr/src/$(package).tar - chmod 644 debian/$(srcpkg)/usr/src/$(package).tar.gz + cd debian/$(srcpkg)/usr/src && tar cf $(package).tar modules + bzip2 debian/$(srcpkg)/usr/src/$(package).tar + chmod 644 debian/$(srcpkg)/usr/src/$(package).tar.bz2 + install -d debian/$(dkmspkg)/usr/src + mv debian/$(srcpkg)/usr/src/modules/$(package) \ + debian/$(dkmspkg)/usr/src/openafs-$(VERSION) + sed -e 's/[@]VERSION[@]/$(VERSION)' debian/dkms.conf.in \ + > debian/$(dkmspkg)/usr/src/openafs-$(VERSION)/dkms.conf touch $@ install: install-stamp -- 2.39.5