Whamcloud - gitweb
Branch b1_6
authorscjody <scjody>
Tue, 12 Jun 2007 22:00:37 +0000 (22:00 +0000)
committerscjody <scjody>
Tue, 12 Jun 2007 22:00:37 +0000 (22:00 +0000)
Move ldiskfs to its own package and CVS module.

b=12068
i=mjmac
i=brian

autoMakefile.am
build/Makefile.in.toplevel [deleted file]
build/autoMakefile.am
build/autoMakefile.toplevel.am [moved from build/autoMakefile.am.toplevel with 51% similarity]
build/autoconf/lustre-build-linux.m4
build/autoconf/lustre-build.m4
build/autogen.sh
build/buildcvs
build/lbuild
build/lmake
build/lustre.spec.in [deleted file]

index f31200a..d9d97dd 100644 (file)
@@ -1,4 +1,11 @@
-include build/autoMakefile.am.toplevel
+SUBDIRS := . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LDISKFS_SUBDIR@ lnet lustre
+DIST_SUBDIRS := @SNMP_DIST_SUBDIR@ libsysio ldiskfs lnet lustre
+SOURCES_SUBDIRS := @LDISKFS_SUBDIR@ lnet lustre
+RPM_SUBDIRS := @LDISKFS_SUBDIR@
+
+include build/autoMakefile.toplevel.am
+
+EXTRA_DIST += config.h.in
 
 CSTK=/tmp/checkstack
 CSTKO=/tmp/checkstack.orig
diff --git a/build/Makefile.in.toplevel b/build/Makefile.in.toplevel
deleted file mode 100644 (file)
index 3ae031d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-subdir-m += lnet
-subdir-m += lustre
-
-@INCLUDE_RULES@
index 2b1e1cb..7a4fc75 100644 (file)
@@ -1,7 +1,7 @@
-EXTRA_DIST := Makefile Makefile.in.toplevel                   \
-       autoMakefile.am.toplevel lbuild linux-merge-config.awk \
+EXTRA_DIST := Makefile                                         \
+       autoMakefile.toplevel.am lbuild linux-merge-config.awk \
        linux-merge-modules.awk linux-rhconfig.h lmake         \
-       lustre-kernel-2.4.spec.in lustre.spec lustre.spec      \
+       lustre-kernel-2.4.spec.in                              \
        suse-functions.sh suse-post.sh suse-postun.sh          \
        suse-trigger-script.sh.in README.kernel-source         \
        sles8-post.sh sles8-postun.sh sles8-pre.sh             \
@@ -9,10 +9,9 @@ EXTRA_DIST := Makefile Makefile.in.toplevel                   \
        sles8-update_rcfile_setting.sh                         \
        update_oldconfig
 
-CONFIG_CLEAN_FILES := lustre.spec
-
 MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ 
 
+# Override the default distclean, which removes Makefile
 distclean: distclean-recursive
        @true
 
similarity index 51%
rename from build/autoMakefile.am.toplevel
rename to build/autoMakefile.toplevel.am
index bcdd810..dd87f0e 100644 (file)
@@ -1,9 +1,7 @@
-AUTOMAKE_OPTIONS = foreign
-
-SUBDIRS := . build @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ lnet lustre
-DIST_SUBDIRS := build @SNMP_DIST_SUBDIR@ libsysio lnet lustre
+# This file is included by each package's toplevel autoMakefile[.am],
+# which must define SUBDIRS as a minimum.
 
-EXTRA_DIST := config.h.in
+AUTOMAKE_OPTIONS = foreign
 
 # these empty rules are needed so that automake doesn't add its own
 # recursive rules
@@ -27,9 +25,12 @@ tags:
        find $(top_srcdir) -name '*.[hc]' |grep -v linux-stage |xargs ctags $$CTAGSF -a
 
 if MODULES
+sources: all-sources
+
 all-sources:
-       $(MAKE) sources -C lnet
-       $(MAKE) sources -C lustre
+       for dir in $(SOURCES_SUBDIRS) ; do \
+               $(MAKE) sources -C $$dir ; \
+       done
 
 if LINUX
 all-am: modules
@@ -62,11 +63,36 @@ dist-hook:
                        -name .svn -o \
                        -name .#* | xargs rm -rf
 
