public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/btrfs-progs/, sys-fs/btrfs-progs/files/
Date: Thu,  5 Jan 2023 00:28:00 +0000 (UTC)	[thread overview]
Message-ID: <1672878451.205c9c405c1182613231e3564c678fb4855ac308.sam@gentoo> (raw)

commit:     205c9c405c1182613231e3564c678fb4855ac308
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  5 00:27:31 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jan  5 00:27:31 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=205c9c40

sys-fs/btrfs-progs: fix installed headers

Closes: https://bugs.gentoo.org/888579
Closes: https://bugs.gentoo.org/889694
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-fs/btrfs-progs/btrfs-progs-6.1.1-r1.ebuild     | 154 +++++++++++++++++++++
 .../files/btrfs-progs-6.1.1-ioctl-fix.patch        |  87 ++++++++++++
 2 files changed, 241 insertions(+)

diff --git a/sys-fs/btrfs-progs/btrfs-progs-6.1.1-r1.ebuild b/sys-fs/btrfs-progs/btrfs-progs-6.1.1-r1.ebuild
new file mode 100644
index 000000000000..e9f08a83a90e
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-6.1.1-r1.ebuild
@@ -0,0 +1,154 @@
+# Copyright 2008-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit bash-completion-r1 python-single-r1 udev
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+	MY_PV="v${PV/_/-}"
+	SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+
+	if [[ ${PV} != *_rc* ]] ; then
+		KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+	fi
+
+	S="${WORKDIR}"/${PN}-${MY_PV}
+else
+	EGIT_REPO_URI="https://github.com/kdave/btrfs-progs.git"
+	EGIT_BRANCH="devel"
+	WANT_LIBTOOL="none"
+	inherit autotools git-r3
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org https://btrfs.readthedocs.io/en/latest/"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert python +man reiserfs static static-libs udev +zstd"
+# Could support it with just !systemd => eudev, see mdadm, but let's
+# see if someone asks for it first.
+REQUIRED_USE="static? ( !udev )"
+
+# Tries to mount repaired filesystems
+RESTRICT="test"
+
+RDEPEND="
+	dev-libs/lzo:2=
+	sys-apps/util-linux:=[static-libs(+)?]
+	sys-libs/zlib:=
+	convert? (
+		sys-fs/e2fsprogs:=
+		reiserfs? (
+			>=sys-fs/reiserfsprogs-3.6.27
+		)
+	)
+	python? ( ${PYTHON_DEPS} )
+	udev? ( virtual/libudev:= )
+	zstd? ( app-arch/zstd:= )
+"
+DEPEND="${RDEPEND}
+	>=sys-kernel/linux-headers-5.10
+	convert? ( sys-apps/acl )
+	python? (
+		$(python_gen_cond_dep '
+			dev-python/setuptools[${PYTHON_USEDEP}]
+		')
+	)
+	static? (
+		dev-libs/lzo:2[static-libs(+)]
+		sys-apps/util-linux:0[static-libs(+)]
+		sys-libs/zlib:0[static-libs(+)]
+		convert? (
+			sys-fs/e2fsprogs[static-libs(+)]
+			reiserfs? (
+				>=sys-fs/reiserfsprogs-3.6.27[static-libs(+)]
+			)
+		)
+		zstd? ( app-arch/zstd[static-libs(+)] )
+	)
+"
+BDEPEND="virtual/pkgconfig
+	man? ( dev-python/sphinx )"
+
+if [[ ${PV} == 9999 ]]; then
+	BDEPEND+=" sys-devel/gnuconfig"
+fi
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-ioctl-fix.patch
+)
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	if [[ ${PV} == 9999 ]]; then
+		AT_M4DIR="m4" eautoreconf
+
+		mkdir config || die
+		local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+		[[ -e ${automakedir} ]] || die "Could not locate automake directory"
+
+		ln -s "${automakedir}"/install-sh config/install-sh || die
+		ln -s "${BROOT}"/usr/share/gnuconfig/config.guess config/config.guess || die
+		ln -s "${BROOT}"/usr/share/gnuconfig/config.sub config/config.sub || die
+	fi
+}
+
+src_configure() {
+	local myeconfargs=(
+		--bindir="${EPREFIX}"/sbin
+
+		--enable-lzo
+		--disable-experimental
+		$(use_enable convert)
+		$(use_enable man documentation)
+		$(use_enable elibc_glibc backtrace)
+		$(use_enable python)
+		$(use_enable static-libs static)
+		$(use_enable udev libudev)
+		$(use_enable zstd)
+
+		# Could support libgcrypt, libsodium, libkcapi
+		--with-crypto=builtin
+		--with-convert=ext2$(usex reiserfs ',reiserfs' '')
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+	emake V=1 all $(usev static)
+}
+
+src_install() {
+	local makeargs=(
+		$(usex python install_python '')
+		$(usex static install-static '')
+	)
+
+	emake V=1 DESTDIR="${D}" install "${makeargs[@]}"
+
+	newbashcomp btrfs-completion btrfs
+
+	use python && python_optimize
+}
+
+pkg_postinst() {
+	udev_reload
+}
+
+pkg_postrm() {
+	udev_reload
+}

diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-6.1.1-ioctl-fix.patch b/sys-fs/btrfs-progs/files/btrfs-progs-6.1.1-ioctl-fix.patch
new file mode 100644
index 000000000000..d8149b6220ef
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-6.1.1-ioctl-fix.patch
@@ -0,0 +1,87 @@
+https://bugs.gentoo.org/888579
+https://bugs.gentoo.org/889694
+https://github.com/kdave/btrfs-progs/issues/566
+https://github.com/kdave/btrfs-progs/commit/27bb4f6819df6ad7771e089e1fd3f1bd1163e437
+
+From 27bb4f6819df6ad7771e089e1fd3f1bd1163e437 Mon Sep 17 00:00:00 2001
+From: David Sterba <dsterba@suse.com>
+Date: Wed, 4 Jan 2023 16:34:51 +0100
+Subject: [PATCH] btrfs-progs: libbtrfs: revert to v6.0.2 ioctl.h
+
+The file ioctl.h has been copied to libbtrfs in 5fc1d0cd64ee
+("btrfs-progs: copy ioctl.h into libbtrfs") but that was after changes
+to the btrfs_qgroup_limit in 03451430de7c ("btrfs-progs: rename qgroup
+items to match the kernel naming scheme"). This caused build breakage
+but hasn't been fixed in v6.1.1.
+
+Revert the contents of libbtrfs/ioctl.h to be completely just v6.0.2
+though the other changes may not be needed, it's the version we know
+works.
+
+Issue: #566
+Signed-off-by: David Sterba <dsterba@suse.com>
+--- a/libbtrfs/ioctl.h
++++ b/libbtrfs/ioctl.h
+@@ -71,10 +71,10 @@ BUILD_ASSERT(sizeof(struct btrfs_ioctl_vol_args) == 4096);
+ 
+ struct btrfs_qgroup_limit {
+ 	__u64	flags;
+-	__u64	max_rfer;
+-	__u64	max_excl;
+-	__u64	rsv_rfer;
+-	__u64	rsv_excl;
++	__u64	max_referenced;
++	__u64	max_exclusive;
++	__u64	rsv_referenced;
++	__u64	rsv_exclusive;
+ };
+ BUILD_ASSERT(sizeof(struct btrfs_qgroup_limit) == 40);
+ 
+@@ -192,6 +192,7 @@ BUILD_ASSERT(sizeof(struct btrfs_ioctl_dev_replace_status_params) == 48);
+ #define BTRFS_IOCTL_DEV_REPLACE_CMD_START			0
+ #define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS			1
+ #define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL			2
++#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_RESULT		-1
+ #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR			0
+ #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED		1
+ #define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED		2
+@@ -934,6 +935,38 @@ enum btrfs_err_code {
+ 	BTRFS_ERROR_DEV_RAID1C4_MIN_NOT_MET,
+ };
+ 
++/* An error code to error string mapping for the kernel
++*  error codes
++*/
++static inline char *btrfs_err_str(enum btrfs_err_code err_code)
++{
++	switch (err_code) {
++		case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
++			return "unable to go below two devices on raid1";
++		case BTRFS_ERROR_DEV_RAID1C3_MIN_NOT_MET:
++			return "unable to go below three devices on raid1c3";
++		case BTRFS_ERROR_DEV_RAID1C4_MIN_NOT_MET:
++			return "unable to go below four devices on raid1c4";
++		case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
++			return "unable to go below four/two devices on raid10";
++		case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
++			return "unable to go below two devices on raid5";
++		case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
++			return "unable to go below three devices on raid6";
++		case BTRFS_ERROR_DEV_TGT_REPLACE:
++			return "unable to remove the dev_replace target dev";
++		case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
++			return "no missing devices found to remove";
++		case BTRFS_ERROR_DEV_ONLY_WRITABLE:
++			return "unable to remove the only writeable device";
++		case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
++			return "add/delete/balance/replace/resize operation "
++				"in progress";
++		default:
++			return NULL;
++	}
++}
++
+ #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
+ 				   struct btrfs_ioctl_vol_args)
+ #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
+


             reply	other threads:[~2023-01-05  0:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05  0:28 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-05 20:37 [gentoo-commits] repo/gentoo:master commit in: sys-fs/btrfs-progs/, sys-fs/btrfs-progs/files/ Sam James
2023-09-02 16:21 Sam James
2023-05-05  7:04 Sam James
2021-12-31  2:50 Sam James
2021-01-16 19:28 Lars Wendler
2018-11-10 21:45 Sergei Trofimovich
2018-08-06 17:58 Mike Gilbert
2018-04-12  9:42 Sergei Trofimovich
2017-03-31 20:53 Sergei Trofimovich
2016-10-24  8:20 Sergei Trofimovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1672878451.205c9c405c1182613231e3564c678fb4855ac308.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox