From 53eb13326140d4780adf532188487be38ceb34d8 Mon Sep 17 00:00:00 2001 From: brian Date: Wed, 19 Aug 2009 16:32:21 +0000 Subject: [PATCH] b=19721 i=adilger Add a debian/ dir to allow building on Debian/Ubuntu systems. The process is basically (from the top-level) lustre dir: $ dpkg-buildpackage $ sudo m-a build ../lustre-source_1.8.1-1_all.deb The above needs to be captured in a "make debs" Makefile target so that it works like the "make rpms" target, including building lustre packages as well as a binary kernel modules package. This will be the next step in this enhancement. All of this has really only been tested to build the patchless client with Ubuntu's 2.6.24-19-generic kernel at this point. However the bits necessary to build a patched server kernel are included, even if they need to be tested and perhaps tweaked for supported kernels. At least theoretically, it should work for newer kernels even. --- debian/README.Debian | 77 +++++++ debian/changelog | 128 +++++++++++ debian/control | 103 +++++++++ debian/control.main | 103 +++++++++ debian/control.modules.in | 20 ++ debian/copyright | 378 +++++++++++++++++++++++++++++++++ debian/liblustre.install | 1 + debian/linux-patch-lustre.apply | 118 +++++++++++ debian/linux-patch-lustre.dirs | 3 + debian/linux-patch-lustre.kpatches | 13 ++ debian/linux-patch-lustre.unpatch | 117 ++++++++++ debian/lustre-client-modules.install | 1 + debian/lustre-dev.dirs | 1 + debian/lustre-dev.install | 5 + debian/lustre-source.dirs | 3 + debian/lustre-source.docs | 1 + debian/lustre-tests.install | 1 + debian/lustre-utils.docs | 3 + debian/lustre-utils.examples | 2 + debian/lustre-utils.install | 4 + debian/lustre-utils.manpages | 1 + debian/rules | 399 +++++++++++++++++++++++++++++++++++ 22 files changed, 1482 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/control.main create mode 100644 debian/control.modules.in create mode 100644 debian/copyright create mode 100644 debian/liblustre.install create mode 100644 debian/linux-patch-lustre.apply create mode 100644 debian/linux-patch-lustre.dirs create mode 100644 debian/linux-patch-lustre.kpatches create mode 100644 debian/linux-patch-lustre.unpatch create mode 100644 debian/lustre-client-modules.install create mode 100644 debian/lustre-dev.dirs create mode 100644 debian/lustre-dev.install create mode 100644 debian/lustre-source.dirs create mode 100644 debian/lustre-source.docs create mode 100644 debian/lustre-tests.install create mode 100644 debian/lustre-utils.docs create mode 100644 debian/lustre-utils.examples create mode 100644 debian/lustre-utils.install create mode 100644 debian/lustre-utils.manpages create mode 100755 debian/rules diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..c464a20 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,77 @@ +Here is an short explanation what to install on your Servers to set up lustre quickly. +Be aware that this doesn't replace the Documentation and Installation Howtos from Lustre. + + +#1. Building the kernel and the modules + You've to download the linux-source-2.6.18|21|22 package and the linux-patch-lustre package. + + Then patch your kernel with the correct patch file. Build and install it. (Use make-kpkg) + To patch the kernel automatically use --added-patches=lustre as build option. + + Here is the full line how I build my kernel (for those who are not familiar with make-kpkg) + make-kpkg --added-patches=lustre --initrd --append-to-version "-quota-enabled-lustre-1.6.4.1" --revision credativ.1 kernel_image + + Now reboot into this new kernel and install the lustre modules with: + - m-a auto-install lustre + + Then the kernel and the modules should be there. + +#2. Preparing the system + In the next step install: + - lustre-utils + + Then load the kernel modules with: + - modprobe lnet + - modprobe lustre + - modprobe ldiskfs + + This have to be done on every server system. + +#3. Creating partitions on the OST/MDT/MGS Servers + Now you'll have to differentiate between the OST and MDT and MGS Systems + We'll assume here that MDT and MGS are on the same system: + + - Create partitions: + - MGS/MDT: mkfs.lustre --fsname spfs --mdt --mgs $device + - OST: mkfs.lustre --fsname spfs --ost --mgsnode=$mgsnode@tcp0 $device + + Additional options are: + --reformat - this partition was previously formated with lustre, reformat it + --param="failover.mode=failout" - don't hang the complete fs if a ost isn't available. + + - Now mount the partitons on the servers: + - first the MDT/MGS Server: + - mount -t lustre /dev/sda /srv/mdt + - now the OST's + - mount -t lustre /dev/sda /srv/ost + + +#4. Using the filesystem + In order to use the FS, you'll have to mount it on a client. Please note that this client also + needs the lustre-modules to be installed. (You can install lustre-source and build the module + as described in 1.) + - mount -t lustre mgsnode@tcp0:/spfs /mnt + +#4.1 Using Quota: + + The binaries and drivers for lustre in debian are compiled with enabled-quota. + So if you like to use quota this is quite simple: + - lfs quotacheck -ug $path/to/mounted/lustre/fs + - lfs setquota -u $user 1000 2000 10000 20000 $path/to/mounted/lustre/fs + - lfs quota -u $user $path/to/mounted/lustre/fs + + If you want to reset this quota informations for a given user, you'll have first to + set every value to zero, and then give the new informations: + - lfs setquota -u $user 0 0 0 0 $path/to/mounted/lustre/fs + - lfs setquota -u $user 2000 3000 3000 4000 $path/to/mounted/lustre/fs + + This behaviour is reported as lustre bug: https://bugzilla.lustre.org/show_bug.cgi?id=14513 + + + +########### +Please have also a look into the official documentation for lustre available at: + +http://manual.lustre.org/index.php?title=Main_Page + + -- Patrick Winnertz Thu, 28 Dec 2007 14:53:25 +0200 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..7fe79d5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,128 @@ +lustre (1.8.1.50-1) unstable; urgency=low + + * Update for an on-the-road-to-1.8.2 release + + -- Brian J. Murrell Mon, 17 Aug 2009 14:54:35 -0400 + +lustre (1.8.1-1) unstable; urgency=low + + * Final 1.8.1 upstream version + * disable building the snmp module + - it needs work to build with newer gccs + + -- Brian J. Murrell Mon, 10 Aug 2009 15:53:04 -0400 + +lustre (1.8.1-0.01) unstable; urgency=low + + * New upstream version + + -- Brian J. Murrell Sat, 30 May 2009 19:21:04 -0400 + +lustre (1.6.6-9) unstable; urgency=low + + * Rebuild for 2.6.27-8-generic + + -- Brian J. Murrell Thu, 27 Nov 2008 15:25:43 -0500 + +lustre (1.6.6-8) unstable; urgency=low + + * 1.6.6 final release + + -- Brian J. Murrell Tue, 28 Oct 2008 10:15:39 -0500 + +lustre (1.6.6-7) unstable; urgency=low + + * remove bz17302.patch, merged upstream + * refresh from the b_release_1_6_6 branch + + -- Brian J. Murrell Fri, 24 Oct 2008 12:07:18 -0500 + +lustre (1.6.6-6) unstable; urgency=low + + * remove broken patch + + -- Brian J. Murrell Wed, 22 Oct 2008 16:35:40 -0500 + +lustre (1.6.6-5) unstable; urgency=low + + * refresh the bz 14250 patches + + -- Brian J. Murrell Mon, 20 Oct 2008 17:14:57 -0500 + +lustre (1.6.6-4) unstable; urgency=low + + * update b_release_1_6_6 branch + + -- Brian J. Murrell Tue, 14 Oct 2008 15:49:50 -0500 + +lustre (1.6.6-3) unstable; urgency=low + + * add linux-proc.c patch to bz14250-b_release_1_6_6.patch per comment + #55 + + -- Brian J. Murrell Fri, 3 Oct 2008 23:51:00 -0500 + +lustre (1.6.6-2) unstable; urgency=low + + * Include local test fixes not yet landed + + -- Brian J. Murrell Fri, 3 Oct 2008 23:51:00 -0500 + +lustre (1.6.6-1) unstable; urgency=low + + * New upstream release. + + -- Brian J. Murrell Thu, 2 Oct 2008 17:24:57 -0500 + +lustre (1.6.5.1-1) unstable; urgency=low + + * New upstream release. + * V2 of the security plugin architecture patch (bz15308). + + -- Brian J. Murrell Mon, 7 Jul 2008 09:50:50 -0500 + +lustre (1.6.5-1) unstable; urgency=low + + * New upstream release. + * Add the security plugin architecture patch (bz15308). + + -- Brian J. Murrell Wed, 21 May 2008 15:32:58 -0500 + +lustre (1.6.5rc3-3) unstable; urgency=low + + * Make service tags update idempotent. + + -- Brian J. Murrell Wed, 21 May 2008 15:32:58 -0500 + +lustre (1.6.5rc3-2) unstable; urgency=low + + * Small fix to the servicetags portion of mount.lustre. + + -- Brian J. Murrell Tue, 20 May 2008 12:15:40 -0500 + +lustre (1.6.5rc3-1) unstable; urgency=low + + [ Brian J. Murrell ] + * New upstream release (1.6.5rc3). + + -- Brian J. Murrell Sat, 17 May 2008 20:17:40 -0500 + +lustre (1.6.0.1-1) unstable; urgency=low + + [ Brian J. Murrell ] + * New upstream release. + - fixes broken patchless client build issue + - add https://bugzilla.lustre.org/attachment.cgi?id=9770 (from bug 11710) + - package lustre-tests + + -- Brian J. Murrell Tue, 10 May 2007 12:12:11 -0500 + +lustre (1.6.0-1) unstable; urgency=low + + [ Brian J. Murrell ] + * New upstream release. + * lustre-source requires SNMP support, so depend on libsnmp-dev. + * Build on latest 2.6.20 Ubuntu kernel (2.6.20-15). + + -- Brian J. Murrell Tue, 1 May 2007 20:53:08 -0500 + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..41a02c5 --- /dev/null +++ b/debian/control @@ -0,0 +1,103 @@ +Source: lustre +Section: admin +Priority: optional +Maintainer: Brian J. Murrell +Uploaders: Brian J. Murrell +Standards-Version: 3.8.3 +Build-Depends: libreadline-dev, debhelper (>=5.0.0), dpatch, automake1.7, libsnmp-dev, bzip2, quilt, texlive-latex-recommended, linux-headers-generic, rsync +Homepage: http://www.lustre.org/ +Vcs-Cvs: -d :pserver:anonymous@cvs.lustre.org:/lustre + +Package: linux-patch-lustre +Section: devel +Architecture: all +Priority: optional +Depends: ${kpatch:Depends} +Recommends: kernel-package, quilt +Description: Linux kernel patch for the Lustre Filesystem + Lustre is a scalable, secure, robust, highly-available + cluster file system. It is maintained by Sun Microsystems, Inc. + and available from http://www.lustre.org + . + Lustre servers require a number of patches to the core Linux kernel, + mostly to export new functions, add features to ext3, and add + a new locking path to the VFS. This package provides these patches + for kernel versions 2.6.18, 2.6.21 and 2.6.22 on i386, amd64, powerpc + and ia64 architectures. + . + For Lustre clients, you will also need to build a lustre-modules + package, using the lustre-source package and module-assistant. + +Package: lustre-source +Section: admin +Architecture: all +Priority: optional +Depends: module-assistant, bzip2, debhelper (>= 5.0.0), libsnmp-dev, dpatch +Description: source for Lustre filesystem client kernel modules + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available from + http://www.lustre.org + . + This package contains the module source. The client kernel modules + can be built for kernels from 2.6.18 - 2.6.26 from it using + module-assistant or make-kpkg. + +Package: lustre-utils +Section: utils +Architecture: i386 powerpc amd64 ia64 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Userspace utilities for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available from + http://www.lustre.org + . + This package provides a number of userspace utilities for + maintaining Lustre filesystems. + +Package: lustre-tests +Section: utils +Architecture: i386 powerpc amd64 ia64 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Test suite for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available from + http://www.lustre.org + . + This package provides a number of test utilities for the Lustre filesystem. + +Package: liblustre +Priority: optional +Architecture: i386 powerpc amd64 ia64 +Section: libs +Depends: ${shlibs:Depends} +Description: Runtime library for Lustre filesystem utilities + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available + from http://www.lustre.org + . + This package provides a shared library that is used by userspace + applications to work with Lustre filesystems. It gives a user application + linked with the library access to Lustre + file systems without the need to mount Lustre (VFS) on the client. + The key goals for the library are to provide a portable mechanism to + access Lustre from different POSIX compliant operating systems, to provide + access from microkernel based systems and from the Windows operating system. + . + Currently, liblustre is still under development and only works on Linux + (i386 & x86_64, not tested on ia64). + . + Please see https://mail.clusterfs.com/wikis/lustre/LibLustreHowTo for details. + +Package: lustre-dev +Section: libdevel +Priority: optional +Architecture: i386 powerpc amd64 ia64 +Depends: lustre-utils (= ${binary:Version}) +Description: Development files for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available from + http://www.lustre.org + . + This package provides development libraries for the Lustre filesystem. diff --git a/debian/control.main b/debian/control.main new file mode 100644 index 0000000..41a02c5 --- /dev/null +++ b/debian/control.main @@ -0,0 +1,103 @@ +Source: lustre +Section: admin +Priority: optional +Maintainer: Brian J. Murrell +Uploaders: Brian J. Murrell +Standards-Version: 3.8.3 +Build-Depends: libreadline-dev, debhelper (>=5.0.0), dpatch, automake1.7, libsnmp-dev, bzip2, quilt, texlive-latex-recommended, linux-headers-generic, rsync +Homepage: http://www.lustre.org/ +Vcs-Cvs: -d :pserver:anonymous@cvs.lustre.org:/lustre + +Package: linux-patch-lustre +Section: devel +Architecture: all +Priority: optional +Depends: ${kpatch:Depends} +Recommends: kernel-package, quilt +Description: Linux kernel patch for the Lustre Filesystem + Lustre is a scalable, secure, robust, highly-available + cluster file system. It is maintained by Sun Microsystems, Inc. + and available from http://www.lustre.org + . + Lustre servers require a number of patches to the core Linux kernel, + mostly to export new functions, add features to ext3, and add + a new locking path to the VFS. This package provides these patches + for kernel versions 2.6.18, 2.6.21 and 2.6.22 on i386, amd64, powerpc + and ia64 architectures. + . + For Lustre clients, you will also need to build a lustre-modules + package, using the lustre-source package and module-assistant. + +Package: lustre-source +Section: admin +Architecture: all +Priority: optional +Depends: module-assistant, bzip2, debhelper (>= 5.0.0), libsnmp-dev, dpatch +Description: source for Lustre filesystem client kernel modules + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available from + http://www.lustre.org + . + This package contains the module source. The client kernel modules + can be built for kernels from 2.6.18 - 2.6.26 from it using + module-assistant or make-kpkg. + +Package: lustre-utils +Section: utils +Architecture: i386 powerpc amd64 ia64 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Userspace utilities for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available from + http://www.lustre.org + . + This package provides a number of userspace utilities for + maintaining Lustre filesystems. + +Package: lustre-tests +Section: utils +Architecture: i386 powerpc amd64 ia64 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Test suite for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available from + http://www.lustre.org + . + This package provides a number of test utilities for the Lustre filesystem. + +Package: liblustre +Priority: optional +Architecture: i386 powerpc amd64 ia64 +Section: libs +Depends: ${shlibs:Depends} +Description: Runtime library for Lustre filesystem utilities + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available + from http://www.lustre.org + . + This package provides a shared library that is used by userspace + applications to work with Lustre filesystems. It gives a user application + linked with the library access to Lustre + file systems without the need to mount Lustre (VFS) on the client. + The key goals for the library are to provide a portable mechanism to + access Lustre from different POSIX compliant operating systems, to provide + access from microkernel based systems and from the Windows operating system. + . + Currently, liblustre is still under development and only works on Linux + (i386 & x86_64, not tested on ia64). + . + Please see https://mail.clusterfs.com/wikis/lustre/LibLustreHowTo for details. + +Package: lustre-dev +Section: libdevel +Priority: optional +Architecture: i386 powerpc amd64 ia64 +Depends: lustre-utils (= ${binary:Version}) +Description: Development files for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Sun Microsystems, Inc. and available from + http://www.lustre.org + . + This package provides development libraries for the Lustre filesystem. diff --git a/debian/control.modules.in b/debian/control.modules.in new file mode 100644 index 0000000..2a57ac8 --- /dev/null +++ b/debian/control.modules.in @@ -0,0 +1,20 @@ +Source: lustre +Section: admin +Priority: optional +Maintainer: Brian J. Murrell +Uploaders: Brian J. Murrell +Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 5.0.0), bzip2 + +Package: lustre-client-modules-_KVERS_ +Architecture: any +Recommends: linux-image, lustre-utils +Provides: lustre-client-modules +Description: Lustre Linux kernel module (kernel _KVERS_) + This package contains the lustre loadable kernel modules for the + patchless client for the Lustre cluster filesystem. + . + These modules are compiled for the _KVERS_ linux kernel. + + + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..9b7a2cd --- /dev/null +++ b/debian/copyright @@ -0,0 +1,378 @@ +This package was debianized by Brian J. Murrell , +Aug. 2009. It is heavily based on the work of Alastair McKinstry +, October 2006. and more recently the Debian Lustre +Packaging team, , which is +based on work by Goswin von Brederlow and Patrick Winnertz. + +It is currently maintained by Brian J. Murrell, + +Lustre is Copyright (C) 2002-2009 Sun Microsystems, Inc. and is licensed +under the GNU Public License Version 2; +it was downloaded from http://www.lustre.org/ . + +The documentation (included in lustre-utils) is covered by +the GNU Free Documentation License; there are no invariant-clauses included +in this documentation, and hence it is considered to be free under +the Debian Free Software Guidelines (DFSG). + +A copy of the GPL may be found at /usr/share/common-licenses/GPL-2. + +A copy of the FDL is appended below: + +------------------------------------------------------------------------------- + + GNU Free Documentation License + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document "free" in the sense of freedom: to assure everyone +the effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get +credit for their work, while not being considered responsible for +modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The "Document", below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as "you". + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML designed for human modification. Opaque formats include +PostScript, PDF, proprietary formats that can be read and edited only +by proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML produced by some word processors for output +purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more than 100, +and the Document's license notice requires Cover Texts, you must enclose +the copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has less than five). +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section entitled "History", and its title, and add to + it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section as "Endorsements" + or to conflict in title with any Invariant Section. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections entitled "History" +in the various original documents, forming one section entitled +"History"; likewise combine any sections entitled "Acknowledgements", +and any sections entitled "Dedications". You must delete all sections +entitled "Endorsements." + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an "aggregate", and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +are not themselves derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write "no Front-Cover Texts" instead of +"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/debian/liblustre.install b/debian/liblustre.install new file mode 100644 index 0000000..c16d59c --- /dev/null +++ b/debian/liblustre.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/liblustre.so usr/lib diff --git a/debian/linux-patch-lustre.apply b/debian/linux-patch-lustre.apply new file mode 100644 index 0000000..444b264 --- /dev/null +++ b/debian/linux-patch-lustre.apply @@ -0,0 +1,118 @@ +#! /bin/bash +set -x + +if ! [ -d kernel -a -d Documentation ] +then + echo >&2 "Not in kernel top level directory. Exiting" + exit 1 +fi +TOPPATCHDIR=/usr/src/kernel-patches/lustre +ARCHITECTURE=`dpkg --print-installation-architecture` + +QUILT="quilt --quiltrc /dev/null" +export QUILT_PATCHES="$TOPPATCHDIR/patches" + +[ -f debian/APPLIED_all_lustre ] && exit 0 +VERSION=$(grep ^VERSION Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +PATCHLEVEL=$( grep ^PATCHLEVEL Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +#EXTRAVERSION=$(grep ^EXTRAVERSION Makefile | head -1 2>/dev/null | \ +# sed -e 's/EXTRAVERSION =[ ]*\([^ ]*\)$/\1/') +#KERNELBRANCHLET=${VERSION}.${PATCHLEVEL}.${SUBLEVEL} +#KERNELRELEASE=${KERNELBRANCHLET}${EXTRAVERSION} +KERNELRELEASE=${VERSION}.${PATCHLEVEL}.${SUBLEVEL} + +cleanup() { + echo >&2 Cleaning up + if [ -e series ]; then + echo >&2 Removing series file + rm series + fi + if [ -e debian/APLLIED_all_lustre_tmp/series.orig ]; then + echo >&1 Restoring orig series file + mv debian/APLLIED_all_lustre_tmp/series.orig series + fi + if [ -e .pc ]; then + echo >&2 Removing .pc dir + rm -r .pc + fi + if [ -e debian/APPLIED_all_lustre_tmp/.pc.orig ]; then + echo >&2 Restoring orig .pc dir + mv debian/APPLIED_all_lustre_tmp/.pc.orig .pc + fi +} + +mkdir -p debian/APPLIED_all_lustre_tmp +if [ -e series ]; then + echo >&2 Preserving existing series file + mv series debian/APPLIED_all_lustre_tmp/series.orig +fi +if [ -e .pc ]; then + echo >&2 Preserving existing .pc dir + mv .pc debian/APPLIED_all_lustre_tmp/.pc.orig +fi + +trap cleanup EXIT + +echo >&2 Setting up quilt +$QUILT setup $TOPPATCHDIR/series/$KERNELRELEASE-vanilla.series 2>/dev/null +ERR=$? +if ! [ $ERR = 0 ]; then + echo >&2 Quilt failed to initialize + cleanup + exit $ERR +fi + +echo >&2 Applying lustre patches +$QUILT push -a +ERR=$? +if ! [ $ERR = 0 ]; then + echo >&2 Lustre patched failed to apply + echo >&2 Reverting partialy applied patch + $QUILT pop -a + cleanup + exit $ERR +fi + +echo >&2 Finalizing lustre patch +mv series debian/APPLIED_all_lustre_tmp/series.lustre +mv .pc debian/APPLIED_all_lustre_tmp/.pc.lustre +cleanup + + +echo >&2 "\"Lustre Filesystem patch for the Linux kernel\" patch for $KVERSION succeeded" + +echo >&2 "Removing empty files:" +# make an exception for ./debian, or else the stamp files will go too. +find . -path ./debian -prune -o \ + -type f -size 0 ! -name 'APPLIED*' -exec rm {} \; -print +echo >&2 "Done." + +mkdir -p debian +cat > 'debian/APPLIED_all_lustre' < 'debian/image.d/register-lustre' <> \${docdir}/applied-patches +EOF +chmod +x 'debian/image.d/register-lustre' + +echo >&2 "END applying lustre patch" diff --git a/debian/linux-patch-lustre.dirs b/debian/linux-patch-lustre.dirs new file mode 100644 index 0000000..b9d3f39 --- /dev/null +++ b/debian/linux-patch-lustre.dirs @@ -0,0 +1,3 @@ +usr/src/kernel-patches/lustre/scripts +usr/src/kernel-patches/lustre/series +usr/src/kernel-patches/lustre/patches diff --git a/debian/linux-patch-lustre.kpatches b/debian/linux-patch-lustre.kpatches new file mode 100644 index 0000000..0bf1ef0 --- /dev/null +++ b/debian/linux-patch-lustre.kpatches @@ -0,0 +1,13 @@ +Patch-name: Lustre Filesystem patch for the Linux kernel +Patch-id: lustre +Architecture: amd64, ia64, i386, powerpc +Path-strip-level: 1 + +Patch-file: debian/kpatches/patch-vanilla-2.6.18 +Kernel-version: 2.6.18 + +Patch-file: debian/kpatches/patch-vanilla-2.6.20 +Kernel-version: 2.6.20 + +Patch-file: debian/kpatches/patch-vanilla-2.6.21 +Kernel-version: 2.6.21 diff --git a/debian/linux-patch-lustre.unpatch b/debian/linux-patch-lustre.unpatch new file mode 100644 index 0000000..befc542 --- /dev/null +++ b/debian/linux-patch-lustre.unpatch @@ -0,0 +1,117 @@ +#! /bin/bash +set -x + +if ! [ -d kernel -a -d Documentation ] +then + echo >&2 "Not in kernel top level directory. Exiting" + exit 1 +fi +TOPPATCHDIR=/usr/src/kernel-patches/lustre +ARCHITECTURE=`dpkg --print-installation-architecture` + +QUILT="quilt --quiltrc /dev/null" +export QUILT_PATCHES="$TOPPATCHDIR/patches" + +if ! [ -f debian/APPLIED_all_lustre ]; then + echo >&2 "Lustre patch not applied." + exit 0 +fi +VERSION=$(grep ^VERSION Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +PATCHLEVEL=$( grep ^PATCHLEVEL Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +#EXTRAVERSION=$(grep ^EXTRAVERSION Makefile | head -1 2>/dev/null | \ +# sed -e 's/EXTRAVERSION =[ ]*\([^ ]*\)$/\1/') +#KERNELBRANCHLET=${VERSION}.${PATCHLEVEL}.${SUBLEVEL} +#KERNELRELEASE=${KERNELBRANCHLET}${EXTRAVERSION} +KERNELRELEASE=${VERSION}.${PATCHLEVEL}.${SUBLEVEL} + +# Check for depends on lustre +if grep -l "^DEPENDS=.*[' ]all/unpatch/lustre[' ]" debian/APPLIED_* >/dev/null 2>/dev/null; then + # There are patches depending on this one, to be removed before. + # the dep will be removed by the last of those other patches. + echo >&2 "NOT unpatching \"Lustre Filesystem patch for the Linux kernel\" since other patches still rely on it" + exit 0 +fi + +if ! [ -d debian/APPLIED_all_lustre_tmp/.pc.lustre ]; then + cat >&2 <&2 <&2 Cleaning up + if [ -e series ]; then + echo >&2 Removing series file + rm series + fi + if [ -e debian/APPLIED_all_lustre_tmp/series.orig ]; then + echo >&1 Restoring orig series file + mv debian/APPLIED_all_lustre_tmp/series.orig series + fi + if [ -e .pc ]; then + echo >&2 Removing .pc dir + rm -r .pc + fi + if [ -e debian/APPLIED_all_lustre_tmp/.pc.orig ]; then + echo >&2 Restoring orig .pc dir + mv debian/APPLIED_all_lustre_tmp/.pc.orig .pc + fi +} + +if [ -e series ]; then + echo >&2 Preserving existing series file + mv series debian/APPLIED_all_lustre_tmp/series.orig +fi +if [ -e .pc ]; then + echo >&2 Preserving existing .pc dir + mv .pc debian/APPLIED_all_lustre_tmp/.pc.orig +fi + +trap cleanup EXIT + +echo >&2 Restoring lustre quilt +mv debian/APPLIED_all_lustre_tmp/series.lustre series +mv debian/APPLIED_all_lustre_tmp/.pc.lustre .pc + +echo >&2 Unpatching lustre patches +$QUILT pop -a +ERR=$? +if ! [ $ERR = 0 ]; then + cat >&2 <&2 Removing lustre quilt +rm -rf .pc series +cleanup +rm debian/APPLIED_all_lustre debian/image.d/register-lustre + +echo >&2 "\"Lustre Filesystem patch for the Linux kernel\" patch for $KVERSION removed successfully" + +echo >&2 "Removing empty files:" +# make an exception for ./debian, or else the stamp files will go too. +find . -path ./debian -prune -o \ + -type f -size 0 ! -name 'APPLIED*' -exec rm {} \; -print +echo >&2 "Done." + +rmdir debian/image.d debian/APPLIED_all_lustre_tmp || true + +echo >&2 "END unpatching lustre patch" diff --git a/debian/lustre-client-modules.install b/debian/lustre-client-modules.install new file mode 100644 index 0000000..dd93d15 --- /dev/null +++ b/debian/lustre-client-modules.install @@ -0,0 +1 @@ +debian/tmp/lib / diff --git a/debian/lustre-dev.dirs b/debian/lustre-dev.dirs new file mode 100644 index 0000000..e47a2fe --- /dev/null +++ b/debian/lustre-dev.dirs @@ -0,0 +1 @@ +usr/share/doc/lustre-dev/contrib diff --git a/debian/lustre-dev.install b/debian/lustre-dev.install new file mode 100644 index 0000000..7807056 --- /dev/null +++ b/debian/lustre-dev.install @@ -0,0 +1,5 @@ +lustre/contrib/README usr/share/doc/lustre-dev/contrib +lustre/contrib/mpich-1.2.6-lustre.patch usr/share/doc/lustre-dev/contrib +debian/tmp/usr/include/linux/* usr/include/linux +debian/tmp/usr/include/lustre/* usr/include/lustre +debian/tmp/usr/lib/*.a usr/lib diff --git a/debian/lustre-source.dirs b/debian/lustre-source.dirs new file mode 100644 index 0000000..194b530 --- /dev/null +++ b/debian/lustre-source.dirs @@ -0,0 +1,3 @@ +usr/src +usr/src/modules +usr/share/modass/overrides diff --git a/debian/lustre-source.docs b/debian/lustre-source.docs new file mode 100644 index 0000000..e174728 --- /dev/null +++ b/debian/lustre-source.docs @@ -0,0 +1 @@ +debian/README.Debian diff --git a/debian/lustre-tests.install b/debian/lustre-tests.install new file mode 100644 index 0000000..1c00088 --- /dev/null +++ b/debian/lustre-tests.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/lustre/tests/* usr/lib/lustre/tests diff --git a/debian/lustre-utils.docs b/debian/lustre-utils.docs new file mode 100644 index 0000000..43d311c --- /dev/null +++ b/debian/lustre-utils.docs @@ -0,0 +1,3 @@ +lustre/BUGS +README +lustre/FDL diff --git a/debian/lustre-utils.examples b/debian/lustre-utils.examples new file mode 100644 index 0000000..b16e58d --- /dev/null +++ b/debian/lustre-utils.examples @@ -0,0 +1,2 @@ +lustre/tests/llmountcleanup.sh +lustre/tests/llmount.sh diff --git a/debian/lustre-utils.install b/debian/lustre-utils.install new file mode 100644 index 0000000..eece3a3 --- /dev/null +++ b/debian/lustre-utils.install @@ -0,0 +1,4 @@ +debian/tmp/sbin/* sbin +debian/tmp/usr/sbin/* usr/sbin +debian/tmp/usr/bin/* usr/bin +debian/tmp/usr/lib/lustre/lc_common usr/lib/lustre diff --git a/debian/lustre-utils.manpages b/debian/lustre-utils.manpages new file mode 100644 index 0000000..7f0e0c2 --- /dev/null +++ b/debian/lustre-utils.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/*/* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..09003ad --- /dev/null +++ b/debian/rules @@ -0,0 +1,399 @@ +#!/usr/bin/make -f +# +# Created 2009 by Brian J. Murrell based on work by +# Alastair McKinstry, , +# Patrick Winnertz, and the pkg-lustre Debian maintainers +# +# Copying and modification is unlimited, provided that the modified +# version is marked as being modified. + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) +DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) + +# whether to use module-assistant to build the kernel modules or not +USE_MA = true + +CFLAGS = -Wall -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# We need the kernels to be built with gcc-3.3; suspect that gcc-4.1 uses too +# much stack and crashes because of it. +#CC?=gcc-3.3 +#export CC + +# This is the debhelper compatability version to use. +export DH_COMPAT=5 + +# Module-assistant stuff +PACKAGE=lustre-client-modules +MA_DIR ?= /usr/share/modass +-include $(MA_DIR)/include/generic.make +-include $(MA_DIR)/include/common-rules.make + +ARCH=$(shell dpkg --print-architecture) +TOP_DIR:=$(shell pwd) + +# the lustre build process. This is $(KERNEL_VERSION) +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/-[^-]*$$//') +#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 +# 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) + +# Packages +PATCH_PKG=linux-patch-lustre +UTILS_PKG=lustre-utils +TESTS_PKG=lustre-tests +DEV_PKG=lustre-dev +LIB_PKG=liblustre +SOURCE_PKG=lustre-source +MODS_PKG=lustre-client-modules + +#Build dir +#BUILDDIR=debian/build +#SRCDIR=../.. +# I'm afraid we seem to have broken the BUILDDIR concept in Lustre's +# autoconf macros +BUILDDIR=. +SRCDIR=. + +autogen: autogen-stamp +autogen-stamp: patch-stamp + cp /usr/share/misc/config.sub config.sub + cp /usr/share/misc/config.sub libsysio/config.sub + cp /usr/share/misc/config.sub ldiskfs/config.sub + cp /usr/share/misc/config.guess config.guess + cp /usr/share/misc/config.guess libsysio/config.guess + cp /usr/share/misc/config.guess ldiskfs/config.guess + sh ./autogen.sh + touch $@ + +configure: configure-stamp +configure-stamp: autogen-stamp debian/control.main debian/control.modules.in + dh_testdir + # touch files to same date, to avoid auto* + find . -type f -print0 | xargs -0 touch -r COPYING; \ + if [ "$(BUILDDIR)" != "." ]; then \ + mkdir -p $(BUILDDIR)/build $(BUILDDIR)/lustre/contrib $(BUILDDIR)/libsysio; \ + cp build/Makefile $(BUILDDIR)/build/; \ + cp lustre/contrib/mpich-*.patch $(BUILDDIR)/lustre/contrib/; \ + ln -s ../../../libsysio/include $(BUILDDIR)/libsysio/; \ + fi + ( cd $(BUILDDIR) && \ + $(SRCDIR)/configure --disable-dependency-tracking \ + --disable-modules \ + --disable-snmp \ + --disable-client \ + --enable-quota \ + --disable-server ) + touch $@ + +build-arch build-indep: build + +build: build-stamp +build-stamp: patch-stamp configure-stamp + dh_testdir + $(MAKE) -C $(BUILDDIR) + $(MAKE) -C $(BUILDDIR) DESTDIR=$(TOP_DIR)/debian/tmp install + # jump our lustre-client-modules into the control file if not using m-a + if ! $(USE_MA); then \ + (cat debian/control.main; sed -e '1,/^$$/d' -e "s/_KVERS_/$(KVER)/g" < debian/control.modules.in) > debian/control; \ + for file in debian/*_KVERS_*; do \ + newfile=$$(echo $$file | sed -e "s/_KVERS_/$(KVER)/g"); \ + cp $$file $$newfile; \ + done; \ + fi + touch $@ + +# let's try and operate as close as the user would and not build modules +# here (for now) +# instead we will build the modules with m-a in the "make debs" target +# binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) binary-$(LIB_PKG) binary-$(MODS_PKG) binary-kern-mods +binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) binary-$(LIB_PKG) + +binary-indep: binary-$(PATCH_PKG) binary-$(SOURCE_PKG) + +binary: binary-indep binary-arch + +binary-$(PATCH_PKG): patch-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(PATCH_PKG) + dh_installdocs -p $(PATCH_PKG) +# dh_installkpatches -p $(PATCH_PKG) + dh_install -p $(PATCH_PKG) + + # Install apply script + cp $(TOP_DIR)/debian/linux-patch-lustre.apply $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/scripts/apply + chmod a+x $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/scripts/apply + set -e; for KERNEL in $(SUPPORTED_KERNELS); do \ + mkdir -p $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/all/$$KERNEL/apply/; \ + ln -s ../../../lustre/scripts/apply $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/all/$$KERNEL/apply/lustre; \ + done + + # Install unpatch script + cp $(TOP_DIR)/debian/linux-patch-lustre.unpatch $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/scripts/unpatch + chmod a+x $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/scripts/unpatch + set -e; for KERNEL in $(SUPPORTED_KERNELS); do \ + mkdir -p $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/all/$$KERNEL/unpatch/; \ + ln -s ../../../lustre/scripts/unpatch $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/all/$$KERNEL/unpatch/lustre; \ + done + + # Install series + cp lustre/kernel_patches/series/*.series $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/series/ + + # Install patches + cp lustre/kernel_patches/patches/*.patch $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/patches/ + + dh_installchangelogs -p $(PATCH_PKG) lustre/ChangeLog + dh_compress -p $(PATCH_PKG) + dh_installdeb -p $(PATCH_PKG) + dh_fixperms -p $(PATCH_PKG) + dh_gencontrol -p $(PATCH_PKG) + dh_md5sums -p $(PATCH_PKG) + dh_builddeb -p $(PATCH_PKG) + +binary-$(UTILS_PKG): build-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(UTILS_PKG) + dh_installdocs -p $(UTILS_PKG) + dh_installman -p $(UTILS_PKG) + dh_install -p $(UTILS_PKG) + dh_makeshlibs -p $(UTILS_PKG) + dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib + dh_installexamples -p $(UTILS_PKG) + dh_installchangelogs -p $(UTILS_PKG) lustre/ChangeLog + dh_compress -p $(UTILS_PKG) + dh_strip -p $(UTILS_PKG) + dh_installdeb -p $(UTILS_PKG) + dh_fixperms -p $(UTILS_PKG) + dh_gencontrol -p $(UTILS_PKG) + dh_md5sums -p $(UTILS_PKG) + dh_builddeb -p $(UTILS_PKG) + +binary-$(TESTS_PKG): build-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(TESTS_PKG) + dh_installdocs -p $(TESTS_PKG) + dh_installman -p $(TESTS_PKG) + dh_install -p $(TESTS_PKG) + dh_makeshlibs -p $(TESTS_PKG) + dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib + dh_installexamples -p $(TESTS_PKG) + dh_installchangelogs -p $(TESTS_PKG) lustre/ChangeLog + dh_compress -p $(TESTS_PKG) + dh_strip -p $(TESTS_PKG) + dh_installdeb -p $(TESTS_PKG) + dh_fixperms -p $(TESTS_PKG) + dh_gencontrol -p $(TESTS_PKG) + dh_md5sums -p $(TESTS_PKG) + dh_builddeb -p $(TESTS_PKG) + +binary-$(DEV_PKG): build-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(DEV_PKG) + dh_install -p $(DEV_PKG) + dh_installdocs -p $(DEV_PKG) + dh_installchangelogs -p $(DEV_PKG) lustre/ChangeLog + dh_compress -p $(DEV_PKG) + dh_installdeb -p $(DEV_PKG) + dh_fixperms -p $(DEV_PKG) + dh_gencontrol -p $(DEV_PKG) + dh_md5sums -p $(DEV_PKG) + dh_builddeb -p $(DEV_PKG) + +binary-$(LIB_PKG): build-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(LIB_PKG) + dh_installdocs -p $(LIB_PKG) + dh_install -p $(LIB_PKG) + dh_makeshlibs -p $(LIB_PKG) + dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib + dh_installchangelogs -p $(LIB_PKG) lustre/ChangeLog + dh_compress -p $(LIB_PKG) + dh_installdeb -p $(LIB_PKG) + dh_strip -p $(LIB_PKG) + dh_fixperms -p $(LIB_PKG) + dh_gencontrol -p $(LIB_PKG) + dh_md5sums -p $(LIB_PKG) + dh_builddeb -p $(LIB_PKG) + +binary-$(SOURCE_PKG): build-stamp + dh_testdir + dh_testroot + # Copy everything + dh_installdirs -p $(SOURCE_PKG) usr/src/modules/lustre/debian + rsync -av --exclude='debian/$(SOURCE_PKG)/*' \ + --link-dest=$(PWD) \ + . debian/$(SOURCE_PKG)/usr/src/modules/lustre + # Remove FULLCLEAN setting + rm debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/rules + sed -e 's/FULLCLEAN=full-clean/FULLCLEAN=/' < debian/rules > debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/rules + # clean up dest + rm -rf debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/patched \ + debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/patches/* + $(MAKE) -C debian/$(SOURCE_PKG)/usr/src/modules/lustre -f debian/rules clean + # Create the module-source tarball. + cd debian/$(SOURCE_PKG)/usr/src && tar jcf lustre.tar.bz2 modules + rm -rf debian/$(SOURCE_PKG)/usr/src/modules + dh_install -p$(SOURCE_PKG) + dh_installchangelogs -p $(SOURCE_PKG) lustre/ChangeLog + dh_installdocs -p $(SOURCE_PKG) + dh_link -p $(SOURCE_PKG) /usr/share/modass/packages/default.sh /usr/share/modass/overrides/lustre-source + dh_compress -p $(SOURCE_PKG) + dh_installdeb -p $(SOURCE_PKG) + dh_fixperms -p $(SOURCE_PKG) + dh_gencontrol -p $(SOURCE_PKG) + dh_md5sums -p $(SOURCE_PKG) + dh_builddeb -p $(SOURCE_PKG) + +# if only we could use m-a for this, but this stupid "compliant.list" +# thing fouls that up +binary-kern-mods: + mkdir -p debian/m-a_root/usr_src/modules + ln -s ../../../../ debian/m-a_root/usr_src/modules/lustre + m-a -t -u debian/m-a_root/ -d -v -k $(KSRC) build lustre + mv -f debian/m-a_root/*.deb .. + +# an alternative (to module-assistant) method of building the kernel modules +binary-$(MODS_PKG): build-stamp + if ! $(USE_MA); then \ + cp debian/lustre-client-modules.install debian/lustre-client-modules-$(KVER).install ; \ + dh_testdir; \ + dh_testroot; \ + dh_installdirs -p $(MODS_PKG)-$(KVER); \ + dh_installdocs -p $(MODS_PKG)-$(KVER); \ + dh_install -p $(MODS_PKG)-$(KVER); \ + dh_makeshlibs -p $(MODS_PKG)-$(KVER); \ + dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib; \ + dh_installchangelogs -p $(MODS_PKG)-$(KVER) lustre/ChangeLog; \ + dh_compress -p $(MODS_PKG)-$(KVER); \ + dh_installdeb -p $(MODS_PKG)-$(KVER); \ + dh_strip -p $(MODS_PKG)-$(KVER); \ + dh_fixperms -p $(MODS_PKG)-$(KVER); \ + dh_gencontrol -p $(MODS_PKG)-$(KVER); \ + dh_md5sums -p $(MODS_PKG)-$(KVER); \ + dh_builddeb -p $(MODS_PKG)-$(KVER); \ + fi + +### +### For module-assistant +### + +# the kdist_clean target is called by make-kpkg modules_clean and from +# kdist* rules. It is responsible for cleaning up any changes that have +# been made by the other kdist_commands (except for the .deb files created) + +kdist_clean: + # can't dh_clean here or we remove the build artifacts for the other packages + # still in progress + #dh_clean + #-$(MAKE) $(MFLAGS) -f debian/rules clean + # put the userspace tools' control file back + cp debian/control.main debian/control + + +# module assistant calculates all needed things for us and sets +# # following variables: +# # KSRC (kernel source directory), KVERS (kernel version string), KDREV +# # (revision of the Debian kernel-image package), CC (the correct +# # compiler), VERSION (the final package version string), PKGNAME (full +# # package name with KVERS included), DEB_DESTDIR (path to store DEBs) +# +# # The kdist_configure target is called by make-kpkg modules_config and +# # by kdist* rules by dependency. It should configure the module so it is +# # ready for compilation (mostly useful for calling configure). +# # prep-deb-files from module-assistant creates the neccessary debian/ +kdist_config: prep-deb-files patch-stamp + # Check build dependencies again, needs to be done since we just + # replaced the control file. + dpkg-checkbuilddeps + # Prepare the kernel to lustres' liking + # as non-root, we won't have permission for this + #-$(MAKE) -C $(KSRC) prepare scripts + # 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) \ + --disable-quilt \ + --disable-dependency-tracking \ + --disable-doc \ + --disable-utils \ + --disable-liblustre \ + --disable-snmp \ + --enable-ldiskfs \ + --disable-zerocopy \ + --disable-tests \ + --enable-quota + +kdist_configure: kdist_config + +# the binary-modules rule is invoked by module-assistant while processing the +# kdist* targets. It is called by module-assistant or make-kpkg and *not* +# during a normal build +binary-modules: prep-deb-files + dh_testroot + dh_clean -k + $(MAKE) + $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME) + # Remove stuff that doesn't belong (no module-only target) + cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr sbin etc + dh_installdocs -p$(PKGNAME) + dh_installchangelogs -p$(PKGNAME) + dh_installmodules -p $(PKGNAME) + dh_compress -p $(PKGNAME) + dh_fixperms -p $(PKGNAME) + dh_installdeb -p $(PKGNAME) + dh_gencontrol -- -v$(VERSION) + dh_md5sums -p $(PKGNAME) + dh_builddeb --destdir=$(DEB_DESTDIR) -p $(PKGNAME) + dh_clean -k -p $(PKGNAME) + +clean: + dh_testdir + dh_testroot + dpatch deapply-all + -$(MAKE) distclean + rm -rf debian/substvars debian/*.bak debian/*~ *~ *-stamp debian/$(PATCH_PKG) + ls -d debian/lustre-client-modules-* | grep -v _KVERS_ | xargs rm -f || true + # only remove this if the clean was not called from kdist_clean + if [ "$$MA_SOURCE_PKG" = "" ]; then \ + rm -rf debian/m-a_root; \ + fi + dh_clean + # make sure we have at least a basic control in place (see build-stamp) + rm -f debian/control + cp debian/control.main debian/control + +patch: patch-stamp +patch-stamp: + dpatch apply-all + touch $@ + +unpatch: + dpatch deapply-all + rm -rf debian/patched patch-stamp + +.PHONY: binary-arch clean source diff binary binary-indep binary-arch install configure -- 1.8.3.1