2009-02-23 17:39:38

by Karel Zak

[permalink] [raw]
Subject: uti-linux-ng libblkid

Hi Ted,

here are two patches that allow to link utils from e2fsprogs with
external libblkid (e.g. the version from util-linux-ng).

Note that the patches don't include *generated* stuff from the configure
script.

Changes:
- add --disable-libblkid
- don't build & install blkid(8) and findfs(8)

Note that I'm not sure of your opinion about "#include blkid.h". The
code in e2fsprogs mix "blkid/blkid.h" and "blkid.h" (and somewhere it
depends on #ifdef :-). I think the best would be to remove the directory
and use "-Ilib/blkid" (for private libblkid) or CFLAGS from pkg-config
(for external libblkid). Anyway the code compiles with the current
"#include" directives, so I didn't touch this stuff.

Karel




2009-02-23 17:39:41

by Karel Zak

[permalink] [raw]
Subject: [PATCH] blkid: add --disable-libblkid to build with external libblkid

This patch allows to switch between private (in-tree) libblkid and
public (in-system installed) library. The private version is still
enabled by default.

Signed-off-by: Karel Zak <[email protected]>
---
MCONFIG.in | 28 ++++++++++++++++++++++------
Makefile.in | 3 ++-
configure.in | 30 ++++++++++++++++++++++++++++++
misc/Makefile.in | 20 ++++++++++++++------
4 files changed, 68 insertions(+), 13 deletions(-)

diff --git a/MCONFIG.in b/MCONFIG.in
index f67682e..c7c16bf 100644
--- a/MCONFIG.in
+++ b/MCONFIG.in
@@ -69,36 +69,52 @@ MKINSTALLDIRS = @MKINSTALLDIRS@
#
# Library definitions
#
+@BLKID_CMT@PRIVATE_LIBBLKID = yes
+
+# public libblkid options
+BLKID_LIBS = @BLKID_LIBS@
+STATIC_BLKID_LIBS = @STATIC_BLKID_LIBS@
+
+ifdef PRIVATE_LIBBLKID
+LIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
+DEPLIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
+STATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@ $(STATIC_LIBUUID)
+DEPSTATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@
+PROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@ $(PROFILED_LIBUUID)
+DEPPROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@
+else
+LIBBLKID = $(BLKID_LIBS) @PRIVATE_LIBS_CMT@ $(LIBUUID)
+DEPLIBBLKID = $(BLKID_LIBS) @PRIVATE_LIBS_CMT@ $(LIBUUID)
+STATIC_LIBBLKID = $(STATIC_BLKID_LIBS) $(STATIC_LIBUUID)
+DEPSTATIC_LIBBLKID = $(STATIC_BLKID_LIBS)
+PROFILED_LIBBLKID = $(BLKID_LIBS) $(PROFILED_LIBUUID)
+DEPPROFILED_LIBBLKID = $(BLKID_LIBS)
+endif
+
LIB = $(top_builddir)/lib
LIBSS = $(LIB)/libss@LIB_EXT@ @PRIVATE_LIBS_CMT@ @DLOPEN_LIB@
LIBCOM_ERR = $(LIB)/libcom_err@LIB_EXT@ @PRIVATE_LIBS_CMT@ @SEM_INIT_LIB@
LIBE2P = $(LIB)/libe2p@LIB_EXT@
LIBEXT2FS = $(LIB)/libext2fs@LIB_EXT@
LIBUUID = $(LIB)/libuuid@LIB_EXT@ @SOCKET_LIB@
-LIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
LIBINTL = @LIBINTL@
DEPLIBSS = $(LIB)/libss@LIB_EXT@
DEPLIBUUID = $(LIB)/libuuid@LIB_EXT@
-DEPLIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)

STATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@ @DLOPEN_LIB@
STATIC_LIBCOM_ERR = $(LIB)/libcom_err@STATIC_LIB_EXT@ @SEM_INIT_LIB@
STATIC_LIBE2P = $(LIB)/libe2p@STATIC_LIB_EXT@
STATIC_LIBEXT2FS = $(LIB)/libext2fs@STATIC_LIB_EXT@
STATIC_LIBUUID = $(LIB)/libuuid@STATIC_LIB_EXT@ @SOCKET_LIB@
-STATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@ $(STATIC_LIBUUID)
DEPSTATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@
DEPSTATIC_LIBUUID = $(LIB)/libuuid@STATIC_LIB_EXT@
-DEPSTATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@

PROFILED_LIBSS = $(LIB)/libss@PROFILED_LIB_EXT@ @DLOPEN_LIB@
PROFILED_LIBCOM_ERR = $(LIB)/libcom_err@PROFILED_LIB_EXT@ @SEM_INIT_LIB@
PROFILED_LIBE2P = $(LIB)/libe2p@PROFILED_LIB_EXT@
PROFILED_LIBEXT2FS = $(LIB)/libext2fs@PROFILED_LIB_EXT@
PROFILED_LIBUUID = $(LIB)/libuuid@PROFILED_LIB_EXT@ @SOCKET_LIB@
-PROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@ $(PROFILED_LIBUUID)
DEPPROFILED_LIBUUID = $(LIB)/libuuid@PROFILED_LIB_EXT@
-DEPPROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@

# An include directive pointing to a directory holding enough linux-like
# include files to satisfy some programs here
diff --git a/Makefile.in b/Makefile.in
index 728d3a5..1f1b8ea 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -11,8 +11,9 @@ INSTALL = @INSTALL@

@RESIZER_CMT@RESIZE_DIR= resize
@DEBUGFS_CMT@DEBUGFS_DIR= debugfs
+@BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid

-LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs lib/blkid intl
+LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs $(BLKID_LIB_SUBDIR) intl
PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests

