Whamcloud - gitweb
LU-1706 build: Fixes for debian build system with Ubuntu 12.04+ 29/13129/8
authorBlake Caldwell <blakec@ornl.gov>
Mon, 22 Dec 2014 08:07:06 +0000 (03:07 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 7 Jan 2015 17:33:16 +0000 (17:33 +0000)
Propagate values from autoconf (LINUX, LINUXRELEASE, LINUX_OBJ)
to the debian build system to correctly identify kernel sources
(--with-linux) and objects (--with-linux-obj). The 'make debs'
target previously used KERNEL_VERSION, which does not get set
anymore.

Other fixes for building debs with Ubuntu 12.04+:
 1) Add module-assistant to Build-Depends in debian/control
 2) Omit copying lustre-*-orig.tar.gz and lustre-*.diff.gz files
    since this is the upstream source
 3) Change debhelper compatibility level to 7 (10.04+)
 4) Use dh_prep instead of dh_clean -k
 5) avoid non-functional --disable-zerocopy configure option
 6) do not try to install lc_common script that is
    only in server builds

Signed-off-by: Blake Caldwell <blakec@ornl.gov>
Change-Id: I9787bac687d26b03c4d1204347240624bfaced96
Reviewed-on: http://review.whamcloud.com/13129
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
autoMakefile.am
debian/compat [new file with mode: 0644]
debian/control
debian/control.main
debian/lustre-utils.install
debian/rules

index 27640fb..4766f9c 100644 (file)
@@ -140,12 +140,18 @@ debs:
        ln -s /usr/share/modass/packages/ usr_share_modass/ && \
        echo "lustre" > usr_share_modass/compliant.list && \
        export MA_DIR=$$(pwd)/usr_share_modass && \
        ln -s /usr/share/modass/packages/ usr_share_modass/ && \
        echo "lustre" > usr_share_modass/compliant.list && \
        export MA_DIR=$$(pwd)/usr_share_modass && \
-       KVERS=$${KVERS:-$(LINUXRELEASE)}; \
-       m-a build $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
+       KVERS=$${KVERS:-$(LINUXRELEASE)} && \
+       export KSRC_TREE=$(LINUX) && \
+       KSRC=$${KSRC:-$(LINUX_OBJ)} && \
+       m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
        popd && \
        popd && \
-       VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog); \
+       VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
        mkdir -p debs && \
        mkdir -p debs && \
-       mv ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes ../lustre_$${VER%-[0-9]*}.orig.tar.gz ../lustre_$${VER}.diff.gz ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
+       mv ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb \
+          ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb \
+          ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc \
+          ../lustre_$${VER}_*.changes ../lustre_$${VER}.tar.gz \
+          ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
 
 EXTRA_DIST += config.h.in
 
 
 EXTRA_DIST += config.h.in
 
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7f8f011
--- /dev/null
@@ -0,0 +1 @@
+7
index a988fd6..8c974d0 100644 (file)
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Brian J. Murrell <brian@interlinx.bc.ca>
 Uploaders: Brian J. Murrell <brian@interlinx.bc.ca>
 Standards-Version: 3.8.3
 Maintainer: Brian J. Murrell <brian@interlinx.bc.ca>
 Uploaders: Brian J. Murrell <brian@interlinx.bc.ca>
 Standards-Version: 3.8.3
