Skip to content

Commit

Permalink
=> openzfs#2512: turbo/issue-2448 - Default to --with-blkid in RPM pa…
Browse files Browse the repository at this point in the history
…ckaging

                           - Make linking with and finding libblkid required

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 <[email protected]>
Issue openzfs#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 <[email protected]>
Closes: openzfs#2448
  • Loading branch information
behlendorf authored and FransUrbo committed Sep 5, 2014
1 parent a8de097 commit c3d879d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
23 changes: 6 additions & 17 deletions config/user-libblkid.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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],
[
Expand Down Expand Up @@ -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)])
]
[])
])
Expand Down
11 changes: 3 additions & 8 deletions rpm/generic/zfs.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
%endif

%bcond_with debug
%bcond_with blkid
%bcond_without blkid
%bcond_with systemd

# Generic enable switch for systemd
Expand Down Expand Up @@ -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
Expand All @@ -216,8 +211,8 @@ image which is ZFS aware.
--with-dracutdir=%{_dracutdir} \
--disable-static \
%{debug} \
%{blkid} \
%{systemd}
%{systemd} \
%{?_with_blkid}
make %{?_smp_mflags}

%install
Expand Down

0 comments on commit c3d879d

Please sign in to comment.