diff --git a/configure.in b/configure.in
index 2534df4..83ab14d 100644
--- a/configure.in
+++ b/configure.in
@@ -276,6 +276,36 @@ AC_MSG_RESULT([Disabling BSD shared libraries by default])
AC_SUBST(BSDLIB_CMT)
AC_SUBST_FILE(MAKEFILE_BSDLIB)
dnl
+dnl handle --disable-libblkid
+dnl
+PKG_PROG_PKG_CONFIG
+AC_ARG_ENABLE([libblkid],
+[ --disable-libblkid do not build private blkid library],
+if test "$enableval" = "no"
+then
+ if test -z "$PKG_CONFIG"; then
+ AC_MSG_ERROR([pkg-config not installed; please install it.])
+ fi
+
+ AC_CHECK_LIB(blkid, blkid_get_cache,
+ [BLKID_LIBS=`$PKG_CONFIG --libs blkid`;
+ STATIC_BLKID_LIBS=`$PKG_CONFIG --static --libs blkid`],
+ [AC_MSG_ERROR([external blkid library not found])],
+ [$BLKID_LIBS])
+ BLKID_CMT=#
+ AC_MSG_RESULT([Disabling private blkid library])
+else
+ BLKID_CMT=
+ AC_MSG_RESULT([Enabling private blkid library])
+fi
+,
+BLKID_CMT=
+AC_MSG_RESULT([Enabling private blkid library by default])
+)
+AC_SUBST(BLKID_CMT)
+AC_SUBST(BLKID_LIBS)
+AC_SUBST(STATIC_BLKID_LIBS)
+dnl
dnl handle --enable-profile
dnl
AC_ARG_ENABLE([profile],
diff --git a/misc/Makefile.in b/misc/Makefile.in
index e35bb8f..defec7d 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -17,11 +17,17 @@ INSTALL = @INSTALL@
@UUIDD_CMT@UUIDD_PROG= uuidd
@UUIDD_CMT@UUIDD_MAN= uuidd.8

-SPROGS= mke2fs badblocks tune2fs dumpe2fs blkid logsave \
+@BLKID_CMT@BLKID_PROG= blkid
+@BLKID_CMT@BLKID_MAN= blkid.8
+
+@BLKID_CMT@FINDFS_LINK= findfs
+@BLKID_CMT@FINDFS_MAN= findfs.8
+
+SPROGS= mke2fs badblocks tune2fs dumpe2fs $(BLKID_PROG) logsave \
$(E2IMAGE_PROG) @FSCK_PROG@ e2undo
USPROGS= mklost+found filefrag $(UUIDD_PROG)
SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \
- e2label.8 findfs.8 blkid.8 $(E2IMAGE_MAN) \
+ e2label.8 $(FINDFS_MAN) $(BLKID_MAN) $(E2IMAGE_MAN) \
logsave.8 filefrag.8 e2undo.8 $(UUIDD_MAN) @FSCK_MAN@
FMANPAGES= mke2fs.conf.5

@@ -397,9 +403,11 @@ install: all $(SMANPAGES) $(UMANPAGES) installdirs
@echo " LINK $(root_sbindir)/e2label"
@$(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
$(DESTDIR)$(root_sbindir)/e2label
- @echo " LINK $(root_sbindir)/findfs"
- @$(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
- $(DESTDIR)$(root_sbindir)/findfs
+ @if test -n "$(FINDFS_LINK)"; then \
+ echo " LINK $(root_sbindir)/findfs"; \
+ $(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
+ $(DESTDIR)$(root_sbindir)/findfs; \
+ fi
@for i in $(UPROGS); do \
echo " INSTALL $(bindir)/$$i"; \
$(INSTALL_PROGRAM) $$i $(DESTDIR)$(bindir)/$$i; \
@@ -509,7 +517,7 @@ uninstall:
for i in $(UMANPAGES); do \
$(RM) -f $(DESTDIR)$(man1dir)/$$i; \
done
- for i in findfs e2label ; do \
+ for i in $(FINDFS_LINK) e2label ; do \
$(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
done
for i in $(FMANPAGES); do \
--
1.6.0.6


2009-02-23 17:39:42

by Karel Zak

[permalink] [raw]
Subject: [PATCH] tune2fs: make findfs code optional

This patch add CONFIG_BUILD_FINDFS to enable/disable findfs(8) code
in tune2fs.

Signed-off-by: Karel Zak <[email protected]>
---
configure.in | 2 ++
misc/tune2fs.c | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 83ab14d..a45ad2c 100644
--- a/configure.in
+++ b/configure.in
@@ -296,10 +296,12 @@ then
AC_MSG_RESULT([Disabling private blkid library])
else
BLKID_CMT=
+ AC_DEFINE(CONFIG_BUILD_FINDFS)
AC_MSG_RESULT([Enabling private blkid library])
fi
,
BLKID_CMT=
+AC_DEFINE(CONFIG_BUILD_FINDFS)
AC_MSG_RESULT([Enabling private blkid library by default])
)
AC_SUBST(BLKID_CMT)
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 887a702..f1c8ab9 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -95,7 +95,9 @@ struct blk_move {

static const char *please_fsck = N_("Please run e2fsck on the filesystem.\n");

+#ifdef CONFIG_BUILD_FINDFS
void do_findfs(int argc, char **argv);
+#endif

static void usage(void)
{
@@ -836,6 +838,7 @@ static void parse_tune2fs_options(int argc, char **argv)
}
}

+#ifdef CONFIG_BUILD_FINDFS
void do_findfs(int argc, char **argv)
{
char *dev;
@@ -854,6 +857,7 @@ void do_findfs(int argc, char **argv)
puts(dev);
exit(0);
}
+#endif

static void parse_extended_opts(ext2_filsys fs, const char *opts)
{
@@ -1492,8 +1496,10 @@ int main(int argc, char **argv)
program_name = *argv;
add_error_table(&et_ext2_error_table);

+#ifdef CONFIG_BUILD_FINDFS
if (strcmp(get_progname(argv[0]), "findfs") == 0)
do_findfs(argc, argv);
+#endif
if (strcmp(get_progname(argv[0]), "e2label") == 0)
parse_e2label_options(argc, argv);
else
--
1.6.0.6


2009-02-24 08:45:21

by Karel Zak

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Mon, Feb 23, 2009 at 06:38:52PM +0100, Karel Zak wrote:
> This patch allows to switch between private (in-tree) libblkid and
> public (in-system installed) library. The private version is still
> enabled by default.

I found some bugs in my previous patches. Please, use the patch
below. This patch includes all necessary changes. Sorry.

Karel


>From 3a75bf0b06b791280c43781544290c5c8838729b Mon Sep 17 00:00:00 2001
From: Karel Zak <[email protected]>
Date: Tue, 24 Feb 2009 09:10:07 +0100
Subject: [PATCH] blkid: --disable-libblkid to build with external libblkid

* add --disable-libblkid to switch between private (in-tree) libblkid
and public (in-system installed) library. The private version is still
enabled by default.

* add CONFIG_BUILD_FINDFS to enable/disable findfs(8) code in tune2fs.

Signed-off-by: Karel Zak <[email protected]>
---
MCONFIG.in | 28 ++++++++++++++++++++++------
Makefile.in | 3 ++-
configure.in | 33 +++++++++++++++++++++++++++++++++
misc/Makefile.in | 23 ++++++++++++++++-------
misc/tune2fs.c | 6 ++++++
5 files changed, 79 insertions(+), 14 deletions(-)

diff --git a/MCONFIG.in b/MCONFIG.in
index f67682e..c7c16bf 100644
--- a/MCONFIG.in
+++ b/MCONFIG.in
@@ -69,36 +69,52 @@ MKINSTALLDIRS = @MKINSTALLDIRS@
#
# Library definitions
#
+@BLKID_CMT@PRIVATE_LIBBLKID = yes
+
+# public libblkid options
+BLKID_LIBS = @BLKID_LIBS@
+STATIC_BLKID_LIBS = @STATIC_BLKID_LIBS@
+
+ifdef PRIVATE_LIBBLKID
+LIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
+DEPLIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
+STATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@ $(STATIC_LIBUUID)
+DEPSTATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@
+PROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@ $(PROFILED_LIBUUID)
+DEPPROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@
+else
+LIBBLKID = $(BLKID_LIBS) @PRIVATE_LIBS_CMT@ $(LIBUUID)
+DEPLIBBLKID = $(BLKID_LIBS) @PRIVATE_LIBS_CMT@ $(LIBUUID)
+STATIC_LIBBLKID = $(STATIC_BLKID_LIBS) $(STATIC_LIBUUID)
+DEPSTATIC_LIBBLKID = $(STATIC_BLKID_LIBS)
+PROFILED_LIBBLKID = $(BLKID_LIBS) $(PROFILED_LIBUUID)
+DEPPROFILED_LIBBLKID = $(BLKID_LIBS)
+endif
+
LIB = $(top_builddir)/lib
LIBSS = $(LIB)/libss@LIB_EXT@ @PRIVATE_LIBS_CMT@ @DLOPEN_LIB@
LIBCOM_ERR = $(LIB)/libcom_err@LIB_EXT@ @PRIVATE_LIBS_CMT@ @SEM_INIT_LIB@
LIBE2P = $(LIB)/libe2p@LIB_EXT@
LIBEXT2FS = $(LIB)/libext2fs@LIB_EXT@
LIBUUID = $(LIB)/libuuid@LIB_EXT@ @SOCKET_LIB@
-LIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
LIBINTL = @LIBINTL@
DEPLIBSS = $(LIB)/libss@LIB_EXT@
DEPLIBUUID = $(LIB)/libuuid@LIB_EXT@
-DEPLIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)

STATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@ @DLOPEN_LIB@
STATIC_LIBCOM_ERR = $(LIB)/libcom_err@STATIC_LIB_EXT@ @SEM_INIT_LIB@
STATIC_LIBE2P = $(LIB)/libe2p@STATIC_LIB_EXT@
STATIC_LIBEXT2FS = $(LIB)/libext2fs@STATIC_LIB_EXT@
STATIC_LIBUUID = $(LIB)/libuuid@STATIC_LIB_EXT@ @SOCKET_LIB@
-STATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@ $(STATIC_LIBUUID)
DEPSTATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@
DEPSTATIC_LIBUUID = $(LIB)/libuuid@STATIC_LIB_EXT@
-DEPSTATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@

PROFILED_LIBSS = $(LIB)/libss@PROFILED_LIB_EXT@ @DLOPEN_LIB@
PROFILED_LIBCOM_ERR = $(LIB)/libcom_err@PROFILED_LIB_EXT@ @SEM_INIT_LIB@
PROFILED_LIBE2P = $(LIB)/libe2p@PROFILED_LIB_EXT@
PROFILED_LIBEXT2FS = $(LIB)/libext2fs@PROFILED_LIB_EXT@
PROFILED_LIBUUID = $(LIB)/libuuid@PROFILED_LIB_EXT@ @SOCKET_LIB@
-PROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@ $(PROFILED_LIBUUID)
DEPPROFILED_LIBUUID = $(LIB)/libuuid@PROFILED_LIB_EXT@
-DEPPROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@

# An include directive pointing to a directory holding enough linux-like
# include files to satisfy some programs here
diff --git a/Makefile.in b/Makefile.in
index 728d3a5..1f1b8ea 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -11,8 +11,9 @@ INSTALL = @INSTALL@

@RESIZER_CMT@RESIZE_DIR= resize
@DEBUGFS_CMT@DEBUGFS_DIR= debugfs
+@BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid

-LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs lib/blkid intl
+LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs $(BLKID_LIB_SUBDIR) intl
PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests

diff --git a/configure.in b/configure.in
index 2534df4..732ed30 100644
--- a/configure.in
+++ b/configure.in
@@ -276,6 +276,39 @@ AC_MSG_RESULT([Disabling BSD shared libraries by default])
AC_SUBST(BSDLIB_CMT)
AC_SUBST_FILE(MAKEFILE_BSDLIB)
dnl
+dnl handle --disable-libblkid
+dnl
+PKG_PROG_PKG_CONFIG
+BLKID_LIBS=
+STATIC_BLKID_LIBS=
+BLKID_CMT=
+AC_ARG_ENABLE([libblkid],
+[ --disable-libblkid do not build private blkid library],
+if test "$enableval" = "no"
+then
+ if test -z "$PKG_CONFIG"; then
+ AC_MSG_ERROR([pkg-config not installed; please install it.])
+ fi
+
+ AC_CHECK_LIB(blkid, blkid_get_cache,
+ [BLKID_LIBS=`$PKG_CONFIG --libs blkid`;
+ STATIC_BLKID_LIBS=`$PKG_CONFIG --static --libs blkid`],
+ [AC_MSG_ERROR([external blkid library not found])],
+ [$BLKID_LIBS])
+ BLKID_CMT=#
+ AC_MSG_RESULT([Disabling private blkid library])
+else
+ AC_DEFINE(CONFIG_BUILD_FINDFS)
+ AC_MSG_RESULT([Enabling private blkid library])
+fi
+,
+AC_DEFINE(CONFIG_BUILD_FINDFS)
+AC_MSG_RESULT([Enabling private blkid library by default])
+)
+AC_SUBST(BLKID_CMT)
+AC_SUBST(BLKID_LIBS)
+AC_SUBST(STATIC_BLKID_LIBS)
+dnl
dnl handle --enable-profile
dnl
AC_ARG_ENABLE([profile],
diff --git a/misc/Makefile.in b/misc/Makefile.in
index e35bb8f..d426e57 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -17,11 +17,18 @@ INSTALL = @INSTALL@
@UUIDD_CMT@UUIDD_PROG= uuidd
@UUIDD_CMT@UUIDD_MAN= uuidd.8

-SPROGS= mke2fs badblocks tune2fs dumpe2fs blkid logsave \
+@BLKID_CMT@BLKID_PROG= blkid
+@BLKID_CMT@BLKID_MAN= blkid.8
+@BLKID_CMT@BLKID_PROFILED= blkid.profiled
+
+@BLKID_CMT@FINDFS_LINK= findfs
+@BLKID_CMT@FINDFS_MAN= findfs.8
+
+SPROGS= mke2fs badblocks tune2fs dumpe2fs $(BLKID_PROG) logsave \
$(E2IMAGE_PROG) @FSCK_PROG@ e2undo
USPROGS= mklost+found filefrag $(UUIDD_PROG)
SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \
- e2label.8 findfs.8 blkid.8 $(E2IMAGE_MAN) \
+ e2label.8 $(FINDFS_MAN) $(BLKID_MAN) $(E2IMAGE_MAN) \
logsave.8 filefrag.8 e2undo.8 $(UUIDD_MAN) @FSCK_MAN@
FMANPAGES= mke2fs.conf.5

@@ -94,7 +101,7 @@ COMPILE_ET=$(top_builddir)/lib/et/compile_et --build-tree
all:: profiled $(SPROGS) $(UPROGS) $(USPROGS) $(SMANPAGES) $(UMANPAGES) \
$(FMANPAGES) $(LPROGS)

-@PROFILE_CMT@all:: tune2fs.profiled blkid.profiled e2image.profiled \
+@PROFILE_CMT@all:: tune2fs.profiled $(BLKID_PROFILED) e2image.profiled \
e2undo.profiled mke2fs.profiled dumpe2fs.profiled fsck.profiled \
logsave.profiled filefrag.profiled uuidgen.profiled uuidd.profiled \
e2image.profiled
@@ -397,9 +404,11 @@ install: all $(SMANPAGES) $(UMANPAGES) installdirs
@echo " LINK $(root_sbindir)/e2label"
@$(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
$(DESTDIR)$(root_sbindir)/e2label
- @echo " LINK $(root_sbindir)/findfs"
- @$(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
- $(DESTDIR)$(root_sbindir)/findfs
+ @if test -n "$(FINDFS_LINK)"; then \
+ echo " LINK $(root_sbindir)/findfs"; \
+ $(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
+ $(DESTDIR)$(root_sbindir)/findfs; \
+ fi
@for i in $(UPROGS); do \
echo " INSTALL $(bindir)/$$i"; \
$(INSTALL_PROGRAM) $$i $(DESTDIR)$(bindir)/$$i; \
@@ -509,7 +518,7 @@ uninstall:
for i in $(UMANPAGES); do \
$(RM) -f $(DESTDIR)$(man1dir)/$$i; \
done
- for i in findfs e2label ; do \
+ for i in $(FINDFS_LINK) e2label ; do \
$(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
done
for i in $(FMANPAGES); do \
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 887a702..f1c8ab9 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -95,7 +95,9 @@ struct blk_move {

static const char *please_fsck = N_("Please run e2fsck on the filesystem.\n");

+#ifdef CONFIG_BUILD_FINDFS
void do_findfs(int argc, char **argv);
+#endif

static void usage(void)
{
@@ -836,6 +838,7 @@ static void parse_tune2fs_options(int argc, char **argv)
}
}

+#ifdef CONFIG_BUILD_FINDFS
void do_findfs(int argc, char **argv)
{
char *dev;
@@ -854,6 +857,7 @@ void do_findfs(int argc, char **argv)
puts(dev);
exit(0);
}
+#endif

static void parse_extended_opts(ext2_filsys fs, const char *opts)
{
@@ -1492,8 +1496,10 @@ int main(int argc, char **argv)
program_name = *argv;
add_error_table(&et_ext2_error_table);

+#ifdef CONFIG_BUILD_FINDFS
if (strcmp(get_progname(argv[0]), "findfs") == 0)
do_findfs(argc, argv);
+#endif
if (strcmp(get_progname(argv[0]), "e2label") == 0)
parse_e2label_options(argc, argv);
else
--
1.6.0.6



2009-03-09 03:15:43

by Theodore Ts'o

[permalink] [raw]
Subject: Re: uti-linux-ng libblkid

On Mon, Feb 23, 2009 at 06:38:51PM +0100, Karel Zak wrote:
> Hi Ted,
>
> here are two patches that allow to link utils from e2fsprogs with
> external libblkid (e.g. the version from util-linux-ng).

Thanks, I'm starting to play with the builtin fsprobe libraries in
util-linux-ng right now. Some quick issues I've found right off the
bat. Automake is returning these errors:

configure.ac:8: required file `config/missing' not found
configure.ac:8: `automake --add-missing' can install `missing'
disk-utils/Makefile.am: required file `config/depcomp' not found
disk-utils/Makefile.am: `automake --add-missing' can install `depcomp'
libs/blkid/src/Makefile.am:17: Libtool library used but `LIBTOOL' is undefined
libs/blkid/src/Makefile.am:17: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
libs/blkid/src/Makefile.am:17: to `configure.ac' and run `aclocal' and `autoconf' again.
libs/blkid/src/Makefile.am:17: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure
libs/blkid/src/Makefile.am:17: its definition is in aclocal's search path.
libs/blkid/src/probers/Makefile.am:5: Libtool library used but `LIBTOOL' is undefined
libs/blkid/src/probers/Makefile.am:5: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
libs/blkid/src/probers/Makefile.am:5: to `configure.ac' and run `aclocal' and `autoconf' again.
libs/blkid/src/probers/Makefile.am:5: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure
libs/blkid/src/probers/Makefile.am:5: its definition is in aclocal's search path.

Also, the configure --help for --with-fsprobe is currently:

--with-fsprobe library to guess filesystems
(builtin|blkid|volume_id), default is blkid

It would probably clearer if it read:

--with-fsprobe=LIB library to guess filesystems
LIB should be builtin|blkid|volume_id,
default is blkid

Also note there have been a couple of blkid fixes that have been made
to e2fsprogs git tree, I'll look into getting those pushed to you.

- Ted

2009-03-09 10:43:00

by Karel Zak

[permalink] [raw]
Subject: Re: uti-linux-ng libblkid

On Sun, Mar 08, 2009 at 09:08:33PM -0400, Theodore Tso wrote:
> On Mon, Feb 23, 2009 at 06:38:51PM +0100, Karel Zak wrote:
> > Hi Ted,
> >
> > here are two patches that allow to link utils from e2fsprogs with
> > external libblkid (e.g. the version from util-linux-ng).
>
> Thanks, I'm starting to play with the builtin fsprobe libraries in
> util-linux-ng right now. Some quick issues I've found right off the
> bat. Automake is returning these errors:
>
> configure.ac:8: required file `config/missing' not found
> configure.ac:8: `automake --add-missing' can install `missing'

Did you run ./autogen.sh script? (It outputs versions of all relevant
autotoos, this output is useful for debuging.)

Maybe I can prepare a .tar.gz snapshot with generated build-system.

> Also, the configure --help for --with-fsprobe is currently:
>
> --with-fsprobe library to guess filesystems
> (builtin|blkid|volume_id), default is blkid
>
> It would probably clearer if it read:
>
> --with-fsprobe=LIB library to guess filesystems
> LIB should be builtin|blkid|volume_id,
> default is blkid

Good point.

> Also note there have been a couple of blkid fixes that have been made
> to e2fsprogs git tree, I'll look into getting those pushed to you.

No problem, I'll pull from your tree. I think the missing fixes are
the latests patches from February only. All older fixes should be
already in my tree.

Thanks for your feedback.

Karel

--
Karel Zak <[email protected]>

2009-03-09 11:46:00

by Karel Zak

[permalink] [raw]
Subject: Re: uti-linux-ng libblkid

On Sun, Mar 08, 2009 at 09:08:33PM -0400, Theodore Tso wrote:
> Also note there have been a couple of blkid fixes that have been made
> to e2fsprogs git tree, I'll look into getting those pushed to you.

Applied/ported from your tree:

commit eb630fd8708ae433e55e384079c08e0f0f040d22
Author: Eric Sandeen <[email protected]>
Date: Tue Feb 24 23:15:33 2009 -0600
e2fsprogs: blkid.static make target

commit a90f5391dda78f7bc4a8196a78355584ace0adf5
Author: Eric Sandeen <[email protected]>
Date: Tue Feb 24 23:17:54 2009 -0600
blkid: recognize ext4(dev) without journal

commit 1361821e7e248166f0740c832b164e6cd6b89de9
Author: Theodore Ts'o <[email protected]>
Date: Sun Mar 8 18:56:41 2009 -0400
blkid: Add fallback to ext4 for 2.6.29+ kernels if ext2 is not present


Our trees should be synced now.

Karel

--
Karel Zak <[email protected]>

2009-03-18 19:28:22

by Karel Zak

[permalink] [raw]
Subject: Re: uti-linux-ng libblkid

On Sun, Mar 08, 2009 at 09:08:33PM -0400, Theodore Tso wrote:
> On Mon, Feb 23, 2009 at 06:38:51PM +0100, Karel Zak wrote:
> > here are two patches that allow to link utils from e2fsprogs with
> > external libblkid (e.g. the version from util-linux-ng).
>
> Thanks, I'm starting to play with the builtin fsprobe libraries in
> util-linux-ng right now. Some quick issues I've found right off the
> bat. Automake is returning these errors:

Ted, use
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/util-linux-ng-2.15-rc1.tar.bz2

I look forward to see the patches in e2fsprogs ;-)

I have question, do you think that you can freeze the libblkid
version number in e2fsprogs? (now it's <maj>.<min>.<rel> = 1.41.4)

I think it makes sense to increment the major and minor version
numbers in util-linux-ng only. The version in e2fsprogs should be in
feature-freeze state.

The current libblkid version number in util-linux-ng-2.15-rc1 is
1.99.0 -- but I'd like to use something more sane for the final
release.

Thanks.

Karel

--
Karel Zak <[email protected]>

2009-03-24 12:11:58

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

Karel Zak wrote:

> I found some bugs in my previous patches. Please, use the patch
> below. This patch includes all necessary changes. Sorry.
>
When putting together an Ubuntu package with this patch, I found that it
ends up putting the pkg-config output into the make dependency variables
and thus fails because it can't make the "-L/lib" target.

The attached patch fixes that, and includes your previous patch.

Scott


Attachments:
(No filename) (423.00 B)
blkid-add---disable-libblkid-v3.patch (7.89 kB)
Download all attachments

2009-04-16 10:22:47

by Karel Zak

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Tue, Mar 24, 2009 at 12:11:47PM +0000, Scott James Remnant wrote:
> Karel Zak wrote:
>
> > I found some bugs in my previous patches. Please, use the patch
> > below. This patch includes all necessary changes. Sorry.
> >
> When putting together an Ubuntu package with this patch, I found that it
> ends up putting the pkg-config output into the make dependency variables
> and thus fails because it can't make the "-L/lib" target.
>
> The attached patch fixes that, and includes your previous patch.

Ted, ping ping ping... :-) Please, we need your feedback.

Karel

--
Karel Zak <[email protected]>

2009-04-17 13:37:01

by Kay Sievers

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Thu, Apr 16, 2009 at 12:22, Karel Zak <[email protected]> wrote:
> On Tue, Mar 24, 2009 at 12:11:47PM +0000, Scott James Remnant wrote:
>> Karel Zak wrote:
>>
>> > I found some bugs in my previous patches. Please, use the patch
>> > below. This patch includes all necessary changes. Sorry.
>> >
>> When putting together an Ubuntu package with this patch, I found that it
>> ends up putting the pkg-config output into the make dependency variables
>> and thus fails because it can't make the "-L/lib" target.
>>
>> The attached patch fixes that, and includes your previous patch.
>
>  Ted, ping ping ping... :-) Please, we need your feedback.

Ted? Please make sure we get this in.

You will save people not using Fedora, SUSE, Ubuntu, finding out why
recent tools they try to build/install will stop working for them,
when they don't have these patches. We are going to introduce hard
dependencies on the the new libblkid from util-linux-ng for a bunch of
upstream projects.

Thanks,
Kay

2009-04-17 13:48:37

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Thu, 2009-04-16 at 12:22 +0200, Karel Zak wrote:

> On Tue, Mar 24, 2009 at 12:11:47PM +0000, Scott James Remnant wrote:
> > Karel Zak wrote:
> >
> > > I found some bugs in my previous patches. Please, use the patch
> > > below. This patch includes all necessary changes. Sorry.
> > >
> > When putting together an Ubuntu package with this patch, I found that it
> > ends up putting the pkg-config output into the make dependency variables
> > and thus fails because it can't make the "-L/lib" target.
> >
> > The attached patch fixes that, and includes your previous patch.
>
> Ted, ping ping ping... :-) Please, we need your feedback.
>
If it's any help, here's a complete difference including changes to the
debian directory to remove the blkid packages - this includes the v3
patch I sent to the ext4 list.

Scott
--
Scott James Remnant
[email protected]


Attachments:
e2fsprogs-debian-blkid.patch (20.01 kB)
signature.asc (197.00 B)
This is a digitally signed message part
Download all attachments

2009-04-22 13:33:15

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

This is the version of the the --disable-libblkid patch which I
ultimately dropped into the my tree. I have not tested it with the
util-linux-ng libblkid --- I haven't had the time to try to build and
install it on a test system. I have tested to make sure it builds
correctly using the in-system libblkid (from e2fsprogs).

The big change which I made from the submitted patch --- I try very
hard not to let GNU make'isms creep into the e2fsprogs dependency; it
compiles on other OS's, including Darwin, Solaris, *BSD, etc., so
ix-nay on using ifdef in Makefile or Makefile fragments, like MCONFIG.

Also, I have not dropped in the debian packaging changes which you
made Scott, since you just conditionally made changes to the
debian/rules and debian/config file, which means e2fsprogs would break
on Debian (which hasn't even packaged util-linux-ng yet) and on
versions of Ubuntu that haven't made the switch yet. In the ideal
world, the Debian rules file would autodetect whether it is on a
new-style or old-style system, and role play accordingly, with a
DEB_BUILD_OPTIONS flag that would override the defaults. We'll need
to support both for a while, since there are people who want to
backport the latest e2fsprogs on older distributions. (For example,
Ubuntu LTS, Debian archaelogical-err-I-mean-stable, etc.)

The changes have been pushed out to the e2fsprogs git repository if
you want to try it out with the latest changes, which will be in the
very-soon-to-be-released e2fsprogs 1.41.5.

- Ted

P.S. Scott, if you haven't been tracking linux-ext4, there are some
rather critical resize2fs bugfixes that recently came into the tree,
which fix bugs that cause filesystem corruption when growing or
shrinking ext4 filesystems off-line.


commit 14b596d40997c7e55ec8928bd222787f96808a2b
Author: Theodore Ts'o <[email protected]>
Date: Wed Apr 22 09:18:30 2009 -0400

configure.in: add --disable-libblkid option

Add an option to switch between the private (in-tree) libblkid and
public (in-system installed) library. The private version is still
enabled by default.

If --disable-libblkid is specified the findfs(8) program, which is a
variant of tune2fs, is also not built or installed.

Signed-off-by: Karel Zak <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>

diff --git a/MCONFIG.in b/MCONFIG.in
index f67682e..7f3e0c5 100644
--- a/MCONFIG.in
+++ b/MCONFIG.in
@@ -75,30 +75,30 @@ LIBCOM_ERR = $(LIB)/libcom_err@LIB_EXT@ @PRIVATE_LIBS_CMT@ @SEM_INIT_LIB@
LIBE2P = $(LIB)/libe2p@LIB_EXT@
LIBEXT2FS = $(LIB)/libext2fs@LIB_EXT@
LIBUUID = $(LIB)/libuuid@LIB_EXT@ @SOCKET_LIB@
-LIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
+LIBBLKID = @LIBBLKID@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
LIBINTL = @LIBINTL@
DEPLIBSS = $(LIB)/libss@LIB_EXT@
DEPLIBUUID = $(LIB)/libuuid@LIB_EXT@
-DEPLIBBLKID = $(LIB)/libblkid@LIB_EXT@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
+DEPLIBBLKID = @DEPLIBBLKID@ @PRIVATE_LIBS_CMT@ $(LIBUUID)

STATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@ @DLOPEN_LIB@
STATIC_LIBCOM_ERR = $(LIB)/libcom_err@STATIC_LIB_EXT@ @SEM_INIT_LIB@
STATIC_LIBE2P = $(LIB)/libe2p@STATIC_LIB_EXT@
STATIC_LIBEXT2FS = $(LIB)/libext2fs@STATIC_LIB_EXT@
STATIC_LIBUUID = $(LIB)/libuuid@STATIC_LIB_EXT@ @SOCKET_LIB@
-STATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@ $(STATIC_LIBUUID)
+STATIC_LIBBLKID = @STATIC_LIBBLKID@ $(STATIC_LIBUUID)
DEPSTATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@
DEPSTATIC_LIBUUID = $(LIB)/libuuid@STATIC_LIB_EXT@
-DEPSTATIC_LIBBLKID = $(LIB)/libblkid@STATIC_LIB_EXT@
+DEPSTATIC_LIBBLKID = @DEPSTATIC_LIBBLKID@ $(STATIC_LIBUUID)

PROFILED_LIBSS = $(LIB)/libss@PROFILED_LIB_EXT@ @DLOPEN_LIB@
PROFILED_LIBCOM_ERR = $(LIB)/libcom_err@PROFILED_LIB_EXT@ @SEM_INIT_LIB@
PROFILED_LIBE2P = $(LIB)/libe2p@PROFILED_LIB_EXT@
PROFILED_LIBEXT2FS = $(LIB)/libext2fs@PROFILED_LIB_EXT@
PROFILED_LIBUUID = $(LIB)/libuuid@PROFILED_LIB_EXT@ @SOCKET_LIB@
-PROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@ $(PROFILED_LIBUUID)
+PROFILED_LIBBLKID = @PROFILED_LIBBLKID@ $(PROFILED_LIBUUID)
DEPPROFILED_LIBUUID = $(LIB)/libuuid@PROFILED_LIB_EXT@
-DEPPROFILED_LIBBLKID = $(LIB)/libblkid@PROFILED_LIB_EXT@
+DEPPROFILED_LIBBLKID = @PROFILED_LIBBLKID@ $(PROFILED_LIBUUID)

# An include directive pointing to a directory holding enough linux-like
# include files to satisfy some programs here
diff --git a/Makefile.in b/Makefile.in
index 728d3a5..1f1b8ea 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -11,8 +11,9 @@ INSTALL = @INSTALL@

@RESIZER_CMT@RESIZE_DIR= resize
@DEBUGFS_CMT@DEBUGFS_DIR= debugfs
+@BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid

-LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs lib/blkid intl
+LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs $(BLKID_LIB_SUBDIR) intl
PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests

diff --git a/configure.in b/configure.in
index caf2cb4..781519c 100644
--- a/configure.in
+++ b/configure.in
@@ -136,7 +136,7 @@ dnl parsing configuration opions, which may modify these
dnl
LIB_EXT=.a
STATIC_LIB_EXT=.a
-PROFILE_LIB_EXT=.a
+PROFILED_LIB_EXT=.a
dnl
dnl set $(LDFLAGS) from --with-ldopts=value
dnl
@@ -379,6 +379,59 @@ TEST_IO_CMT=
)
AC_SUBST(TEST_IO_CMT)
dnl
+dnl handle --disable-libblkid
+dnl
+PKG_PROG_PKG_CONFIG
+LIBBLKID=
+DEPLIBBLKID=
+STATIC_LIBBLKID=
+DEPSTATIC_LIBBLKID=
+PROFILED_LIBBLKID=
+DEPPROFILED_LIBBLKID=
+BLKID_CMT=
+AC_ARG_ENABLE([libblkid],
+[ --disable-libblkid do not build private blkid library],
+if test "$enableval" = "no"
+then
+ if test -z "$PKG_CONFIG"; then
+ AC_MSG_ERROR([pkg-config not installed; please install it.])
+ fi
+
+ AC_CHECK_LIB(blkid, blkid_get_cache,
+ [LIBBLKID=`$PKG_CONFIG --libs blkid`;
+ STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
+ [AC_MSG_ERROR([external blkid library not found])],
+ [$LIBBLKID])
+ BLKID_CMT=#
+ AC_MSG_RESULT([Disabling private blkid library])
+else
+ LIBBLKID='$(LIB)/libblkid'$LIB_EXT
+ DEPLIBBLKID=$LIBBLKID
+ STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
+ DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
+ PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
+ DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
+ AC_DEFINE(CONFIG_BUILD_FINDFS)
+ AC_MSG_RESULT([Enabling private blkid library])
+fi
+,
+LIBBLKID='$(LIB)/libblkid'$LIB_EXT
+DEPLIBBLKID=$LIBBLKID
+STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
+DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
+PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
+DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
+AC_DEFINE(CONFIG_BUILD_FINDFS)
+AC_MSG_RESULT([Enabling private blkid library by default])
+)
+AC_SUBST(LIBBLKID)
+AC_SUBST(DEPLIBBLKID)
+AC_SUBST(STATIC_LIBBLKID)
+AC_SUBST(DEPSTATIC_LIBBLKID)
+AC_SUBST(PROFILED_LIBBLKID)
+AC_SUBST(DEPPROFILED_LIBBLKID)
+AC_SUBST(BLKID_CMT)
+dnl
dnl handle --enable-debugfs
dnl
AC_ARG_ENABLE([debugfs],
diff --git a/misc/Makefile.in b/misc/Makefile.in
index 63b4c20..99cb149 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -17,11 +17,17 @@ INSTALL = @INSTALL@
@UUIDD_CMT@UUIDD_PROG= uuidd
@UUIDD_CMT@UUIDD_MAN= uuidd.8

-SPROGS= mke2fs badblocks tune2fs dumpe2fs blkid logsave \
+@BLKID_CMT@BLKID_PROG= blkid
+@BLKID_CMT@BLKID_MAN= blkid.8
+
+@BLKID_CMT@FINDFS_LINK= findfs
+@BLKID_CMT@FINDFS_MAN= findfs.8
+
+SPROGS= mke2fs badblocks tune2fs dumpe2fs $(BLKID_PROG) logsave \
$(E2IMAGE_PROG) @FSCK_PROG@ e2undo
USPROGS= mklost+found filefrag $(UUIDD_PROG)
SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \
- e2label.8 findfs.8 blkid.8 $(E2IMAGE_MAN) \
+ e2label.8 $(FINDFS_MAN) $(BLKID_MAN) $(E2IMAGE_MAN) \
logsave.8 filefrag.8 e2undo.8 $(UUIDD_MAN) @FSCK_MAN@
FMANPAGES= mke2fs.conf.5

@@ -402,9 +408,11 @@ install: all $(SMANPAGES) $(UMANPAGES) installdirs
@echo " LINK $(root_sbindir)/e2label"
@$(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
$(DESTDIR)$(root_sbindir)/e2label
- @echo " LINK $(root_sbindir)/findfs"
- @$(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
- $(DESTDIR)$(root_sbindir)/findfs
+ @if test -n "$(FINDFS_LINK)"; then \
+ echo " LINK $(root_sbindir)/findfs"; \
+ $(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
+ $(DESTDIR)$(root_sbindir)/$(FINDFS_LINK); \
+ fi
@for i in $(UPROGS); do \
echo " INSTALL $(bindir)/$$i"; \
$(INSTALL_PROGRAM) $$i $(DESTDIR)$(bindir)/$$i; \
@@ -514,7 +522,7 @@ uninstall:
for i in $(UMANPAGES); do \
$(RM) -f $(DESTDIR)$(man1dir)/$$i; \
done
- for i in findfs e2label ; do \
+ for i in $(FINDFS_LINK) e2label ; do \
$(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
done
for i in $(FMANPAGES); do \
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 5808e49..b8fdd63 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -95,7 +95,9 @@ struct blk_move {

static const char *please_fsck = N_("Please run e2fsck on the filesystem.\n");

+#ifdef CONFIG_BUILD_FINDFS
void do_findfs(int argc, char **argv);
+#endif

static void usage(void)
{
@@ -836,6 +838,7 @@ static void parse_tune2fs_options(int argc, char **argv)
}
}

+#ifdef CONFIG_BUILD_FINDFS
void do_findfs(int argc, char **argv)
{
char *dev;
@@ -854,6 +857,7 @@ void do_findfs(int argc, char **argv)
puts(dev);
exit(0);
}
+#endif

static void parse_extended_opts(ext2_filsys fs, const char *opts)
{
@@ -1503,8 +1507,10 @@ int main(int argc, char **argv)
program_name = *argv;
add_error_table(&et_ext2_error_table);

+#ifdef CONFIG_BUILD_FINDFS
if (strcmp(get_progname(argv[0]), "findfs") == 0)
do_findfs(argc, argv);
+#endif
if (strcmp(get_progname(argv[0]), "e2label") == 0)
parse_e2label_options(argc, argv);
else



2009-04-22 13:42:35

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

Great to hear from you, Ted!

On Wed, 2009-04-22 at 09:33 -0400, Theodore Tso wrote:

> Also, I have not dropped in the debian packaging changes which you
> made Scott, since you just conditionally made changes to the
> debian/rules and debian/config file, which means e2fsprogs would break
> on Debian (which hasn't even packaged util-linux-ng yet) and on
> versions of Ubuntu that haven't made the switch yet.
>
Yeah, that seems fair. I actually left both versions of the code in the
rules with the in-tree blkid stuff commented out assuming we'd ifeq
around them as we do with util-linux-ng.

The package went into a PPA not the archive, so it was in a "just get it
done and worry about making it look good later" state.

Obviously this doesn't solve the debian/control problem - that would
require generating it with/without the libblkid parts depending on
target distro.

> P.S. Scott, if you haven't been tracking linux-ext4, there are some
> rather critical resize2fs bugfixes that recently came into the tree,
> which fix bugs that cause filesystem corruption when growing or
> shrinking ext4 filesystems off-line.
>
Grabbed that, thanks!

We're absolutely final frozen for Jaunty now; the CDs were spun on
Monday, but the problem has been noted in our Release Notes.

Since the patches are reasonably small and uninvasive, we'll look into
them for a jaunty-updates upload.

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part

2009-04-22 13:49:51

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Wed, Apr 22, 2009 at 02:42:25PM +0100, Scott James Remnant wrote:
>
> Obviously this doesn't solve the debian/control problem - that would
> require generating it with/without the libblkid parts depending on
> target distro.

One of the things I need to look at, but maybe you know off-hand, is
whether the debian/rules can safely modify debian/control file. I
haven't looked deeply into the underbelly of how dpkg-buildpackage and
its descendents work to know whether or not that can be done safely.
If not, we might have to have a separate shell script which is run
manually that adjusts debian/control and debian/rules file. That
would be annoying/unfortunate, but doable.

- Ted

2009-04-22 14:07:50

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Wed, 2009-04-22 at 09:49 -0400, Theodore Tso wrote:

> On Wed, Apr 22, 2009 at 02:42:25PM +0100, Scott James Remnant wrote:
> >
> > Obviously this doesn't solve the debian/control problem - that would
> > require generating it with/without the libblkid parts depending on
> > target distro.
>
> One of the things I need to look at, but maybe you know off-hand, is
> whether the debian/rules can safely modify debian/control file. I
> haven't looked deeply into the underbelly of how dpkg-buildpackage and
> its descendents work to know whether or not that can be done safely.
> If not, we might have to have a separate shell script which is run
> manually that adjusts debian/control and debian/rules file. That
> would be annoying/unfortunate, but doable.
>
It's a common practice, -policy only requires that debian/changelog and
debian/rules exist. debian/control is parsed by tools run by
debian/rules, so it's ok for debian/control to be generated by it.

Various packages use debian/control.in or debian/control.m4 or similar.

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part

2009-04-27 09:21:40

by Karel Zak

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Wed, Apr 22, 2009 at 09:33:04AM -0400, Theodore Tso wrote:
> This is the version of the the --disable-libblkid patch which I

[...]

> The changes have been pushed out to the e2fsprogs git repository if
> you want to try it out with the latest changes, which will be in the
> very-soon-to-be-released e2fsprogs 1.41.5.

Thanks!

I forgot that we need to freeze blkid version number in e2fsprogs to
avoid collisions between e2fsprogs and util-linux-ng. Currently the
blkid version number is shared with e2fsprogs version number.

The e2fsprogs blkid should be in maintenance mode only. All development
should happen in util-linux-ng only. Right?

This problem should be resolved before util-linux-ng-2.15 stable
release (-rc2 now).

(See the patch below -- it's example. I don't know if you want to add
LIBBLKID_VERSION to the global version.h or something other to
configure.in, or so...)

Karel

>From 7d79dd7105c62b1b91e6e5a556b598c086aa0796 Mon Sep 17 00:00:00 2001
From: Karel Zak <[email protected]>
Date: Mon, 27 Apr 2009 10:55:43 +0200
Subject: [PATCH] blkid: freeze version number

Signed-off-by: Karel Zak <[email protected]>
---
lib/blkid/version.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/blkid/version.c b/lib/blkid/version.c
index 7722916..0219caa 100644
--- a/lib/blkid/version.c
+++ b/lib/blkid/version.c
@@ -19,7 +19,10 @@
#include "blkid.h"
#include "../../version.h"

-static const char *lib_version = E2FSPROGS_VERSION;
+/* The blkid library in e2fsprogs is in maintenance mode. The <maj>.<min>
+ * version number should be incremented in util-linux-ng only.
+ */
+static const char *lib_version = "1.41.4";
static const char *lib_date = E2FSPROGS_DATE;

int blkid_parse_version_string(const char *ver_string)
--
1.6.0.6


--
Karel Zak <[email protected]>

2009-04-28 20:36:42

by Karel Zak

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Mon, Apr 27, 2009 at 11:21:14AM +0200, Karel Zak wrote:
> On Wed, Apr 22, 2009 at 09:33:04AM -0400, Theodore Tso wrote:
> > This is the version of the the --disable-libblkid patch which I
>
> [...]
>
> > The changes have been pushed out to the e2fsprogs git repository if
> > you want to try it out with the latest changes, which will be in the
> > very-soon-to-be-released e2fsprogs 1.41.5.
>
> Thanks!
>
> I forgot that we need to freeze blkid version number in e2fsprogs to
> avoid collisions between e2fsprogs and util-linux-ng. Currently the
> blkid version number is shared with e2fsprogs version number.

It seems we can ignore this problem for now. I can release
libblkid 2.15 (=util-linux-ng version) and keep the same SONAME as
you have in e2fsprogs -- it means soname "libblkid.so.1".

It seems people prefer the same version for library as well as for
whole package.

Karel

--
Karel Zak <[email protected]>

2009-04-29 13:59:08

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Wed, 2009-04-22 at 09:33 -0400, Theodore Tso wrote:

> The changes have been pushed out to the e2fsprogs git repository if
> you want to try it out with the latest changes, which will be in the
> very-soon-to-be-released e2fsprogs 1.41.5.
>
I couldn't find these in the git repository - the tag has been pushed,
but not the branch.

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part

2009-04-29 17:17:06

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Wed, Apr 29, 2009 at 02:59:12PM +0100, Scott James Remnant wrote:
> On Wed, 2009-04-22 at 09:33 -0400, Theodore Tso wrote:
>
> > The changes have been pushed out to the e2fsprogs git repository if
> > you want to try it out with the latest changes, which will be in the
> > very-soon-to-be-released e2fsprogs 1.41.5.
> >
> I couldn't find these in the git repository - the tag has been pushed,
> but not the branch.

Try it now. The changes for --disable-blkid were in the git
repository, but the last set of changes for 1.41.5 hadn't gotten
pushed out to master.kernel.org for some reason.

- Ted

2009-04-29 17:22:04

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Wed, 2009-04-22 at 09:49 -0400, Theodore Tso wrote:

> On Wed, Apr 22, 2009 at 02:42:25PM +0100, Scott James Remnant wrote:
> >
> > Obviously this doesn't solve the debian/control problem - that would
> > require generating it with/without the libblkid parts depending on
> > target distro.
>
> One of the things I need to look at, but maybe you know off-hand, is
> whether the debian/rules can safely modify debian/control file. I
> haven't looked deeply into the underbelly of how dpkg-buildpackage and
> its descendents work to know whether or not that can be done safely.
> If not, we might have to have a separate shell script which is run
> manually that adjusts debian/control and debian/rules file. That
> would be annoying/unfortunate, but doable.
>
I humbly submit the following two patches:

Scott
--
Scott James Remnant
[email protected]


Attachments:
0003-debian-allow-building-with-external-libblkid.patch (33.25 kB)
0004-debian-use-external-libblkid-on-Ubuntu.patch (1.25 kB)
signature.asc (197.00 B)
This is a digitally signed message part
Download all attachments

2009-04-29 20:23:44

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Tue, Apr 28, 2009 at 10:36:35PM +0200, Karel Zak wrote:
> > I forgot that we need to freeze blkid version number in e2fsprogs to
> > avoid collisions between e2fsprogs and util-linux-ng. Currently the
> > blkid version number is shared with e2fsprogs version number.
>
> It seems we can ignore this problem for now. I can release
> libblkid 2.15 (=util-linux-ng version) and keep the same SONAME as
> you have in e2fsprogs -- it means soname "libblkid.so.1".
>
> It seems people prefer the same version for library as well as for
> whole package.

Right, I made a point of not changing the libblkid ABI, and I tend to
prefer to keep the library SONAME version independent of the package
version, because I'm a firm believer in stable ABI's. In terms of the
package version, that's going to depend on distribution. So the blkid
shared library version has never changed because I've been careful
about not screwing with the ABI. Technically I should have bumped the
minor version when I added new interfaces, but since no one really
pays attention to the minor version number of shared libraries, I was
lazy and the shared library version number has always stayed at 1.0.

As far as package versions are concerned, Debian and Ubuntu uses a
package name of "libblkid1" (where the 1 comes from the shared library
version), and a version number which is equal to the e2fsprogs version
(1.45). Red Hat and Novell will use different version numbers, but if
it's based on the package version, then 2.15 is greater than 1.45 (the
e2fsprogs version), so that should work just fine.

On Mon, Apr 27, 2009 at 11:21:14AM +0200, Karel Zak wrote:
>
> I forgot that we need to freeze blkid version number in e2fsprogs to
> avoid collisions between e2fsprogs and util-linux-ng. Currently the
> blkid version number is shared with e2fsprogs version number.
>
> The e2fsprogs blkid should be in maintenance mode only. All development
> should happen in util-linux-ng only. Right?

There have been a few bug fixes and I have some requests to detect
some new interfaces, such as VMFS, which I'll probably apply to
e2fsprogs blkid, but I don't expect to do any API or ABI changes, and
the only changes will be bugfixes and some new detection functions ---
and I'll make a point of synchronizing such improvements with
util-linux-ng. Fair enough?

> (See the patch below -- it's example. I don't know if you want to add
> LIBBLKID_VERSION to the global version.h or something other to
> configure.in, or so...)

As far as I know there are no applications which have used
blkid_get_library_version(), but what I would suggest is that
util-linux-bg use a lib_version of 2.15, and people who care about
whether they have the e2fsprogs or util-linug-ng version of e2fsprogs
can simply check for a 1.x or 2.x blkid version number as returned by
blkid_get_lib_version(). I don't anticipate e2fsprogs ever going to a
2.x version at this point --- we'll probably just always update the
1.xx version, just to avoid confusion, so I don't think we need to
worry about freezing this version number. I'll just put in a comment
that util-linux-nh will have a 2.x version, and that e2fsprogs will
have a 1.x version --- not that I think anyone will really care, or
will try to sample the version number, as long as we're careful about
not screwing with the ABI.

- Ted

2009-04-29 20:55:05

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

Scott, thanks for submitting these patches. Two quick comments:

1) It's greatly preferred if you submit each patch as separate e-mail
messages, with the one-line summary as the subject (as you might find
in a git submission or as described in sections 5.4 and 5.5 in the file
Documentation/development-process/5.Posting in the Linux kernel sources).
The reason for this is that the patchs will then be tracked in patchwork:

http://patchwork.ozlabs.org/project/linux-ext4/list/

and if it's accurately reflected there, it's much less likely that I
won't accidentally forget to act on your patches, especially when I
get busy/overloaded. The best thing to do is to use "git
format-patch" (which you apparenlty did to generate the patch), and
then use "git send-email" to send out the patches.

I find that this is in fact the fastest way for me to do work. So
after I commit two patches, I'll do something like this:

rm -rf /tmp/p
git format-patch -n -o /tmp/p -2
git send-email --to [email protected] /tmp/p

(and in fact I have an aliases file configured in ~/.gitconfig, so I
have sendemail.aliasesfile=/home/tytso/.mutt/aliases and
sendemail.aliasfiletype=mutt, in which case all I have to type is:
"git send-email --to linux-ext4 /tmp/p")

2) While lsb_release is mandatory on Ubuntu systems (there is a
dependency from ubuntu-minimal), it is not guaranteed to exist on
Debian systems. So how I already test for Ubuntu in the rules file is
via this construct:

if test -f /etc/lsb-release && \
grep -q DISTRIB_ID=Ubuntu /etc/lsb-release; then \
$(INSTALL) -p -m 0644 e2fsck/e2fsck.conf.ubuntu \
${debdir}/e2fsprogs/etc/e2fsck.conf; \
fi

Hmm, one of these days I should probably check and see if Ubuntu
finally fixed the installer and init scripts breakage which forced me
to set a special e2fsck.conf file just for Ubuntu. (See git commit
60702c26 in the e2fsprogs repository for more details.)

But in any case, I'd suggest checking for Ubuntu using the above
construct instead of trying to use the lsb_release command, since it's
not guaranteed to be there on Debian systems.

3) In the "nice to have" category, it would be nice if whether or not
blkid is built is controled via DEB_BUILD_OPTIONS flag instead of a
free-standard environment variable, but I won't insist on that.

- Ted

2009-04-30 08:28:39

by Karel Zak

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Wed, Apr 29, 2009 at 04:23:38PM -0400, Theodore Tso wrote:
> There have been a few bug fixes and I have some requests to detect
> some new interfaces, such as VMFS, which I'll probably apply to
> e2fsprogs blkid, but I don't expect to do any API or ABI changes, and
> the only changes will be bugfixes and some new detection functions ---
> and I'll make a point of synchronizing such improvements with
> util-linux-ng. Fair enough?

Yes, sounds good. My plan is send you all important patches for your
e2fsprogs version and also periodically pull from your tree.

> As far as I know there are no applications which have used
> blkid_get_library_version(), but what I would suggest is that
> util-linux-bg use a lib_version of 2.15, and people who care about

Yes, lib_version in my tree is already 2.15.0

> blkid_get_lib_version(). I don't anticipate e2fsprogs ever going to a
> 2.x version at this point --- we'll probably just always update the
> 1.xx version, just to avoid confusion, so I don't think we need to
> worry about freezing this version number. I'll just put in a comment
> that util-linux-nh will have a 2.x version, and that e2fsprogs will
> have a 1.x version --- not that I think anyone will really care, or
> will try to sample the version number, as long as we're careful about
> not screwing with the ABI.

OK. Thanks.

Karel

--
Karel Zak <[email protected]>

2009-05-05 11:30:03

by Scott James Remnant

[permalink] [raw]
Subject: Re: [PATCH] blkid: add --disable-libblkid (v2)

On Wed, 2009-04-29 at 16:54 -0400, Theodore Tso wrote:

> Scott, thanks for submitting these patches. Two quick comments:
>
> 1) It's greatly preferred if you submit each patch as separate e-mail
> messages, with the one-line summary as the subject (as you might find
> in a git submission or as described in sections 5.4 and 5.5 in the file
> Documentation/development-process/5.Posting in the Linux kernel sources).
> The reason for this is that the patchs will then be tracked in patchwork:
>
> http://patchwork.ozlabs.org/project/linux-ext4/list/
>
> and if it's accurately reflected there, it's much less likely that I
> won't accidentally forget to act on your patches, especially when I
> get busy/overloaded. The best thing to do is to use "git
> format-patch" (which you apparenlty did to generate the patch), and
> then use "git send-email" to send out the patches.
>
At this point, consider these patches "for your review" ;) If you're
happy with them, I'll submit them to the mailing list properly.

> 2) While lsb_release is mandatory on Ubuntu systems (there is a
> dependency from ubuntu-minimal), it is not guaranteed to exist on
> Debian systems.
>
That's why I have "|| Debian" in there.

This is the same rule we use in util-linux on Debian/Ubuntu.

> So how I already test for Ubuntu in the rules file is
> via this construct:
>
> if test -f /etc/lsb-release && \
> grep -q DISTRIB_ID=Ubuntu /etc/lsb-release; then \
> $(INSTALL) -p -m 0644 e2fsck/e2fsck.conf.ubuntu \
> ${debdir}/e2fsprogs/etc/e2fsck.conf; \
> fi
>
It's not guaranteed that /etc/lsb-release says DISTRIB_ID=Ubuntu - if we
ever simply changed the defaults in lsb_release, then this would fail -
no?

> Hmm, one of these days I should probably check and see if Ubuntu
> finally fixed the installer and init scripts breakage which forced me
> to set a special e2fsck.conf file just for Ubuntu. (See git commit
> 60702c26 in the e2fsprogs repository for more details.)
>
We spent a very long time on this - in Jaunty this should be
rock-solidly correct <g>

> 3) In the "nice to have" category, it would be nice if whether or not
> blkid is built is controled via DEB_BUILD_OPTIONS flag instead of a
> free-standard environment variable, but I won't insist on that.
>
Good idea.

Scott
--
Scott James Remnant
[email protected]


Attachments:
signature.asc (197.00 B)
This is a digitally signed message part