[Openstack-devel] cloud-initramfs-tools growroot bug in Debian

Thomas Goirand thomas at goirand.fr
Fri May 24 03:20:41 UTC 2013


Hi Scott,

thanks for your very fast reply!

On Fri May 24 2013 03:52:25 AM CST, Scott Moser <smoser at ubuntu.com> wrote:
> On Fri, 24 May 2013, Thomas Goirand wrote:
> This is probably whatever your /bin/sh is doesn't like:
>     'trap cleanup EXIT'
> dash, busybox's sh (at least as built by ubuntu in busybox-initramfs and
> busybox-static), and bash all are OK with that.
> 
> You can try changing that to 'trap cleanup 0' in growpart.

I will try and let you know.

> growpart in dryrun says 'CHANGE' when in dry-run mode, but 'CHANGED'
> when it actually changes something.   i think it always has.

Maybe I got confused by the bad exit then.

> I dont understand how its dangerous.

Because if for any reason the output isn't what you
expect (like it happened to me), then it breaks
everything.

> The 'growpart' utility will either fail unexpectedly and exit non-zero,
> or succeed and exit 0.   Its very careful.

Checking return values is fine, IMHO, but not the
output text.

> > Another problem I have found is that in Debian, the sed and awk utility
> > aren't present. So I added them in your growroot initramfs hook.
> 
>  please open a bug. i'm not sure what the right way to handle that is.
> does 'copy_exec' handle using busybox functionality if its there?

I don't think so. If I produce a patch that does a
dpkg-vendor --derive-from ubuntu to handle this
gracefully, will you accept it?

> Ie, i
> dont want or need "the real awk" or "the real sed".   The versions from
> busybox are fine.

Yeah, I agree. Especially that it will also copy
few "heavy" (in the view of an embedded tiny RAMFS)
libs.

Though of course the issue is that it doesn't seem
to be in the busybox of Debian. Do you think it
would be possible to not use sed and awk at all in
the growroot scripts? That would solve the problem
in a much cleaner way.

> it doesn't look to me like it does, but I might be missing something.

It is well possible that the Ubuntu RAMFS busybox 
has it compiled-in and not the Debian one.

Cheers,

Thomas (from my phone)

p.s: any news from the live-build thing we discussed
earlier? Because you didn't answer, I just built a
small script instead of using live-build, but I
really wish we could unify our efforts, merge your
work into live-build 4.x, etc.




More information about the Openstack-devel mailing list