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

Scott Moser smoser at ubuntu.com
Fri May 24 13:25:42 UTC 2013


On Fri, 24 May 2013, Thomas Goirand wrote:

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

But it did the right thing.  It exited without changing anything.
An unexpected error was encountered and it took the safe way out.

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

A initramfs build-time change would be fine, maybe we should file a bug /
feature request for initramfs to be able to determine this in a clean way.

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

I'm not interested in rewriting growpart to not depend on awk and sed.
You're welcome to try, but I suspect it is non-trivial.

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

I thought I had replied, sorry.
Our build system works, and is very low maintenance.  The only significant
effort we had over the past 4 years was in moving from vm-builder to
live-build.

If I had to put any amount of effort into our image build system, to me
the right way seems to be to move it to use oz
(https://github.com/clalancette/oz/wiki).  Any "image build" is really
"operating system install".  Oz builds images by controlling OS install
rather than writing and maintaining "another installer".


More information about the Openstack-devel mailing list