[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#783826: cloud-utils growroot doesn't work with newer sfdisk >= 2.26 : fixed patch solution for newer and older sfdisk



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.

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.

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.

> 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)
>


Reply to: