From: Nathan Scott Date: Mon, 16 Jul 2001 07:33:50 +0000 (+0000) Subject: remove rules to tidy up tmp libtool files - we use the installed version now. X-Git-Tag: v2.0.0~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5dca43b4fb93f95941942b4a17a2c640a35bbd0;p=thirdparty%2Fxfsprogs-dev.git remove rules to tidy up tmp libtool files - we use the installed version now. --- diff --git a/Makefile b/Makefile index 3c66cc412..0b7cf24e4 100644 --- a/Makefile +++ b/Makefile @@ -38,13 +38,10 @@ include $(TOPDIR)/include/builddefs endif CONFIGURE = configure include/builddefs include/platform_defs.h - -LT_LSRCFILES = config.guess config.sub ltmain.sh ltconfig aclocal.m4 -LSRCFILES = configure configure.in Makepkgs install-sh README VERSION \ - $(LT_LSRCFILES) +LSRCFILES = configure configure.in Makepkgs install-sh README VERSION LDIRT = config.log config.status config.cache confdefs.h conftest* \ - Logs/* built .census install.* install-dev.* *.gz libtool + Logs/* built .census install.* install-dev.* *.gz SUBDIRS = include libxfs libhandle libdisk \ bmap db freeze fsck growfs logprint mkfile mkfs repair rtcp \ diff --git a/Makepkgs b/Makepkgs index 731cfb0ac..103c1f3f4 100755 --- a/Makepkgs +++ b/Makepkgs @@ -52,12 +52,12 @@ fi # build RPM packages - manual clean before starting echo "== clean, log is $LOGDIR/clean" if $verbose ; then - $MAKE clean 2>&1 | tee $LOGDIR/clean + $MAKE distclean 2>&1 | tee $LOGDIR/clean else - $MAKE clean > $LOGDIR/clean 2>&1 + $MAKE distclean > $LOGDIR/clean 2>&1 fi if [ $? -ne 0 ] ; then - echo \"$MAKE clean\" failed, see log in $LOGDIR/clean + echo \"$MAKE distclean\" failed, see log in $LOGDIR/clean tail $LOGDIR/clean exit 1 fi diff --git a/VERSION b/VERSION index caad6d580..e70cad31b 100644 --- a/VERSION +++ b/VERSION @@ -4,4 +4,4 @@ PKG_MAJOR=1 PKG_MINOR=3 PKG_REVISION=1 -PKG_BUILD=pre1 +PKG_BUILD=0 diff --git a/configure.in b/configure.in index e5a8af917..534ec7841 100644 --- a/configure.in +++ b/configure.in @@ -3,12 +3,6 @@ AC_INIT(include/libxfs.h) pkg_name="xfsprogs" AC_SUBST(pkg_name) -# For libtool -AC_PROG_LIBTOOL -AC_SUBST(LIBTOOL_DEPS) -AC_SUBST(enable_shared) - - # # Note: the following environment variables may be set to override the # defaults (to change paths and/or executables, build parameters, etc): @@ -108,6 +102,24 @@ test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo) echo=$ECHO AC_SUBST(echo) +dnl ensure libtool is installed +AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin) +if test "$LIBTOOL" = ""; then + echo + echo 'FATAL ERROR: libtool does not seem to be installed.' + echo $pkg_name cannot be built without a working libtool installation. + exit 1 +fi +libtool=$LIBTOOL +AC_SUBST(libtool) + +dnl libtool to build libraries static only? +AC_ARG_ENABLE(enable_shared, + [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes].], + , + enable_shared=yes) +AC_SUBST(enable_shared) + dnl Checks for UUID header and library. AC_CHECK_HEADER(uuid/uuid.h,, [ echo @@ -251,14 +263,6 @@ dnl dnl output files dnl -#For libtool, from section 5.4.2 of the libtool manual. Just in -# case we ever need them. -LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'` -AC_SUBST(LTLIBOBJS) -LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'` -AC_SUBST(LTALLOCA) - - AC_OUTPUT( \ dnl Build definitions for use in Makefiles include/builddefs \ diff --git a/debian/Makefile b/debian/Makefile index 59870426b..f5faadd10 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -34,7 +34,18 @@ TOPDIR = .. include $(TOPDIR)/include/builddefs LSRCFILES = changelog control copyright rules +DEV_DOC_DIR = $(PKG_DOC_DIR)/../xfslibs-dev -default install install-dev: +default: include $(BUILDRULES) + +install: default + $(INSTALL) -m 755 -d $(PKG_DOC_DIR) + $(INSTALL) -m 644 changelog $(PKG_DOC_DIR)/changelog.Debian + +install-dev: default + $(INSTALL) -m 755 -d $(PKG_DOC_DIR) + $(INSTALL) -m 755 -d $(DEV_DOC_DIR) + $(INSTALL) -m 644 copyright $(DEV_DOC_DIR) + $(INSTALL) -m 644 changelog $(DEV_DOC_DIR)/changelog.Debian diff --git a/debian/changelog b/debian/changelog index 9370fa066..5cdb55352 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +xfsprogs (1.3.1-0) unstable; urgency=low + + * Reworked package slightly so that its not Debian native + * Debian-specific changes now documented in changelog.Debian.gz + * New upstream release (see /usr/share/doc/xfsprogs/changelog.gz) + + -- Nathan Scott Sat, 15 Jul 2001 16:34:43 +1000 + xfsprogs (1.3.0) unstable; urgency=low * Reworked Makefiles to use libtool diff --git a/debian/rules b/debian/rules index 1c0a72cc4..676dacecb 100755 --- a/debian/rules +++ b/debian/rules @@ -44,13 +44,10 @@ binary-arch: checkroot built $(pkgtmp) $(MAKE) -C . install $(pkgdev) $(MAKE) -C . install-dev $(pkgtmp) $(MAKE) -C build src-manifest - $(pkgdev) ./install-sh -m 755 -d $(doctmp) - $(pkgdev) ./install-sh -m 755 -d $(docdev) - $(pkgdev) ./install-sh -m 644 debian/copyright $(docdev) - $(pkgdev) ./install-sh -m 644 debian/changelog $(docdev) @echo "== dpkg-buildpackage: debstd" 1>&2 - # dev pkg with .so symlinks to base pkg confuses debstd... - $(stdenv) debstd -m | grep -v 'Dangling symlink' + # Note: dev pkg with .so symlinks to base pkg confuses debstd; + # so the .so 'Dangling symlink' message below is benign. + $(stdenv) debstd -m dpkg-gencontrol -isp -p$(package) -P$(dirtmp) dpkg-gencontrol -isp -p$(develop) -P$(dirdev) chown -R root.root $(dirtmp) $(dirdev) diff --git a/doc/CHANGES b/doc/CHANGES index ef4cd1a33..2871928a8 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,6 +1,12 @@ -xfsprogs-1.3.1 (12 Jul 2001) +xfsprogs-1.3.1 (15 Jul 2001) - updated xfs_types.h file from the kernel changes needed for an xfsdump fix. + - tidy up various aspects of the libtool rework + - XVM stripe unit/width extraction + - fix an endian bug in xfs_db "write" command + - fix a build problem with liblvm.a installed + - fix bug in xfs_growfs mount option parsing with external log + - make use of BLKSZSET ioctl conditional via the Makefile xfsprogs-1.3.0 (11 Jul 2001) - reworked Makefiles to use libtool diff --git a/doc/Makefile b/doc/Makefile index 0e09ea786..aa90960cf 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -46,8 +46,11 @@ CHANGES.gz: install: default $(INSTALL) -m 755 -d $(PKG_DOC_DIR) -ifneq ($(PKG_DISTRIBUTION), debian) + $(INSTALL) -m 644 PORTING CHANGES.gz CREDITS $(README) $(PKG_DOC_DIR) +ifeq ($(PKG_DISTRIBUTION), debian) + $(INSTALL) -S CHANGES.gz $(PKG_DOC_DIR)/changelog.gz +else $(INSTALL) -m 644 COPYING $(PKG_DOC_DIR) endif - $(INSTALL) -m 644 PORTING CHANGES.gz CREDITS $(README) $(PKG_DOC_DIR) + install-dev: diff --git a/include/builddefs.in b/include/builddefs.in index 00bfc649d..56502c491 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -77,7 +77,6 @@ HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@ MAKEDEPEND = @makedepend@ LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ ENABLE_SHARED = @enable_shared@ # diff --git a/include/volume.h b/include/volume.h index eef504147..de532c47d 100644 --- a/include/volume.h +++ b/include/volume.h @@ -61,5 +61,6 @@ typedef enum sv_type_e { } sv_type_t; extern void get_subvol_stripe_wrapper (char *, sv_type_t, int *, int *); +extern int get_driver_block_major (const char *); #endif /* __VOLUME_H__ */ diff --git a/libdisk/drivers.c b/libdisk/drivers.c index 791809e92..06f290c82 100644 --- a/libdisk/drivers.c +++ b/libdisk/drivers.c @@ -61,3 +61,29 @@ get_subvol_stripe_wrapper(char *dev, sv_type_t type, int *sunit, int *swidth) return; /* ... add new device drivers here */ } + +/* + * General purpose routine which dredges through procfs trying to + * match up device driver names with the associated major numbers + * being used in the running kernel. + */ +int +get_driver_block_major(const char *driver) +{ + FILE *f; + char buf[64], puf[64]; + int major = -1; + +#define PROC_DEVICES "/proc/devices" + if ((f = fopen(PROC_DEVICES, "r")) == NULL) + return major; + while (fgets(buf, sizeof(buf), f)) /* skip to block dev section */ + if (strcmp("Block devices:\n", buf) == 0) + break; + while (fgets(buf, sizeof(buf), f)) + if ((sscanf(buf, "%u %s\n", &major, puf) == 2) && + (strcmp(puf, driver) == 0)) + break; + fclose(f); + return major; +} diff --git a/libdisk/lvm.c b/libdisk/lvm.c index 12b10d869..f419000a5 100644 --- a/libdisk/lvm.c +++ b/libdisk/lvm.c @@ -35,13 +35,20 @@ #include #include -#if HAVE_LIBLVM - #include "lvm_user.h" +#include "lvm_user.h" +#if HAVE_LIBLVM char *cmd; /* Not used. liblvm is broken */ int opt_d; /* Same thing */ #endif +int +mnt_is_lvm_subvol(dev_t dev) +{ + if (dev >> 8 == LVM_BLK_MAJOR) + return 1; + return 0; +} int lvm_get_subvol_stripe( @@ -52,7 +59,7 @@ lvm_get_subvol_stripe( struct stat64 *sb) { #if HAVE_LIBLVM - if (sb->st_rdev >> 8 == LVM_BLK_MAJOR) { + if (mnt_is_lvm_subvol(sb->st_rdev)) { lv_t *lv; char *vgname; diff --git a/libdisk/md.c b/libdisk/md.c index 7e7a2981f..12e596d61 100644 --- a/libdisk/md.c +++ b/libdisk/md.c @@ -36,6 +36,14 @@ #include #include "md.h" +int +mnt_is_md_subvol(dev_t dev) +{ + if (dev >> 8 == MD_MAJOR) + return 1; + return 0; +} + int md_get_subvol_stripe( char *dfile, @@ -44,7 +52,7 @@ md_get_subvol_stripe( int *swidth, struct stat64 *sb) { - if (sb->st_rdev >> 8 == MD_MAJOR) { + if (mnt_is_md_subvol(sb->st_rdev)) { struct md_array_info_s md; int fd; diff --git a/libdisk/xvm.c b/libdisk/xvm.c index 6891811f4..f53df83e0 100644 --- a/libdisk/xvm.c +++ b/libdisk/xvm.c @@ -38,10 +38,11 @@ #include #include "xvm.h" -static int +int mnt_is_xvm_subvol(dev_t dev) { - /* TODO - DeanJ? - for now, always return false */ + if (major(dev) == get_driver_block_major("xvm")) + return 1; return 0; } @@ -62,10 +63,43 @@ xvm_get_subvol_stripe( int *swidth, struct stat64 *sb) { - if (!mnt_is_xvm_subvol(sb->st_dev)) + int fd; + xvm_getdev_t getdev; + xvm_subvol_stripe_t subvol_stripe; + + if (!mnt_is_xvm_subvol(sb->st_rdev)) return 0; - /* TODO - DeanJ? - for now, always return false */ + /* + * This will actually open the data subvolume. + */ + if ((fd = open(dev, O_RDONLY)) < 0) + return 0; - return 0; + /* + * Go and get the the information for the correct + * subvolume. + */ + if (ioctl(fd, DIOCGETVOLDEV, &getdev) < 0) { + close(fd); + return 0; + } + if ( (type == SVTYPE_RT) && (getdev.rt_subvol_dev) ) + subvol_stripe.dev = getdev.rt_subvol_dev; + else if ( (type == SVTYPE_DATA) && (getdev.data_subvol_dev) ) + subvol_stripe.dev = getdev.data_subvol_dev; + else { + close(fd); + return 0; + } + + if (ioctl(fd, DIOCGETVOLSTRIPE, &subvol_stripe) < 0) { + close(fd); + return 0; + } + + *sunit = subvol_stripe.unit_size; + *swidth = *sunit * subvol_stripe.width_size; + close(fd); + return 1; } diff --git a/libdisk/xvm.h b/libdisk/xvm.h index e0f0281f2..db4f15cd7 100644 --- a/libdisk/xvm.h +++ b/libdisk/xvm.h @@ -30,9 +30,36 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ +#define _DIOC_(x) (('d'<<8) | x) +#define DIOCGETVOLDEV _DIOC_(36) /* subvolume devices */ +#define DIOCGETVOLSTRIPE _DIOC_(47) /* subvolume stripe info */ + /* - * Header for XVM support in libdisk + * Structure returned by the DIOCGETVOLDEV ioctl to list the + * subvolume device nodes in a volume. These are external device + * numbers. */ +#define XVM_GETDEV_VERS 1 +typedef struct { + __uint32_t version; + dev_t data_subvol_dev; + + dev_t log_subvol_dev; + dev_t rt_subvol_dev; + + dev_t sp_subvol_dev; +} xvm_getdev_t; - /* TODO - DeanJ? - empty for now */ +/* + * Structure returned by the DIOCGETVOLSTRIPE ioctl to describe + * the subvolume stripe units and width. + */ +#define XVM_SUBVOL_GEOMETRY_VERS 1 +typedef struct xvm_subvol_stripe_s { + __uint32_t version; + __uint32_t unit_size; /* in blocks */ + __uint32_t width_size; /* in blocks */ + __uint32_t pad1; /* padding */ + dev_t dev; +} xvm_subvol_stripe_t; diff --git a/libxfs/Makefile b/libxfs/Makefile index e1cbf3bec..d38da1007 100644 --- a/libxfs/Makefile +++ b/libxfs/Makefile @@ -46,6 +46,7 @@ CFILES = init.c logitem.c rdwr.c trans.c util.c \ xfs_dir2.c xfs_dir2_leaf.c xfs_attr_leaf.c xfs_dir2_block.c \ xfs_dir2_node.c xfs_dir2_data.c xfs_dir2_sf.c xfs_bmap.c \ xfs_mount.c xfs_trans.c +LCFLAGS += -DHAVE_BLKBSZSET=1 # # Tracing flags: diff --git a/libxfs/init.c b/libxfs/init.c index 1c0ea142b..84dcd26f6 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -39,10 +39,6 @@ #include #include -#ifndef BLKBSZSET -#define BLKBSZSET _IO(0x12,110) /* set device block size */ -#endif - #define findrawpath(x) x #define findblockpath(x) x @@ -194,7 +190,6 @@ libxfs_device_open(char *path, int creat, int readonly, int setblksize) dev_t dev; int d; struct stat statb; - int blocksize = 512; /* bytes */ if ((fd = open(path, (readonly ? O_RDONLY : O_RDWR) | @@ -211,14 +206,25 @@ libxfs_device_open(char *path, int creat, int readonly, int setblksize) exit(1); } - /* Set device blocksize to 512 bytes */ +#ifdef HAVE_BLKBSZSET + /* + * Set device blocksize to 512 bytes + * + * See bug #801063, but we no longer have this ioctl in the kernel - + * it will be needed again though when the fs blocksize != pagesize. + */ +#ifndef BLKBSZSET +#define BLKBSZSET _IO(0x12,110) /* set device block size */ +#endif if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) { + int blocksize = 512; /* bytes */ if (ioctl(fd, BLKBSZSET, &blocksize) < 0) { fprintf(stderr, "%s: warning - cannot set blocksize on " "block device %s: %s\n", progname, path, strerror(errno)); } } +#endif /* get the device number from the stat buf - unless * we're not opening a real device, in which case