From 0f45429e7b957ef1513e79b1f4575154345c46da Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Thu, 26 May 2016 12:26:28 +0200 Subject: [PATCH] Fix sfdisk invocation for util-linux 2.26+ sfdisk changed in 2.26; it stopped supporting the geometry options (-C, -H, -S), deprecated -L and -u. However, we can't just drop these options, as pre-2.26 needs them for devices that don't report geometry (e.g. plain files). This patch changes the invocation of sfdisk based on what the `--help' output contains, as parsing the version number seems a bit more involved. Tested manually (not from Ganeti) with both 2.20, 2.25 and 2.28. The resulting partitioned disks have similarly-sized partitions, but the geometry information is different (as expected). This was reported in, and will fix, Ubuntu Launchpad bug LP#1577346. Signed-off-by: Iustin Pop Reviewed-by: Brian Foley --- common.sh.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common.sh.in b/common.sh.in index dd786af..bd7b260 100644 --- a/common.sh.in +++ b/common.sh.in @@ -87,11 +87,14 @@ get_api10_arguments() { } format_disk0() { - # Create one big partition, and make it bootable - # some versions of sfdisk need manual specification of - # head/sectors for devices such as drbd which don't - # report geometry - sfdisk -H 64 -S 32 -u S --quiet --Linux "$1" <