-build/lustre.spec: build/lustre.spec.in config.status
-       ./config.status build/lustre.spec
-
-rpms: build/lustre.spec dist Makefile
+EXTRA_DIST = @PACKAGE_TARNAME@.spec                                    \
+       build/Makefile build/autoMakefile.toplevel.am build/lbuild      \
+       build/linux-merge-config.awk build/linux-merge-modules.awk      \
+       build/linux-rhconfig.h build/lmake build/Rules.in               \
+       build/lustre-kernel-2.4.spec.in build/suse-functions.sh         \
+       build/suse-post.sh build/suse-postun.sh                         \
+       build/suse-trigger-script.sh.in build/README.kernel-source      \
+       build/sles8-post.sh build/sles8-postun.sh build/sles8-pre.sh    \
+       build/sles8-update_INITRD_MODULES.sh                            \
+       build/sles8-update_rcfile_setting.sh build/update_oldconfig     \
+       build/autoconf/lustre-build-linux.m4                            \
+       build/autoconf/lustre-build.m4
+
+rpms-real: @PACKAGE_TARNAME@.spec dist Makefile
        rpmbuild -ta $(distdir).tar.gz
 
-srpm: build/lustre.spec dist Makefile
+srpm-real: @PACKAGE_TARNAME@.spec dist Makefile
        rpmbuild -ts $(distdir).tar.gz
+
+rpms:
+       for subdir in $(RPM_SUBDIRS) ; do                               \
+               echo "Making rpms in $$subdir";                         \
+               (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) rpms);          \
+       done;                                                           \
+       $(MAKE) $(AM_MAKEFLAGS) rpms-real
+
+srpm:
+       for subdir in $(RPM_SUBDIRS) ; do                               \
+               echo "Making srpm in $$subdir";                         \
+               (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) srpm);          \
+       done;                                                           \
+       $(MAKE) $(AM_MAKEFLAGS) srpm-real
+
index 84a1272..37ce1c4 100644 (file)
@@ -392,12 +392,6 @@ LB_LINUX_CONFIG([KMOD],[],[
 
 #LB_LINUX_CONFIG_BIG_STACK
 
-# LNet tests
-LN_PROG_LINUX
-
-# Lustre tests
-LC_PROG_LINUX
-
 ])
 
 #
index 4686de0..37634e2 100644 (file)
@@ -153,12 +153,69 @@ case x$with_sysio in
                ;;
 esac
 
-# We have to configure even if we don't build here for make dist to
-# work
+# We have to configure even if we don't build here for make dist to work
 AC_CONFIG_SUBDIRS(libsysio)
 ])
 
 #
+# LB_PATH_LDISKFS
+#
+# Handle internal/external ldiskfs
+#
+AC_DEFUN([LB_PATH_LDISKFS],
+[AC_ARG_WITH([ldiskfs],
+       AC_HELP_STRING([--with-ldiskfs=path],
+                       [set path to ldiskfs source (default is included ldiskfs)]),
+       [],[
+               if test x$linux25$enable_server = xyesyes ; then
+                       with_ldiskfs=yes
+               else
+                       with_ldiskfs=no
+               fi
+       ])
+AC_MSG_CHECKING([location of ldiskfs])
+case x$with_ldiskfs in
+       xyes)
+               AC_MSG_RESULT([internal])
+               LB_CHECK_FILE([$srcdir/ldiskfs/lustre-ldiskfs.spec.in],[],[
+                       AC_MSG_ERROR([A complete internal ldiskfs was not found.])
+               ])
+               LDISKFS_SUBDIR="ldiskfs"
+               LDISKFS_DIR="$PWD/ldiskfs"
+               ;;
+       xno)
+               AC_MSG_RESULT([disabled])
+               ;;
+       *)
+               AC_MSG_RESULT([$with_ldiskfs])
+               LB_CHECK_FILE([$with_ldiskfs/ldiskfs/linux/ldiskfs_fs.h],[],[
+                       AC_MSG_ERROR([A complete (built) external ldiskfs was not found.])
+               ])
+               LDISKFS_DIR=$with_ldiskfs
+               ;;
+esac
+AC_SUBST(LDISKFS_DIR)
+AC_SUBST(LDISKFS_SUBDIR)
+
+# We have to configure even if we don't build here for make dist to work
+AC_CONFIG_SUBDIRS(ldiskfs)
+])
+
+#
+# LB_DEFINE_LDISKFS_OPTIONS
+#
+# Enable config options related to ldiskfs.  These are used both by ldiskfs
+# and lvfs (which includes ldiskfs headers.)
+#
+AC_DEFUN([LB_DEFINE_LDISKFS_OPTIONS],
+[
+       AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
+       AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
+       AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls for ldiskfs])
+       AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security for ldiskfs])
+])
+
+#
 # LB_CONFIG_CRAY_XT3
 #
 # Enable Cray XT3 features
