summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-11-23 12:55:23 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2021-11-23 15:59:08 +0100
commitc754c5765d86b3b9f76bb1622376ece718dac2e6 (patch)
tree82f3cdee08bcc2bc73b73891ca5d32f507b45ef4 /sys-libs/kpmcore
parentsys-libs/kpmcore: Do not destroy zfs pool when removing zfs partition (diff)
downloadgentoo-c754c5765d86b3b9f76bb1622376ece718dac2e6.tar.gz
gentoo-c754c5765d86b3b9f76bb1622376ece718dac2e6.tar.bz2
gentoo-c754c5765d86b3b9f76bb1622376ece718dac2e6.zip
sys-libs/kpmcore: Fix seek error when shredding partition
Upstream commit e9fc875c5e233401afd12f54ab0472c66ff6fdff Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'sys-libs/kpmcore')
-rw-r--r--sys-libs/kpmcore/files/kpmcore-21.08.3-fix-seek-error-when-shred-partition.patch27
-rw-r--r--sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild1
2 files changed, 28 insertions, 0 deletions
diff --git a/sys-libs/kpmcore/files/kpmcore-21.08.3-fix-seek-error-when-shred-partition.patch b/sys-libs/kpmcore/files/kpmcore-21.08.3-fix-seek-error-when-shred-partition.patch
new file mode 100644
index 000000000000..568db790c7e9
--- /dev/null
+++ b/sys-libs/kpmcore/files/kpmcore-21.08.3-fix-seek-error-when-shred-partition.patch
@@ -0,0 +1,27 @@
+From e9fc875c5e233401afd12f54ab0472c66ff6fdff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= <andrius@stikonas.eu>
+Date: Fri, 12 Nov 2021 01:02:15 +0000
+Subject: [PATCH] Fix seek error when filling device with random data or
+ zeroes.
+
+---
+ src/util/externalcommandhelper.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp
+index 6e61aba..0fa400d 100644
+--- a/src/util/externalcommandhelper.cpp
++++ b/src/util/externalcommandhelper.cpp
+@@ -80,7 +80,8 @@ bool ExternalCommandHelper::readData(const QString& sourceDevice, QByteArray& bu
+ return false;
+ }
+
+- if (!device.seek(offset)) {
++ // Sequential devices such as /dev/zero or /dev/urandom return false on seek().
++ if (!device.isSequential() && !device.seek(offset)) {
+ qCritical() << xi18n("Could not seek position %1 on device <filename>%2</filename>.", offset, sourceDevice);
+ return false;
+ }
+--
+GitLab
+
diff --git a/sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild b/sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild
index e6a8ec725840..86312befca73 100644
--- a/sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild
+++ b/sys-libs/kpmcore/kpmcore-21.08.3-r1.ebuild
@@ -35,4 +35,5 @@ BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}/${P}-dont-destroy-zfs-pool.patch"
+ "${FILESDIR}/${P}-fix-seek-error-when-shred-partition.patch"
)