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

Scott Moser smoser at ubuntu.com
Thu May 23 19:52:25 UTC 2013


On Fri, 24 May 2013, Thomas Goirand wrote:

> Hi Scott!
>
> I'm continuing my work to build Debian cloud images. Doing so, I've been
> using cloud-initramfs-tools which Julien Danjou packaged. Unfortunately,
> it didn't work, so I investigated and tried to debug it.
>
> So I started adding some debug things, and here's what I saw:
> http://thomas.goirand.fr/growpart.png
>
> First of all, there is this:
>
> "GROWROOT: unexpected output: trap: EXIT: bad trap

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.

> This seem to happen when the --dry-run test is happening. I have no idea
> why. Any idea?
>
> Of course, this is breaking what's after (eg: the check of the output).
> But also, in Debian, it isn't "CHANGE:" but "CHANGED:", so even if the
> test was running ok, it would still fail.

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

> So, what I did was disabling the test, and it always worked. I think
> that having such output testing is quite dangerous, and I see no reason
> why you would do it. Why don't you just let it run if the return value
> of the test is zero?

I dont understand how its dangerous.
The 'growpart' utility will either fail unexpectedly and exit non-zero, or
succeed and exit 0.  Its very careful.

> I've seen that in your latest version (we still run with version 0.18 in
> Debian Sid), you've changed from:
>
> case "${out}" in
> 	CHANGE:*) :;;
> 	*) exit 0;;
>
> to:
>
> case "$ret:$out" in
> 	0:CHANGE:*) :;;
> 	[01]:NOCHANGE:*) exit 0;;
> 	*) msg "exited '$ret'" "${out}"; exit 1;;
>
> While this has a better change to work, this would still fail in Debian,
> because of the "CHANGED:" with the added D char.
>
> 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?  Ie, i
dont want or need "the real awk" or "the real sed".  The versions from
busybox are fine.

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

>
> I have attached the patch for you to see, but that's quite trivial, if
> you know the above.
>
> Your thoughts?
>
> Cheers,
>
> Thomas Goirand (zigo)
>




More information about the Openstack-devel mailing list