[PKG-Openstack-devel] cloud-utils growroot doesn't work with newer sfdisk >= 2.26 : fixed patch solution for newer and older sfdisk

Juerg Haefliger juerg.haefliger at hp.com
Mon May 4 18:22:05 UTC 2015


On 05/04/2015 06:48 PM, Scott Moser wrote:
> On Mon, 4 May 2015, Thomas Goirand wrote:
> 
>> Hi Scott and Juerg,
>>
>> Someone has filed this bug in Debian:
>> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783826
>>
>> Unfortunately, the patch here:
>> http://pkgs.fedoraproject.org/cgit/cloud-utils.git/plain/0002-Support-new-sfdisk-version-2.26.patch
>>
>> doesn't work with the older sfdisk, currently in Sid, but works with version
>> 2.26 only.
>>
>> To make a smooth transition, best would be to make a conditional test, and
>> check if we're running with util-linux 2.25, or >= 2.26. This would also allow
>> newer cloud-utils to be backported to Jessie.
> 
> Juerg's 'Support-new-sfdisk-version-2.26.patch' seems to do 4 things:
> 
> a.) drop use of MBR_CHS, which I think is probably no longer necessary.
> this was originally added when dealing with loop devices, but might not be
> necessary with --unit=S.

>From the manpage of sfdisk 2.26:
-u, --unit S
   Deprecated option.  Only the sector unit is supported.


> b.) obtain 'tot' (the total size in sectors) of the disk differently
>    sfdisk --list
>  rather than
>    tot=$$((cyl*$heads*$sectors)
> 
> c.) use dd to restore the original in case of failure.
> 
>   I suspect that you're working around upstream sfdisk bug 1211405 here.
>    https://bugzilla.redhat.com/show_bug.cgi?id=1211405
> 
>  I'd rather not make assumptions on the output format of '-O'.  Using '-I'
>  and expecting sfdisk to do the right thing seems safer.

I agree that the assumption on the filename is ugly and might need
rework but there is no -I option anymore and -O only lets you specify
the fist part of the filename.

>From the manpage:

-O, --backup-file path
   Override the default backup file name.  Note that the device name and
offset are always appended to the file name.

Note that sfdisk since version 2.26 no longer provides the -I option to
restore sectors.  dd (1) provides all necessary functionality.


> d.) removal of use of --unit=S
>   util-linux 2.26 seems to support this, so I'd just as soon leave it for
> now.

Ok.

...Juerg


>> This is what I've done on the attached patch. Scott, could you please use that
>> upstream from now on?
>>
>> Also, what about the do-not-use-EXIT-when-trapping.patch patch which I had to
>> add in Debian? Could you please apply them both?
> 
> EXIT is posix compatible. you really should change the shell to be posix
> compatible rather than changing all programs to expect a subset of poxix
> shell.
>   http://pubs.opengroup.org/onlinepubs/000095399/utilities/trap.html
> 
> 
> I'll work something up upstream probably based on checking the sfdisk
> version.
> 
> 
>>
>> Cheers,
>>
>> Thomas Goirand (zigo)
>>


-- 
Juerg Haefliger
Hewlett-Packard



More information about the Openstack-devel mailing list