]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
incorporate Martin's changes to rework the LVM support in mkfs.
authorNathan Scott <nathans@sgi.com>
Wed, 19 Sep 2001 05:03:59 +0000 (05:03 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 19 Sep 2001 05:03:59 +0000 (05:03 +0000)
VERSION
configure.in
debian/Makefile
debian/changelog
doc/CHANGES
include/builddefs.in
libdisk/Makefile
libdisk/drivers.c
libdisk/lvm.c
mkfs/Makefile

diff --git a/VERSION b/VERSION
index 9a8caf3c1d060da361c9a051632039868e8c262b..5730efafd7ceb12afa8d3305864097fb7b4800d0 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=1
 PKG_MINOR=3
-PKG_REVISION=7
+PKG_REVISION=8
 PKG_BUILD=0
index ecf1cbec711d5c5c90a4669b7bc552ceb524bad3..868043049e1a8aa7448bfebca8a18e6e0d92dcbe 100644 (file)
@@ -148,25 +148,6 @@ AC_ARG_ENABLE(shared-uuid,
        libuuid="/usr/lib/libuuid.a")
 AC_SUBST(libuuid)
 
-dnl Note - the plan is for liblvm to go away soon...
-dnl Checks for LVM library
-AC_MSG_CHECKING([for liblvm.a])
-liblvm=""
-for dir in /usr/local/lib /usr/lib /lib; do
-        if test -f $dir/liblvm.a; then
-                liblvm=$dir/liblvm.a
-        fi
-done
-if test -n "$liblvm"; then
-       AC_MSG_RESULT(yes)
-        have_liblvm=1
-else
-       AC_MSG_RESULT(no)
-        have_liblvm=0
-fi
-AC_SUBST(liblvm) 
-AC_SUBST(have_liblvm) 
-
 dnl Check if we have a type for the pointer's size integer (__psint_t)
 AC_MSG_CHECKING([for __psint_t ])
 AC_TRY_COMPILE(
index 54b049b200d8a44513eee53ed6eebd6ec1888706..373bb980a41bcb86444c734ae87bc152bd3b6021 100644 (file)
@@ -38,7 +38,7 @@ DEV_DOC_DIR = $(PKG_DOC_DIR)/../xfslibs-dev
 BOOT_DOC_DIR = $(PKG_DOC_DIR)/../xfsprogs-bf
 BOOT_MAN_DIR = $(PKG_MAN_DIR)/man8
 BOOT_MKFS_BIN = $(TOPDIR)/mkfs/mkfs.xfs-xfsprogs-bf
-BOOT_MKFS_MAN = $(TOPDIR)/man/man8/mkfs.xfs.8.gz
+BOOT_MKFS_MAN = $(TOPDIR)/man/man8/mkfs.xfs.8
 
 default:
 
@@ -67,5 +67,5 @@ ifeq ($(PKG_DISTRIBUTION), debian)
        $(INSTALL) -m 644 copyright $(BOOT_DOC_DIR)
        $(INSTALL) -m 644 changelog $(BOOT_DOC_DIR)/changelog.Debian
        $(INSTALL) -m 755 $(BOOT_MKFS_BIN) $(PKG_SBIN_DIR)/mkfs.xfs
-       $(INSTALL) -m 644 $(BOOT_MKFS_MAN) $(BOOT_MAN_DIR)/mkfs.xfs.8.gz
+       $(INSTALL) -m 644 $(BOOT_MKFS_MAN) $(BOOT_MAN_DIR)/mkfs.xfs.8
 endif
index 1f4351b9c717db335b2edc790fcdef99ea450ed0..63e73d9826d37542bf1b27004442fa94e0365949 100644 (file)
@@ -1,3 +1,10 @@
+xfsprogs (1.3.8-0) unstable; urgency=low
+
+  * New upstream release
+  * Fix inclusion of mkfs man page in boot floppies package (closes: #112634)
+
+ -- Nathan Scott <nathans@debian.org>  Wed, 19 Sep 2001 14:49:30 +1000
+
 xfsprogs (1.3.7-0) unstable; urgency=low
 
   * New upstream release
index ca20b4695035f877ca17749d63f1d1c276c5811c..64b436e547b5d13af5c7e3506fa762a1eb5be4a5 100644 (file)
@@ -1,3 +1,10 @@
+xfsprogs-1.3.8 (19 September 2001)
+       - rewrote the LVM support used by mkfs.xfs to call external
+         lvdisplay program to get volume geometry (mkp@mkp.net)
+       - fix bug in LVM driver wrapper where it would not have been
+         used at all, ever (since 1.3.0), due to idiot programmer
+         error (*blush*) -- also thanks to mkp for the bug fix
+
 xfsprogs-1.3.7 (10 September 2001)
        - enable preallocation in xfs_mkfile [missed during port?]
        - fix xfs_db core dump when reporting freespace
index 6e6f7d1f88ec8ba02d344a617e1c3eaed9525b25..eac435946881400c14504fd90e96d1dad4b5f8b3 100644 (file)
@@ -44,8 +44,6 @@ LIBXFS = $(TOPDIR)/libxfs/libxfs.la
 LIBDISK = $(TOPDIR)/libdisk/libdisk.la
 LIBHANDLE = $(TOPDIR)/libhandle/libhandle.la
 
-LIBLVM = @liblvm@
-USELVM = -DHAVE_LIBLVM=@have_liblvm@
 DK_INC_DIR = @dk_inc_dir@
 
 PKG_NAME = @pkg_name@
index 0a4ee8c2bc0937a55da6f7b8126f1a88e59e7153..3617278e8d9bf55e7d43ccb1c7e8a6d09469a495 100644 (file)
@@ -38,9 +38,8 @@ LT_CURRENT = 0
 LT_REVISION = 0
 LT_AGE = 0
 
-LCFLAGS = $(USELVM)
 CFILES = fstype.c pttype.c md.c xvm.c lvm.c drivers.c mountinfo.c
-HFILES = fstype.h pttype.h md.h xvm.h lvm.h lvm_user.h liblvm.h
+HFILES = fstype.h pttype.h md.h xvm.h
 
 default: $(LTLIBRARY)
 
index 6e56c9c6639cd7e3af531443142ba0ff2ded1cf1..e14ae72c3d5f4bdadcbde7ab54f4791dd6ccb628 100644 (file)
@@ -54,11 +54,11 @@ get_subvol_stripe_wrapper(char *dev, sv_type_t type, int *sunit, int *swidth)
                exit(1);
        }
 
-       if ( md_get_subvol_stripe(dev, type, sunit, swidth, &sb));
+       if ( md_get_subvol_stripe(dev, type, sunit, swidth, &sb))
                return;
-       if (lvm_get_subvol_stripe(dev, type, sunit, swidth, &sb));
+       if (lvm_get_subvol_stripe(dev, type, sunit, swidth, &sb))
                return;
-       if (xvm_get_subvol_stripe(dev, type, sunit, swidth, &sb));
+       if (xvm_get_subvol_stripe(dev, type, sunit, swidth, &sb))
                return;
        /* ... add new device drivers here */
 }
index f419000a5a61935c0718355630f1826579ff8f8d..590b03086105ceffd21fca6255804ec4d9e116fa 100644 (file)
 
 #include <stdio.h>
 #include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+#include <linux/major.h>
 #include <volume.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)
 {
@@ -58,45 +56,75 @@ lvm_get_subvol_stripe(
        int             *swidth,
        struct stat64   *sb)
 {
-#if HAVE_LIBLVM
-       if (mnt_is_lvm_subvol(sb->st_rdev)) {
-               lv_t    *lv;
-               char    *vgname;
-
-               /* Find volume group */
-               if (! (vgname = vg_name_of_lv(dfile))) {
-                       fprintf(stderr, "Can't find volume group for %s\n", 
-                               dfile);
-                       exit(1);
-               }
-               
-               /* Logical volume */
-               if (! lvm_tab_lv_check_exist(dfile)) {
-                       fprintf(stderr, "Logical volume %s doesn't exist!\n",
-                               dfile);
-                       exit(1);
-               }
-               
-               /* Get status */
-               if (lv_status_byname(vgname, dfile, &lv) < 0 || lv == NULL) {
-                       fprintf(stderr, "Could not get status info from %s\n",
-                               dfile);
-                       exit(1);
-               }
-               
-               /* Check that data is consistent */
-               if (lv_check_consistency(lv) < 0) {
-                       fprintf(stderr, "Logical volume %s is inconsistent\n",
-                               dfile);
-                       exit(1);
-               }
-               
-               /* Update sizes */
-               *sunit = lv->lv_stripesize;
-               *swidth = lv->lv_stripes * lv->lv_stripesize;
-               
-               return 1;
+       int             lvpipe[2], stripes = 0, stripesize = 0;
+       char            *largv[3], buf[1024];
+       FILE            *stream;
+
+       if (!mnt_is_lvm_subvol(sb->st_rdev))
+               return 0;
+
+       /* Quest for lvdisplay */
+       if (!access("/usr/local/sbin/lvdisplay", R_OK|X_OK))
+               largv[0] = "/usr/local/sbin/lvdisplay";
+       else if (!access("/usr/sbin/lvdisplay", R_OK|X_OK))
+               largv[0] = "/usr/sbin/lvdisplay";
+       else if (!access("/sbin/lvdisplay", R_OK|X_OK))
+               largv[0] = "/sbin/lvdisplay";
+       else {
+               fprintf(stderr,
+                       "Warning - LVM device, but no lvdisplay(8) found\n");
+               return 0;
        }
-#endif /* HAVE_LIBLVM */
-       return 0;
+
+       largv[1] = dfile;
+       largv[2] = NULL;
+
+       /* Open pipe */
+       if (pipe(lvpipe) < 0) {
+               fprintf(stderr, "Could not open pipe\n");
+               exit(1);
+       }
+
+       /* Spawn lvdisplay */
+       switch (fork()) {
+       case 0:
+               /* Plumbing */
+               close(lvpipe[0]);
+
+               if (lvpipe[1] != STDOUT_FILENO)
+                       dup2(lvpipe[1], STDOUT_FILENO);
+
+               execv(largv[0], largv);
+
+               fprintf(stderr, "\nFailed to execute %s\n", largv[0]);
+               exit(1);
+
+       case -1:
+               fprintf(stderr, "Failed forking lvdisplay process\n");
+               exit(1);
+
+       default:
+               break;
+       }
+
+       close(lvpipe[1]);
+       stream = fdopen(lvpipe[0], "r");
+
+       /* Scan stream for keywords */
+       while (fgets(buf, 1023, stream) != NULL) {
+
+               if (!strncmp(buf, "Stripes", 7))
+                       sscanf(buf, "Stripes %d", &stripes);
+
+               if (!strncmp(buf, "Stripe size", 11))
+                       sscanf(buf, "Stripe size (KByte) %d", &stripesize);
+       }
+
+       /* Update sizes */
+       *sunit = stripesize << 1;
+       *swidth = (stripes * stripesize) << 1;
+
+       fclose(stream);
+
+       return 1;
 }
index aecbd837417be2a4035ae33856d3b809451450bd..5b50ff068f3bdc8ec0d221ce6584e3280f96ac97 100644 (file)
@@ -40,10 +40,7 @@ FSTYP = fstyp
 HFILES = xfs_mkfs.h proto.h
 CFILES = $(HFILES:.h=.c)
 
-# Note: ordering for libdisk and liblvm is important - we must
-# now present liblvm to ld twice :( -> libdisk works around the
-# liblvm unresolved symbol problem, but also calls into liblvm.
-LLDLIBS = $(LIBXFS) $(LIBUUID) $(LIBLVM) $(LIBDISK) $(LIBLVM)
+LLDLIBS = $(LIBXFS) $(LIBUUID) $(LIBDISK)
 LTDEPENDENCIES = $(LIBXFS) $(LIBDISK)
 LLDFLAGS = -static