Skip to content

Commit 7cadfa1

Browse files
committed
btrfs: link against libbtrfsutil
libblockdev has historically used btrfs-progs CLI utilities in the meanwhile libbtrfsutil has been developed and used by snapper. Not parsing CLI output and using the library functions should provide a more stable way to gather information from btrfs.
1 parent 4222e69 commit 7cadfa1

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

.packit.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ srpm_build_deps:
6262
- autoconf
6363
- autoconf-archive
6464
- automake
65+
- btrfs-progs-devel
6566
- cryptsetup-devel
6667
- device-mapper-devel
6768
- e2fsprogs-devel

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ AS_IF([test "x$with_fs" != "xno" -o "x$with_crypto" != "xno" -o "x$with_swap" !=
229229
[Define as neutral value if libblkid doesn't provide the definition])])]
230230
[])
231231

232+
AS_IF([test "x$with_btrfs" != "xno"],
233+
[LIBBLOCKDEV_PKG_CHECK_MODULES([LIBBTRFSUTIL], [libbtrfsutil >= 5.1])],
234+
[])
235+
232236
AS_IF([test "x$with_btrfs" != "xno" -o "x$with_mdraid" != "xno" -o "x$with_tools" != "xno"],
233237
[LIBBLOCKDEV_PKG_CHECK_MODULES([BYTESIZE], [bytesize >= 0.1])],
234238
[])

dist/libblockdev.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ with the libblockdev-utils library.
164164

165165
%if %{with_btrfs}
166166
%package btrfs
167-
BuildRequires: libbytesize-devel
167+
BuildRequires: libbytesize-devel btrfs-progs-devel
168168
Summary: The BTRFS plugin for the libblockdev library
169169
Requires: %{name}-utils%{?_isa} = %{version}-%{release}
170170
Requires: btrfs-progs

misc/install-test-dependencies.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
- name: Install build dependencies not covered by dnf builddep (Fedora)
3434
package: name={{item}} state=present
3535
with_items:
36+
- btrfs-progs-devel
3637
- libfdisk-devel
3738
- keyutils-libs-devel
3839
- libnvme-devel
@@ -162,6 +163,7 @@
162163
- name: Install build dependencies not covered by apt build-dep (Debian/Ubuntu)
163164
package: name={{item}} state=present
164165
with_items:
166+
- libbtrfsutil-dev
165167
- libfdisk-dev
166168
- libkeyutils-dev
167169
- libext2fs-dev

src/plugins/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ endif
6060

6161

6262
if WITH_BTRFS
63-
libbd_btrfs_la_CFLAGS = $(GLIB_CFLAGS) $(GIO_CFLAGS) $(BYTESIZE_CFLAGS) -Wall -Wextra -Werror
64-
libbd_btrfs_la_LIBADD = ${builddir}/../utils/libbd_utils.la $(GLIB_LIBS) $(GIO_LIBS) $(BYTESIZE_LIBS)
63+
libbd_btrfs_la_CFLAGS = $(GLIB_CFLAGS) $(GIO_CFLAGS) $(BYTESIZE_CFLAGS) $(LIBBTRFSUTIL_CFLAGS) -Wall -Wextra -Werror
64+
libbd_btrfs_la_LIBADD = ${builddir}/../utils/libbd_utils.la $(GLIB_LIBS) $(GIO_LIBS) $(BYTESIZE_LIBS) $(LIBBTRFSUTIL_LIBS)
6565
libbd_btrfs_la_LDFLAGS = -L${srcdir}/../utils/ -version-info 3:0:0 -Wl,--no-undefined -export-symbols-regex '^bd_.*'
6666
libbd_btrfs_la_CPPFLAGS = -I${builddir}/../../include/
6767
libbd_btrfs_la_SOURCES = btrfs.c btrfs.h check_deps.c check_deps.h

0 commit comments

Comments
 (0)