Re: [PATCH instance-debootstrap] Fix sfdisk invocation for util-linux 2.26+

2016-05-26 Thread 'Iustin Pop' via ganeti-devel
2016-05-26 12:37 GMT+02:00 Brian Foley :

> On Thu, May 26, 2016 at 12:26:28PM +0200, 'Iustin Pop' via ganeti-devel
> wrote:
> > 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 
>
> LGTM. Iustin, do you still have push privileges, or would you like me to
> do it?
>

I don't anymore, so I please push it. I saw another small issue regarding
dependencies, so I'll send another patch in the next days, after which a
new release would be good.

thanks!
iustin


Re: [PATCH instance-debootstrap] Fix sfdisk invocation for util-linux 2.26+

2016-05-26 Thread 'Brian Foley' via ganeti-devel
On Thu, May 26, 2016 at 12:26:28PM +0200, 'Iustin Pop' via ganeti-devel wrote:
> 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 

LGTM. Iustin, do you still have push privileges, or would you like me to do it?

Cheers,
Brian.
> ---
>  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" < +  # Create one big partition, and make it bootable.
> +  local ARGS
> +  # Some versions of sfdisk need manual specification of head/sectors
> +  # for devices such as drbd which don't report geometry.
> +  if sfdisk --help | grep -q -e '--cylinders'; then
> +ARGS="-H 64 -S 32 -u S --Linux"
> +  fi
> +  sfdisk $ARGS --quiet "$1" <  ${PARTITION_ALIGNMENT},,L,*
>  EOF
>  }
> -- 
> 2.8.0.rc3.226.g39d4020
> 


[PATCH instance-debootstrap] Fix sfdisk invocation for util-linux 2.26+

2016-05-26 Thread 'Iustin Pop' via ganeti-devel
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 
---
 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" <