diff options
author | 2021-11-23 12:53:44 +0100 | |
---|---|---|
committer | 2021-11-23 15:59:08 +0100 | |
commit | f8e4b530f036795d002afe577679e034ff83c060 (patch) | |
tree | 2245b74c60848a6d07b132bb11a756c996a4b62a /sys-libs | |
parent | x11-misc/shared-mime-info: Drop 2.0-r2 (diff) | |
download | gentoo-f8e4b530f036795d002afe577679e034ff83c060.tar.gz gentoo-f8e4b530f036795d002afe577679e034ff83c060.tar.bz2 gentoo-f8e4b530f036795d002afe577679e034ff83c060.zip |
sys-libs/kpmcore: Do not destroy zfs pool when removing zfs partition
Upstream commit 282cfdcde179ec44d053b257e13aa715158596bd
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/kpmcore/files/kpmcore-21.08.3-dont-destroy-zfs-pool.patch | 46 | ||||
-rw-r--r-- | sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild | 38 |
2 files changed, 84 insertions, 0 deletions
diff --git a/sys-libs/kpmcore/files/kpmcore-21.08.3-dont-destroy-zfs-pool.patch b/sys-libs/kpmcore/files/kpmcore-21.08.3-dont-destroy-zfs-pool.patch new file mode 100644 index 000000000000..83cc15d0f2d5 --- /dev/null +++ b/sys-libs/kpmcore/files/kpmcore-21.08.3-dont-destroy-zfs-pool.patch @@ -0,0 +1,46 @@ +From 282cfdcde179ec44d053b257e13aa715158596bd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= <andrius@stikonas.eu> +Date: Sat, 30 Oct 2021 21:13:07 +0100 +Subject: [PATCH] Do not destroy zfs pool when removing zfs partition. + +This can be dangerous, e.g. if partition is part of raid set. +So better be more cautious and in some cases fail to remove partition +than lose data. +--- + src/fs/zfs.cpp | 7 ------- + src/fs/zfs.h | 1 - + 2 files changed, 8 deletions(-) + +diff --git a/src/fs/zfs.cpp b/src/fs/zfs.cpp +index 5d12894..5f4c87d 100644 +--- a/src/fs/zfs.cpp ++++ b/src/fs/zfs.cpp +@@ -77,13 +77,6 @@ qint64 zfs::maxCapacity() const + return Capacity::unitFactor(Capacity::Unit::Byte, Capacity::Unit::EiB); + } + +-bool zfs::remove(Report& report, const QString& deviceNode) const +-{ +- Q_UNUSED(deviceNode) +- ExternalCommand cmd(report, QStringLiteral("zpool"), { QStringLiteral("destroy"), QStringLiteral("-f"), label() }); +- return cmd.run(-1) && cmd.exitCode() == 0; +-} +- + bool zfs::writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) + { + Q_UNUSED(deviceNode) +diff --git a/src/fs/zfs.h b/src/fs/zfs.h +index 6e559de..61026c3 100644 +--- a/src/fs/zfs.h ++++ b/src/fs/zfs.h +@@ -35,7 +35,6 @@ public: + public: + void init() override; + +- bool remove(Report& report, const QString& deviceNode) const override; + bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override; + + CommandSupportType supportGetUsed() const override { +-- +GitLab + diff --git a/sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild b/sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild new file mode 100644 index 000000000000..e6a8ec725840 --- /dev/null +++ b/sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ECM_NONGUI="true" +KDE_GEAR="true" +KFMIN=5.84.0 +QTMIN=5.15.2 +inherit ecm kde.org + +DESCRIPTION="Library for managing partitions" +HOMEPAGE="https://apps.kde.org/partitionmanager/" + +LICENSE="GPL-3" +SLOT="5/10" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +IUSE="" + +# bug 689468, tests need polkit etc. +RESTRICT="test" + +DEPEND=" + >=dev-qt/qtdbus-${QTMIN}:5 + >=dev-qt/qtgui-${QTMIN}:5 + >=dev-qt/qtwidgets-${QTMIN}:5 + >=kde-frameworks/kcoreaddons-${KFMIN}:5 + >=kde-frameworks/ki18n-${KFMIN}:5 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 + >=sys-apps/util-linux-2.33.2 + sys-auth/polkit-qt +" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${P}-dont-destroy-zfs-pool.patch" +) |