[Pkg-ganeti-devel] [instance-debootstrap] 01/02: Skip newer sfdisk's check using the BLKRRPART ioctl
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Wed May 3 14:01:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository instance-debootstrap.
commit 417e081214454f135ca9aea675ceb34a7793a1ba
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date: Wed May 3 16:43:44 2017 +0300
Skip newer sfdisk's check using the BLKRRPART ioctl
Newer sfdisk versions (>= 2.26) issue a BLKRRPART ioctl to check if a device
is in use prior to partitioning it. However, the BLKRRPART ioctl may fail for
a number of other reasons, including when a device is allocated as
non-partitionable using alloc_disk(1). Since DRBD and LVM devices are
allocated as non-partionable, sfdisk will always think they're busy and fail.
Since we're dealing with DRBD and LVM devices mostly, we need to work our way
around this and pass `--no-reread` if sfdisk supports it.
Closes: #853167
---
debian/patches/fix-sfdisk-BLKRRPART.patch | 27 +++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 28 insertions(+)
diff --git a/debian/patches/fix-sfdisk-BLKRRPART.patch b/debian/patches/fix-sfdisk-BLKRRPART.patch
new file mode 100644
index 0000000..040fd1f
--- /dev/null
+++ b/debian/patches/fix-sfdisk-BLKRRPART.patch
@@ -0,0 +1,27 @@
+Author: Apollon Oikonomopoulos <apoikos at debian.org>
+Description: Skip newer sfdisk's check using the BLKRRPART ioctl
+ Newer sfdisk versions (>= 2.26) issue a BLKRRPART ioctl to check if a device
+ is in use prior to partitioning it. However, the BLKRRPART ioctl may fail for
+ a number of other reasons, including when a device is allocated as
+ non-partitionable using alloc_disk(1). Since DRBD and LVM devices are
+ allocated as non-partionable, sfdisk will always think they're busy and fail.
+ .
+ Since we're dealing with DRBD and LVM devices mostly, we need to work our way
+ around this and pass `--no-reread` if sfdisk supports it.
+Forwarded: no
+Last-Update: 2017-05-03
+Bug-Debian: https://bugs.debian.org/853167
+--- a/common.sh.in
++++ b/common.sh.in
+@@ -94,6 +94,11 @@
+ if sfdisk --help | grep -q -e '--cylinders'; then
+ ARGS="-H 64 -S 32 -u S --Linux"
+ fi
++ # Some versions of sfdisk need to be told to skip checking using ioctl(dev,
++ # BLKRRPART), as this always fails for DRBD and LVM devices.
++ if sfdisk --help | fgrep -q '--no-reread'; then
++ ARGS="--no-reread $ARGS"
++ fi
+ sfdisk $ARGS --quiet "$1" <<EOF
+ ${PARTITION_ALIGNMENT},,L,*
+ EOF
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c2b87af
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-sfdisk-BLKRRPART.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/instance-debootstrap.git
More information about the Pkg-ganeti-devel
mailing list