From fb469091553e4f0208810d838a571acc2b0f7264 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 16 Jul 2014 09:43:26 -0700 Subject: [PATCH] 2512: turbo/issue-2448 - Default to --with-blkid in RPM packaging Support for libblkid has been in the ZoL for years but has been disabled by default in the packaging. When libblkid is disabled the 'zpool create' command will not warn you if you're going to overwrite an existing filesystem. For this reason the default behavior has been changed to require libblkid. Signed-off-by: Brian Behlendorf Issue #2448 Make linking with and finding libblkid required (so that creating pools on devices with existing filesystem will get a warning). Use '--without-blkid' to explicitly disable this. Signed-off-by: Turbo Fredriksson Closes: #2448 --- config/user-libblkid.m4 | 23 ++++++----------------- rpm/generic/zfs.spec.in | 11 +++-------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/config/user-libblkid.m4 b/config/user-libblkid.m4 index 2dd26238c70e..e5999432122b 100644 --- a/config/user-libblkid.m4 +++ b/config/user-libblkid.m4 @@ -16,20 +16,13 @@ dnl # Otherwise we disable blkid support and resort to manual probing. dnl # AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [ AC_ARG_WITH([blkid], - [AS_HELP_STRING([--with-blkid], - [support blkid caching @<:@default=check@:>@])], + [AS_HELP_STRING([--without-blkid], + [disable suport for blkid])], [], - [with_blkid=check]) + [with_blkid=yes]) LIBBLKID= - AS_IF([test "x$with_blkid" = xyes], - [ - AC_SUBST([LIBBLKID], ["-lblkid"]) - AC_DEFINE([HAVE_LIBBLKID], 1, - [Define if you have libblkid]) - ]) - - AS_IF([test "x$with_blkid" = xcheck], + AS_IF([test "x$with_blkid" != xno], [ AC_CHECK_LIB([blkid], [blkid_get_cache], [ @@ -96,17 +89,13 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [ [ rm -f $ZFS_DEV AC_MSG_RESULT([no]) - AS_IF([test "x$with_blkid" != xcheck], - [AC_MSG_FAILURE( - [--with-blkid given but unavailable])]) + AC_MSG_FAILURE([libblkid test failed (--without-libblkid to disable)]) ]) LIBS="$saved_LIBS" ], [ - AS_IF([test "x$with_blkid" != xcheck], - [AC_MSG_FAILURE( - [--with-blkid given but unavailable])]) + AC_MSG_FAILURE([libblkid test failed (--without-libblkid to disable)]) ] []) ]) diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in index d547c7fcbac2..f5d5d58404fd 100644 --- a/rpm/generic/zfs.spec.in +++ b/rpm/generic/zfs.spec.in @@ -29,7 +29,7 @@ %endif %bcond_with debug -%bcond_with blkid +%bcond_without blkid %bcond_with systemd # Generic enable switch for systemd @@ -195,11 +195,6 @@ image which is ZFS aware. %else %define debug --disable-debug %endif -%if %{with blkid} - %define blkid --with-blkid -%else - %define blkid --without-blkid -%endif %if 0%{?_systemd} %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit %else @@ -216,8 +211,8 @@ image which is ZFS aware. --with-dracutdir=%{_dracutdir} \ --disable-static \ %{debug} \ - %{blkid} \ - %{systemd} + %{systemd} \ + %{?_with_blkid} make %{?_smp_mflags} %install