]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
configure: require libblkid
authorChristoph Hellwig <hch@lst.de>
Thu, 15 Feb 2024 06:54:06 +0000 (07:54 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 13 Mar 2024 07:48:37 +0000 (08:48 +0100)
We can't support block device access (which is the reason for xfsprogs
to exist) without blkid.  Make it a hard requirement and remove the
stubs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
configure.ac
include/builddefs.in
libxfs/topology.c

index 228e89a504e8bcde6435749a7ffe352074af9c61..012508b8e376bc823cbf8441f90916fd086518f0 100644 (file)
@@ -36,11 +36,6 @@ AC_ARG_ENABLE(gettext,
        enable_gettext=yes)
 AC_SUBST(enable_gettext)
 
-AC_ARG_ENABLE(blkid,
-[  --enable-blkid=[yes/no]   Enable use of block device id library [default=yes]],,
-       enable_blkid=yes)
-AC_SUBST(enable_blkid)
-
 AC_ARG_ENABLE(editline,
 [  --enable-editline=[yes/no] Enable editline command editing [default=no]],
        test $enable_editline = yes && libeditline="-ledit",
@@ -208,10 +203,7 @@ AC_HAVE_HDIO_GETGEO
 AC_CONFIG_SYSTEMD_SYSTEM_UNIT_DIR
 AC_CONFIG_CROND_DIR
 AC_CONFIG_UDEV_RULE_DIR
-
-if test "$enable_blkid" = yes; then
 AC_HAVE_BLKID_TOPO
-fi
 
 if test "$enable_ubsan" = "yes" || test "$enable_ubsan" = "probe"; then
         AC_PACKAGE_CHECK_UBSAN
index ff2a781494cff0a67a277e09d8473adc5dabd186..ca5efc9c0d30b014e836cf07366493118018bd00 100644 (file)
@@ -86,7 +86,6 @@ RPM_VERSION   = @rpm_version@
 ENABLE_SHARED  = @enable_shared@
 ENABLE_GETTEXT = @enable_gettext@
 ENABLE_EDITLINE        = @enable_editline@
-ENABLE_BLKID   = @enable_blkid@
 ENABLE_SCRUB   = @enable_scrub@
 
 HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@
@@ -144,9 +143,6 @@ endif
 ifeq ($(HAVE_FSETXATTR),yes)
 PCFLAGS+= -DHAVE_FSETXATTR
 endif
-ifeq ($(ENABLE_BLKID),yes)
-PCFLAGS+= -DENABLE_BLKID
-endif
 ifeq ($(NEED_INTERNAL_FSXATTR),yes)
 PCFLAGS+= -DOVERRIDE_SYSTEM_FSXATTR
 endif
index 06013d429456f505891ac4c9d056a6c7d9cddf72..4515d238d5e01ee7da7e7fa667d483d932bc804f 100644 (file)
@@ -6,9 +6,7 @@
 
 #include "libxfs_priv.h"
 #include "libxcmd.h"
-#ifdef ENABLE_BLKID
-#  include <blkid/blkid.h>
-#endif /* ENABLE_BLKID */
+#include <blkid/blkid.h>
 #include "xfs_multidisk.h"
 #include "libfrog/platform.h"
 
@@ -96,7 +94,6 @@ done:
  *      0 for nothing found
  *     -1 for internal error
  */
-#ifdef ENABLE_BLKID
 int
 check_overwrite(
        const char      *device)
@@ -253,38 +250,6 @@ out_free_probe:
                _("warning: unable to probe device topology for device %s\n"),
                device);
 }
-#else /* ifdef ENABLE_BLKID */
-/*
- * Without blkid, we can't do a good check for signatures.
- * So instead of some messy attempts, just disable any checks
- * and always return 'nothing found'.
- */
-#  warning BLKID is disabled, so signature detection and block device\
- access are not working!
-int
-check_overwrite(
-       const char      *device)
-{
-       return 1;
-}
-
-static void blkid_get_topology(
-       const char      *device,
-       int             *sunit,
-       int             *swidth,
-       int             *lsectorsize,
-       int             *psectorsize,
-       int             force_overwrite)
-{
-       /*
-        * Shouldn't make any difference (no blkid = no block device access),
-        * but make sure this dummy replacement returns with at least some
-        * sanity.
-        */
-       *lsectorsize = *psectorsize = 512;
-}
-
-#endif /* ENABLE_BLKID */
 
 void
 get_topology(