@@ -231,6 +288,8 @@ if test x$enable_modules = xyes ; then
        case $target_os in
                linux*)
                        LB_PROG_LINUX
+                       LN_PROG_LINUX
+                       LC_PROG_LINUX
                        ;;
                darwin*)
                        LB_PROG_DARWIN
@@ -339,7 +398,7 @@ AC_SUBST(EXTRA_KCFLAGS)
 # defines for including the toplevel Rules
 #
 AC_DEFUN([LB_INCLUDE_RULES],
-[INCLUDE_RULES="include $PWD/build/Rules"
+[INCLUDE_RULES="include $PWD/Rules"
 AC_SUBST(INCLUDE_RULES)
 ])
 
@@ -473,6 +532,22 @@ LC_CONDITIONALS
 ])
 
 #
+# LB_CONFIG_FILES
+#
+# build-specific config files
+#
+AC_DEFUN([LB_CONFIG_FILES],
+[
+AC_CONFIG_FILES(
+[Makefile
+autoMakefile
+]
+[Rules:build/Rules.in]
+AC_PACKAGE_TARNAME[.spec]
+)
+])
+
+#
 # LB_CONFIGURE
 #
 # main configure steps
@@ -488,9 +563,6 @@ LB_PATH_DEFAULTS
 
 LB_PROG_CC
 
-LB_PATH_LIBSYSIO
-LB_PATH_SNMP
-
 LB_CONFIG_DOCS
 LB_CONFIG_UTILS
 LB_CONFIG_TESTS
@@ -503,6 +575,10 @@ LN_CONFIG_CDEBUG
 
 LB_CONFIG_MODULES
 
+LB_PATH_LIBSYSIO
+LB_PATH_SNMP
+LB_PATH_LDISKFS
+
 LC_CONFIG_LIBLUSTRE
 LN_CONFIGURE
 
@@ -515,15 +591,7 @@ fi
 LB_CONDITIONALS
 LB_CONFIG_HEADERS
 
-AC_CONFIG_FILES(
-[Makefile:build/Makefile.in.toplevel]
-[autoMakefile
-build/autoMakefile
-build/autoconf/Makefile
-build/Rules
-build/lustre.spec
-])
-
+LB_CONFIG_FILES
 LN_CONFIG_FILES
 LC_CONFIG_FILES
 if test "$SNMP_DIST_SUBDIR" ; then
index 94e9ad3..49be95e 100644 (file)
@@ -78,8 +78,16 @@ check_version() {
 }
 
 echo "Checking for a complete tree..."
-# required directories
-for dir in build lnet lustre ; do
+if [ -d kernel_patches ] ; then
+    # This is ldiskfs
+    REQUIRED_DIRS="build"
+else
+    REQUIRED_DIRS="build lnet lustre"
+    OPTIONAL_DIRS="snmp portals"
+    CONFIGURE_DIRS="libsysio ldiskfs"
+fi
+
+for dir in $REQUIRED_DIRS ; do
     if [ ! -d "$dir" ] ; then
        cat >&2 <<EOF
 Your tree seems to be missing $dir.
@@ -89,8 +97,8 @@ EOF
     fi
     ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
 done
-# some are optional
-for dir in snmp portals; do
+# optional directories for Lustre
+for dir in $OPTIONAL_DIRS; do
     if [ -d "$dir" ] ; then
        ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
     fi
@@ -108,9 +116,12 @@ automake-1.7 -a -c
 echo "Running autoconf..."
 autoconf
 
-if [ -d libsysio ] ; then
-    pushd libsysio >/dev/null
-    echo "Running autogen for libsysio..."
-    sh autogen.sh
-    popd >/dev/null
-fi
+# Run autogen.sh in these directories
+for dir in $CONFIGURE_DIRS; do
+    if [ -d $dir ] ; then
+        pushd $dir >/dev/null
+        echo "Running autogen for $dir..."
+        sh autogen.sh
+        popd >/dev/null
+    fi
+done
index 43a2112..723d9e2 100644 (file)
@@ -4,6 +4,7 @@ portalstag=""
 lnettag="HEAD"
 libsysiotag="HEAD"
 snmptag="HEAD"