-Build-Depends: libreadline-dev, debhelper (>=5.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, libsnmp-dev, bzip2, quilt, linux-headers-generic | linux-headers, rsync
+Build-Depends: module-assistant, libreadline-dev, debhelper (>=7.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, libsnmp-dev, bzip2, quilt, linux-headers-generic | linux-headers, rsync
 Homepage: http://www.lustre.org/
 Vcs-Cvs: -d :pserver:anonymous@cvs.lustre.org:/lustre
 
 Homepage: http://www.lustre.org/
 Vcs-Cvs: -d :pserver:anonymous@cvs.lustre.org:/lustre
 
@@ -32,7 +32,7 @@ Package: lustre-source
 Section: admin
 Architecture: all
 Priority: optional
 Section: admin
 Architecture: all
 Priority: optional
-Depends: module-assistant, bzip2, debhelper (>= 5.0.0), libsnmp-dev, dpatch
+Depends: module-assistant, bzip2, debhelper (>= 7.0.0), libsnmp-dev, dpatch
 Description: source for Lustre filesystem client kernel modules
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Intel Corporation and available from
 Description: source for Lustre filesystem client kernel modules
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Intel Corporation and available from
index a988fd6..8c974d0 100644 (file)
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Brian J. Murrell <brian@interlinx.bc.ca>
 Uploaders: Brian J. Murrell <brian@interlinx.bc.ca>
 Standards-Version: 3.8.3
 Maintainer: Brian J. Murrell <brian@interlinx.bc.ca>
 Uploaders: Brian J. Murrell <brian@interlinx.bc.ca>
 Standards-Version: 3.8.3
-Build-Depends: libreadline-dev, debhelper (>=5.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, libsnmp-dev, bzip2, quilt, linux-headers-generic | linux-headers, rsync
+Build-Depends: module-assistant, libreadline-dev, debhelper (>=7.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, libsnmp-dev, bzip2, quilt, linux-headers-generic | linux-headers, rsync
 Homepage: http://www.lustre.org/
 Vcs-Cvs: -d :pserver:anonymous@cvs.lustre.org:/lustre
 
 Homepage: http://www.lustre.org/
 Vcs-Cvs: -d :pserver:anonymous@cvs.lustre.org:/lustre
 
@@ -32,7 +32,7 @@ Package: lustre-source
 Section: admin
 Architecture: all
 Priority: optional
 Section: admin
 Architecture: all
 Priority: optional
-Depends: module-assistant, bzip2, debhelper (>= 5.0.0), libsnmp-dev, dpatch
+Depends: module-assistant, bzip2, debhelper (>= 7.0.0), libsnmp-dev, dpatch
 Description: source for Lustre filesystem client kernel modules
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Intel Corporation and available from
 Description: source for Lustre filesystem client kernel modules
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Intel Corporation and available from
index aac7ec5..3dcd0ca 100644 (file)
@@ -1,4 +1,3 @@
 debian/tmp/sbin/*                      sbin
 debian/tmp/usr/sbin/*                  usr/sbin
 debian/tmp/usr/bin/*                   usr/bin
 debian/tmp/sbin/*                      sbin
 debian/tmp/usr/sbin/*                  usr/sbin
 debian/tmp/usr/bin/*                   usr/bin
-debian/tmp/usr/libexec/lustre/lc_common        usr/libexec/lustre
index a59795f..bef0c49 100755 (executable)
@@ -29,7 +29,7 @@ endif
 #export CC
 
 # This is the debhelper compatability version to use.
 #export CC
 
 # This is the debhelper compatability version to use.
-export DH_COMPAT=5
+export DH_COMPAT=7
 
 # Module-assistant stuff
 PACKAGE=lustre-client-modules
 
 # Module-assistant stuff
 PACKAGE=lustre-client-modules
@@ -40,23 +40,20 @@ MA_DIR ?= /usr/share/modass
 ARCH=$(shell dpkg --print-architecture)
 TOP_DIR:=$(shell pwd)
 
 ARCH=$(shell dpkg --print-architecture)
 TOP_DIR:=$(shell pwd)
 
-#  the lustre build process. This is $(KERNEL_VERSION)
+# This is the Lustre version
 VERSION=$(shell sed -n -e '1s/.*(\(.*\)) .*/\1/p' debian/changelog)
 VERSION=$(shell sed -n -e '1s/.*(\(.*\)) .*/\1/p' debian/changelog)
-#SUPPORTED_KERNELS=2.6.27
-SUPPORTED_KERNELS=2.6.18 2.6.20 2.6.22
 UPVERSION=$(shell echo $VERSION | sed -e 's/-[^-]*$$//')
 UPVERSION=$(shell echo $VERSION | sed -e 's/-[^-]*$$//')
-#KERNEL_VERSION=2.6.27
-# the kernel version to build all of this with
-#KVER=2.6.27-11-generic
-# if the above is not set, default to whatever kernel is booted
-KVER?=$$(uname -r)
-KERNEL_TREE=/lib/modules/$(KVER)/build
+
+# KVER is set to LINUXRELEASE being by autoconf which is either
+# $(uname -r) or the version of the source specified by the user
+KVER?=$(LINUXRELEASE)
+
 # KVERS, KSRC are the kernel version and source to use when building lustre
 # Will be the default when building lustre-utils, etc but whatever module-assistant
 # supplied when building modules
 # KVERS, KSRC are the kernel version and source to use when building lustre
 # Will be the default when building lustre-utils, etc but whatever module-assistant
 # supplied when building modules
-KVERS?=$(KERNEL_VERSION)
-#KSRC?=$(KERNEL_TREE)
-KSRC=$(KERNEL_TREE)
+KVERS?=$(KVER)
+KSRC?=$(LINUX_OBJ)
+KSRC_TREE?=$(LINUX)
 
 # Packages
 PATCH_PKG=linux-patch-lustre
 
 # Packages
 PATCH_PKG=linux-patch-lustre
@@ -337,14 +334,15 @@ kdist_config: prep-deb-files patch-stamp
        # touch files to same date, to avoid auto*
        find . -type f -print0 | xargs -0 touch -r COPYING \;
        # Doesn't seem possible to only build modules...
        # touch files to same date, to avoid auto*
        find . -type f -print0 | xargs -0 touch -r COPYING \;
        # Doesn't seem possible to only build modules...
-       ./configure --with-linux=$(KSRC) \
+       ./configure --with-linux=$(KSRC_TREE) \
+                   --with-linux-obj=$(KSRC) \
                    --disable-server \
                    --disable-quilt  \
                    --disable-dependency-tracking \
                    --disable-doc  \
                    --disable-utils \
                    --disable-server \
                    --disable-quilt  \
                    --disable-dependency-tracking \
                    --disable-doc  \
                    --disable-utils \
+                   --disable-iokit \
                    --disable-snmp \
                    --disable-snmp \
-                   --disable-zerocopy \
                    --disable-tests \
                    --enable-quota
 
                    --disable-tests \
                    --enable-quota
 
@@ -355,7 +353,7 @@ kdist_configure: kdist_config
 # during a normal build
 binary-modules: prep-deb-files
        dh_testroot
 # during a normal build
 binary-modules: prep-deb-files
        dh_testroot
-       dh_clean -k
+       dh_prep
        $(MAKE) $(PMAKEARGS)
        $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME)
        # Remove stuff that doesn't belong (no module-only target)
        $(MAKE) $(PMAKEARGS)
        $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME)
        # Remove stuff that doesn't belong (no module-only target)
@@ -369,7 +367,7 @@ binary-modules: prep-deb-files
        dh_gencontrol -- -v$(VERSION)
        dh_md5sums -p $(PKGNAME)
        dh_builddeb --destdir=$(DEB_DESTDIR) -p $(PKGNAME)
        dh_gencontrol -- -v$(VERSION)
        dh_md5sums -p $(PKGNAME)
        dh_builddeb --destdir=$(DEB_DESTDIR) -p $(PKGNAME)
-       dh_clean -k -p $(PKGNAME)
+       dh_prep -p $(PKGNAME)
 
 clean:
        dh_testdir
 
 clean:
        dh_testdir