From a2b9834ec9b817e32772ddc27bc6b55fab33670c Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 23 May 2018 21:24:52 +0300 Subject: btrfs-tools: upgrade 4.15.1 -> 4.16.1 Drop upstreamed patch. Add a patch to correctly set LDFLAGS for one of the libraries and Python bindings. Add dependencies to build Python bindings (directly inheriting setuptools3 class does not work, as the build is Makefile-managed) and a snippet to install them. Also add a patch to allow specifying where they are installed (to avoid hardcoded /usr/lib default). Signed-off-by: Alexander Kanavin Signed-off-by: Ross Burton --- ...Add-LDFLAGS-when-building-libbtrfsutil.so.patch | 35 +++++++++++ ...bility-to-specify-where-python-modules-ar.patch | 25 ++++++++ .../btrfs-tools/btrfs-tools/ftw-subdir-walk.patch | 69 ---------------------- .../btrfs-tools/btrfs-tools_4.15.1.bb | 39 ------------ .../btrfs-tools/btrfs-tools_4.16.1.bb | 44 ++++++++++++++ 5 files changed, 104 insertions(+), 108 deletions(-) create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-a-possibility-to-specify-where-python-modules-ar.patch delete mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/ftw-subdir-walk.patch delete mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools_4.15.1.bb create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools_4.16.1.bb diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch new file mode 100644 index 0000000000..a8fcfc0f73 --- /dev/null +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch @@ -0,0 +1,35 @@ +From eecc48ecad359cd4fab650ce49cfe57e99d1859d Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Thu, 17 May 2018 12:21:31 +0300 +Subject: [PATCH] Add LDFLAGS when building libbtrfsutil.so and python + bindings. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin + +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 10f0e3b0..1697794c 100644 +--- a/Makefile ++++ b/Makefile +@@ -402,7 +402,7 @@ libbtrfsutil/%.o: libbtrfsutil/%.c + + libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects) + @echo " [LD] $@" +- $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) $(libbtrfsutil_objects) \ ++ $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) $(LDFLAGS) $(libbtrfsutil_objects) \ + -shared -Wl,-soname,libbtrfsutil.so.$(libbtrfsutil_major) -o $@ + + libbtrfsutil.a: $(libbtrfsutil_objects) +@@ -417,7 +417,7 @@ ifeq ($(PYTHON_BINDINGS),1) + libbtrfsutil_python: libbtrfsutil.so.$(libbtrfsutil_major) libbtrfsutil.so libbtrfsutil/btrfsutil.h + @echo " [PY] libbtrfsutil" + $(Q)cd libbtrfsutil/python; \ +- CFLAGS= LDFLAGS= $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build ++ CFLAGS= $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build + + .PHONY: libbtrfsutil_python + endif diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-a-possibility-to-specify-where-python-modules-ar.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-a-possibility-to-specify-where-python-modules-ar.patch new file mode 100644 index 0000000000..5846f04d1a --- /dev/null +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-a-possibility-to-specify-where-python-modules-ar.patch @@ -0,0 +1,25 @@ +From d3adfc21c9cc264bd191722f102963cbc4794259 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Wed, 23 May 2018 21:20:35 +0300 +Subject: [PATCH] Add a possibility to specify where python modules are + installed + +Upstream-Status: Inappropriate [oe-core specific to solve multilib use case] +Signed-off-by: Alexander Kanavin +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 1697794c..8ab38818 100644 +--- a/Makefile ++++ b/Makefile +@@ -651,7 +651,7 @@ endif + ifeq ($(PYTHON_BINDINGS),1) + install_python: libbtrfsutil_python + $(Q)cd libbtrfsutil/python; \ +- $(PYTHON) setup.py install --skip-build $(if $(DESTDIR),--root $(DESTDIR)) --prefix $(prefix) ++ $(PYTHON) setup.py install --skip-build $(if $(DESTDIR),--root $(DESTDIR)) --prefix $(prefix) --install-lib=$(PYTHON_SITEPACKAGES_DIR) + + .PHONY: install_python + endif diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/ftw-subdir-walk.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/ftw-subdir-walk.patch deleted file mode 100644 index fbe0c47849..0000000000 --- a/meta/recipes-devtools/btrfs-tools/btrfs-tools/ftw-subdir-walk.patch +++ /dev/null @@ -1,69 +0,0 @@ -From patchwork Wed Mar 28 06:39:09 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: btrfs-progs: mkfs/rootdir: Don't follow symbolic link when calcuating - size -From: Qu Wenruo -X-Patchwork-Id: 10312225 -Message-Id: <20180328063909.937-1-wqu@suse.com> -To: linux-btrfs@vger.kernel.org -Date: Wed, 28 Mar 2018 14:39:09 +0800 - -[BUG] -If we have a symbolic link in rootdir pointing to non-existing location, -mkfs.btrfs --rootdir will just fail: ------- -$ mkfs.btrfs -f --rootdir /tmp/rootdir/ /dev/data/btrfs -btrfs-progs v4.15.1 -See http://btrfs.wiki.kernel.org for more information. - -ERROR: ftw subdir walk of /tmp/rootdir/ failed: No such file or directory ------- - -[CAUSE] -Commit 599a0abed564 ("btrfs-progs: mkfs/rootdir: Use over-reserve method -to make size estimate easier") add extra ftw walk to estimate the -filesystem size. - -Such default ftw walk will follow symbolic link and gives ENOENT error. - -[FIX] -Use nftw() to specify FTW_PHYS so we won't follow symbolic link for size -calculation. - -Reported-by: Alexander Kanavin -Fixes: 599a0abed564 ("btrfs-progs: mkfs/rootdir: Use over-reserve method to make size estimate easier") -Signed-off-by: Qu Wenruo -Upstream-Status: Submitted [https://patchwork.kernel.org/patch/10312225/] ---- - mkfs/rootdir.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/mkfs/rootdir.c b/mkfs/rootdir.c -index a1d223a2408a..33c3ff1e18cf 100644 ---- a/mkfs/rootdir.c -+++ b/mkfs/rootdir.c -@@ -696,7 +696,7 @@ out: - } - - static int ftw_add_entry_size(const char *fpath, const struct stat *st, -- int type) -+ int type, struct FTW *ftwbuf) - { - /* - * Failed to read the directory, mostly due to EPERM. Abort ASAP, so -@@ -731,7 +731,12 @@ u64 btrfs_mkfs_size_dir(const char *dir_name, u32 sectorsize, u64 min_dev_size, - fs_block_size = sectorsize; - ftw_data_size = 0; - ftw_meta_nr_inode = 0; -- ret = ftw(dir_name, ftw_add_entry_size, 10); -+ -+ /* -+ * Symbolic link is not followed when creating files, so no need to -+ * follow them here. -+ */ -+ ret = nftw(dir_name, ftw_add_entry_size, 10, FTW_PHYS); - if (ret < 0) { - error("ftw subdir walk of %s failed: %s", dir_name, - strerror(errno)); diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.15.1.bb b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.15.1.bb deleted file mode 100644 index f7ea27321c..0000000000 --- a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.15.1.bb +++ /dev/null @@ -1,39 +0,0 @@ -SUMMARY = "Checksumming Copy on Write Filesystem utilities" -DESCRIPTION = "Btrfs is a new copy on write filesystem for Linux aimed at \ -implementing advanced features while focusing on fault tolerance, repair and \ -easy administration. \ -This package contains utilities (mkfs, fsck, btrfsctl) used to work with \ -btrfs and an utility (btrfs-convert) to make a btrfs filesystem from an ext3." - -HOMEPAGE = "https://btrfs.wiki.kernel.org" - -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067" -SECTION = "base" -DEPENDS = "util-linux attr e2fsprogs lzo acl" -DEPENDS_append_class-target = " udev" -RDEPENDS_${PN} = "libgcc" - -SRCREV = "3097f02c948f69f520c565ff8f8ba476aa6edb88" -SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \ - file://0001-Makefile-build-mktables-using-native-gcc.patch \ - file://ftw-subdir-walk.patch \ - " - -inherit autotools-brokensep pkgconfig manpages - -CLEANBROKEN = "1" - -PACKAGECONFIG[manpages] = "--enable-documentation, --disable-documentation, asciidoc-native xmlto-native" -EXTRA_OECONF = " --disable-zstd" -EXTRA_OECONF_append_libc-musl = " --disable-backtrace " - -do_configure_prepend() { - # Upstream doesn't ship this and autoreconf won't install it as automake isn't used. - mkdir -p ${S}/config - cp -f $(automake --print-libdir)/install-sh ${S}/config/ -} - -S = "${WORKDIR}/git" - -BBCLASSEXTEND = "native" diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.16.1.bb b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.16.1.bb new file mode 100644 index 0000000000..d175959309 --- /dev/null +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.16.1.bb @@ -0,0 +1,44 @@ +SUMMARY = "Checksumming Copy on Write Filesystem utilities" +DESCRIPTION = "Btrfs is a new copy on write filesystem for Linux aimed at \ +implementing advanced features while focusing on fault tolerance, repair and \ +easy administration. \ +This package contains utilities (mkfs, fsck, btrfsctl) used to work with \ +btrfs and an utility (btrfs-convert) to make a btrfs filesystem from an ext3." + +HOMEPAGE = "https://btrfs.wiki.kernel.org" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067" +SECTION = "base" +DEPENDS = "util-linux attr e2fsprogs lzo acl python3-setuptools-native" +DEPENDS_append_class-target = " udev" +RDEPENDS_${PN} = "libgcc" + +SRCREV = "f7fc27cb20924cc340a2a522655969253dd97ae9" +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \ + file://0001-Makefile-build-mktables-using-native-gcc.patch \ + file://0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch \ + file://0001-Add-a-possibility-to-specify-where-python-modules-ar.patch \ + " + +inherit autotools-brokensep pkgconfig manpages distutils3-base + +CLEANBROKEN = "1" + +PACKAGECONFIG[manpages] = "--enable-documentation, --disable-documentation, asciidoc-native xmlto-native" +EXTRA_OECONF = " --disable-zstd" +EXTRA_OECONF_append_libc-musl = " --disable-backtrace " + +do_configure_prepend() { + # Upstream doesn't ship this and autoreconf won't install it as automake isn't used. + mkdir -p ${S}/config + cp -f $(automake --print-libdir)/install-sh ${S}/config/ +} + +S = "${WORKDIR}/git" + +do_install_append() { + oe_runmake 'DESTDIR=${D}' 'PYTHON_SITEPACKAGES_DIR=${PYTHON_SITEPACKAGES_DIR}' install_python +} + +BBCLASSEXTEND = "native" -- cgit 1.2.3-korg