+ldiskfstag="HEAD"
 
 export LC_COLLATE=C
 
@@ -180,3 +181,6 @@ cvs_cmd portals portals "$portalstag"
 cvs_cmd lnet lnet "$lnettag"
 cvs_cmd snmp lustre-snmp "$snmptag"
 cvs_cmd lustre lustre-core "$lustretag"
+cvs_cmd ldiskfs ldiskfs "$ldiskfstag"
+
+[ -a ldiskfs/build ] || ln -sf ../build ldiskfs/build
index 7714d62..7e9c630 100755 (executable)
@@ -580,7 +580,7 @@ build_lustre()
 
     ./configure "--with-linux=${LINUX}" ${CONFIGURE_FLAGS}
 
-    $RPMBUILD $targets -bb build/lustre.spec \
+    $RPMBUILD $targets -bb lustre.spec \
         --define "_tmppath $TMPDIR" \
         --define "_topdir $TOPDIR" || \
         fatal 1 "Error building rpms for $BUILD_ARCHS."
index fd99ce8..9020cc1 100755 (executable)
@@ -512,9 +512,9 @@ build_lustre()
        -e s^@LINUXRELEASE@^${FULL_VERSION}^g \
        -e s^@RELEASE@^${FULL_VERSION//-/_}^g \
        -e s^@ac_configure_args@^"--with-linux=${PWD}/linux ${CONFIGURE_FLAGS}"^g \
-       < build/lustre.spec.in \
-       > build/lustre.spec
-    $RPMBUILD --target ${TARGET_ARCH} -bb build/lustre.spec \
+       < lustre.spec.in \
+       > lustre.spec
+    $RPMBUILD --target ${TARGET_ARCH} -bb lustre.spec \
         --define "_tmppath $TMPDIR" \
        --define "_topdir $(lbuild_topdir)" || \
        fatal 1 "Error building Lustre rpms."
diff --git a/build/lustre.spec.in b/build/lustre.spec.in
deleted file mode 100644 (file)
index 9d49616..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-# lustre.spec
-%define version @VERSION@
-%define kversion @LINUXRELEASE@
-
-Summary: Lustre File System
-Name: lustre
-Version: %{version}
-Release: @RELEASE@
-License: GPL
-Group: Utilities/System
-Source: lustre-%{version}.tar.gz
-URL: http://clusterfs.com/
-BuildRoot: %{_tmppath}/lustre-%{version}-root
-Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
-Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
-# GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
-
-%description
-Userspace tools and files for the Lustre file system.
-
-%package modules
-Summary: Kernel Lustre modules for Linux %{kversion}
-Requires: modutils >= 2.4.10
-Group: Development/Kernel
-
-%description modules
-Lustre file system, server and network drivers for Linux %{kversion}.
-
-%package source
-Summary: Object-Based Disk storage driver source
-Group: Development/Kernel
-
-%description source
-Lustre sources for further development
-
-# Since the RPMs we ship are to be used on both SLES and RHEL, we
-# can't include any dependency information (since the package names
-# are different on the two platforms).
-#
-# Instead, we can build these empty meta-packages that only include
-# dependency information.  These let people get the correct
-# dependencies for their platform and lets them use tools like yum and
-# red carpet to install the correct files.
-#
-# Unfortunately I have not seen this come up on the lists much, so I
-# have disabled them (by commenting out their empty files section
-# below) until it's clear that they resolve more confusion than they
-# add.
-
-%package deps-sles
-Summary: Lustre dependencies meta-package for SLES
-Group: Utilities/System
-Provides: lustre-deps = %{version}
-Requires: lustre = %{version}, sles-release
-Conflicts: lustre-deps-rhel
-
-%description deps-sles
-This package has RPM dependencies appropriate for SLES systems.
-
-%package deps-rhel
-Summary: Lustre dependencies meta-package for RHEL
-Group: Utilities/System
-Provides: lustre-deps = %{version}
-Requires: lustre = %{version}, redhat-release
-Conflicts: lustre-deps-sles
-
-%description deps-rhel
-This package has RPM dependencies appropriate for RHEL, RHL, and FC
-systems.
-
-%package tests
-Summary: Lustre testing framework
-Group: Development/Kernel
-Provides: lustre-tests = %{version}
-Requires: lustre = %{version}
-
-%description tests
-This package contains a set of test binaries and scripts that are intended
-to be used by the Lustre testing framework.
-
-%prep
-%setup -qn lustre-%{version}
-
-%build
-# if RPM_BUILD_NCPUS unset, set it
-if [ -z "$RPM_BUILD_NCPUS" ] ; then
-    RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
-    if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
-        RPM_BUILD_NCPUS=1
-    fi
-    if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
-        RPM_BUILD_NCPUS=8
-    fi
-fi
-
-rm -rf $RPM_BUILD_ROOT
-
-# Set an explicit path to our Linux tree, if we can.
-cd $RPM_BUILD_DIR/lustre-%{version}
-./configure @ac_configure_args@ %{?configure_flags:configure_flags} \
-       --sysconfdir=%{_sysconfdir} \
-       --mandir=%{_mandir} \
-       --libdir=%{_libdir}
-make -j $RPM_BUILD_NCPUS -s
-
-%install
-make install DESTDIR=$RPM_BUILD_ROOT
-# hack to avoid changing the libsysio code for "make install"
-rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
-
-# Create the pristine source directory.
-cd $RPM_BUILD_DIR/lustre-%{version}
-mkdir -p $RPM_BUILD_ROOT/usr/src
-rm -f lustre-source
-ln -s $RPM_BUILD_ROOT/usr/src lustre-source
-make distdir distdir=lustre-source/lustre-%{version}
-
-cat >lustre.files <<EOF
-%attr(-, root, root) /sbin/mount.lustre
-%attr(-, root, root) /usr/sbin/*
-%attr(-, root, root) /usr/bin/*
-
-%attr(-, root, root) /usr/share/lustre/*
-
-%attr(-, root, root) %{_libdir}/libptlctl.a
-%attr(-, root, root) %{_libdir}/liblustreapi.a
-%attr(-, root, root) /usr/include/lustre
-
-%attr(-, root, root) %{_mandir}/man?/*
-
-%attr(-, root, root) %{_libdir}/lustre/lc_common
-EOF
-
-if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
-  echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
-  echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
-fi
-
-if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/utils/libiam.c ] ; then
-  echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
-fi
-
-if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
-  echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
-  echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
-fi
-
-# Have universal lustre headers 
-if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
-  echo '%attr(-, root, root) /usr/include/lustre/lustre_idl.h' >>lustre.files
-  echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
-  echo '%attr(-, root, root) /usr/include/linux/lustre_user.h' >>lustre.files
-else
-  echo '%attr(-, root, root) /usr/include/linux/lustre_idl.h' >>lustre.files
-fi
-
-%files -f lustre.files
-
-%files modules
-%attr(-, root, root) %doc COPYING
-%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
-%attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
-
-%files source
-%attr(-, root, root) /usr/src/lustre-%{version}
-
-# uncomment these lines to enable deps packages
-# %files deps-sles
-# %files deps-rhel
-
-%files tests
-%attr(-, root, root) %{_libdir}/lustre/tests/*
-
-%post modules
-if [ -f /boot/System.map-%{kversion} ]; then
-       depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
-else
-       depmod -ae %{kversion} || exit 0
-fi
-
-# for update from < v1.4.6
-
-for f in /etc/modules.conf /etc/modprobe.conf /etc/modprobe.conf.local ; 
-do
-       if [ -f $f ]; then
-               if grep 'lustre llite' $f >/dev/null 2>/dev/null ; then
-                       [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
-                       TMPFILE=`mktemp $f.XXXXXX` && \
-                       rm -f $TMPFILE && touch $TMPFILE && \
-                       grep -v 'lustre llite' $f >> $TMPFILE && \
-                       mv $TMPFILE $f
-               fi
-               if egrep "^[^#]*(add below|install) ptlrpc" $f ; then
-                       [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
-                       TMPFILE=`mktemp $f.XXXXXX` && \
-                       rm -f $TMPFILE && touch $TMPFILE && \
-                       sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f >> $TMPFILE && \
-                       mv $TMPFILE $f
-               fi
-       fi
-done
-
-
-%postun modules
-if [ -f /boot/System.map-%{kversion} ]; then
-       depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
-else
-       depmod -ae %{kversion} || exit 0
-fi
-
-%clean
-rm -rf $RPM_BUILD_ROOT