ostroproject / ostro-os

Ostro OS
Other
93 stars 43 forks source link

Fatal QA error with `ostro-image-swupd` #217

Closed sysarcher closed 7 years ago

sysarcher commented 7 years ago

Hello everybody,

I'm getting the following error while doing swupd builds if I have OSTRO_IMAGE_EXTRA_FEATURES defined (see my local.conf here: https://gist.github.com/shrmrf/cdac935fab6175aac9734604f04ccbc3#file-local-conf-sh-L147)

The line highlighted in the link above is what seems to cause the problems. If I comment it out, then we do not get this error. The error log is pasted below...

ERROR: ostro-image-swupd-1.0-r0 do_image: Dangling symlink: /build-big/build-galileo/ostro-os/build/tmp-glibc/work/intel_quark-ostro-linux/ostro-image-swupd/1.0-r0/rootfs/bin/getopt -> /bin/getopt.util-linux -> /build-big/build-galileo/ostro-os/build/tmp-glibc/work/intel_quark-ostro-linux/ostro-image-swupd/1.0-r0/rootfs/bin/getopt.util-linux does not resolve to a valid filesystem entry.
ERROR: ostro-image-swupd-1.0-r0 do_image: Fatal QA errors found, failing task.
ERROR: ostro-image-swupd-1.0-r0 do_image: Function failed: ostro_qa_image
ERROR: Logfile of failure stored in: /build-big/build-galileo/ostro-os/build/tmp-glibc/work/intel_quark-ostro-linux/ostro-image-swupd/1.0-r0/temp/log.do_image.5467
ERROR: Task (/build-big/build-galileo/ostro-os/meta-ostro/recipes-image/images/ostro-image-swupd.bb:do_image) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4571 tasks of which 4556 didn't need to be rerun and 1 failed.
sysarcher commented 7 years ago

to be clear, the issue does not happen with noswupd builds.

gvancuts commented 7 years ago

Hi @shrmrf , just to be sure, are you saying the error goes away if you comment out the line defining OSTRO_ROOT_AUTHORIZED_KEYS?

sysarcher commented 7 years ago

Hello @gvancuts ... sorry, I had the wrong link (from another issue I tried to help out on)... I've fixed the link. I commented out OSTRO_IMAGE_EXTRA_FEATURES line.

Sorry for the wrong link.

gvancuts commented 7 years ago

No worries @shrmrf , thanks for the clarification. I've just taken a quick look at the recipe for util-linux (which provides /bin/getopt.util-linux) but I don't see anything obviously wrong in it. I'll need to test this a bit unless others have an idea as to what's causing this.

It's curious that the noswupd image does not exhibit this problem... perhaps swupd-client messes things up when it comes to getopt?!

sysarcher commented 7 years ago

Hey @gvancuts ... Can't say anything but... I just observed that if I remove tools-sdk and use OSTRO_IMAGE_EXTRA_FEATURES = "dev-pkgs dbg-pkgs" instead, the error does not occur. Might help us narrow down the problem... (but you're the expert)

sysarcher commented 7 years ago

Yup, I can confirm the behavior. Adding tools-sdk to this list causes the Dangling symlink.

mythi commented 7 years ago

@shrmrf And is it still the case that noswupd works but with swupd you get the sanity check error?

sysarcher commented 7 years ago

@mythi yes. Like I said here, seems to be the tools-sdk ... If I remove this feature, the swupd image build throws no QA issue.

sysarcher commented 7 years ago

Any idea on why I might be seeing this problem adding tools-sdk to the swupd image?

gvancuts commented 7 years ago

I don't have a good idea yet but based on my investigation so far I suspect something not set properly between busybox (which is the provider of getopt in Ostro) and util-linux. It looks like in general, we do have a few sub-packages from util-linux being installed but never the util-linux-getopt. Why is that one pulled in when you add tools-sdk to your image is still beyond me.

gvancuts commented 7 years ago

I'm getting a little lost trying to understand what is happening. We do some on-the-fly modifications with regards to priorities when there are multiple packages providing the same functionalities... based on my reading, util-linux has a higher alternative (in Ostro) than busybox and is installed by default. But based on that, I do not understand why util-linux-getopt is not installed in our images.

Assuming my understanding is plainly wrong (or at best incomplete) as to why getopt is not provided by util-linux always... I'm left with the observation that it is not except in your case (and only when adding tools-sdk to the swupd image). Perhaps something pulls this in more specifically via tools-sdk. Looking at that a little got me looking into quilt (its -ptest package RDEPENDS on util-linux-getopt.

Anyway, I'm hoping @mythi or @pohly can chime in on this one...

pohly commented 7 years ago

On Thu, 2016-12-22 at 23:09 -0800, T wrote:

Any idea on why I might be seeing this problem adding tools-sdk to the image?

I suspect (but haven't verified because I am still on vacation) that the extra components (in particular, util-linux) get added to the bundle-ostro-image-swupd-mega image (aka the "full image") but not to ostro-image-swupd (aka core-os bundle).

The /bin/getopt then has the value from bundle-ostro-image-swupd-mega also in the ostro-image-swupd, but the file it points to isn't in the core-os.

That breaks only when using swupd, normal images just use whatever is installed in them.

I don't know why using OSTRO_IMAGE_EXTRA_FEATURES has this effect. I'd expect it to affect all images and thus also the core-os - needs further investigation.

sysarcher commented 7 years ago

Hello @pohly yeah... have fun during the holidays 👍

I've decided over the holidays to Ostro-cize the Gateway solution at our startup which is based on top of the Intel Galileo platform. Yaay! (really happy with the noswupd images until now. looking forward to setting up an upgrade system on our servers)

pohly commented 7 years ago

The chain of events leading to the failure is:

I'm tempted to blame quilt-ptest here. Installing a test package should not change core OS behavior like the implementation of /usr/bin/getopt.

But let's give it the benefit of the doubt and assume that testing really needs the full getopt and can't be made to work with busybox getopt. In that case the solution is to ensure that util-linux-getopt is part of the OS core, with:

Required by quilt-ptest in "dev" bundle. /usr/bin/getopt is part

of the core-os bundle and thus util-linux-getopt has to be installed

in all images.

OSTRO_IMAGE_EXTRA_INSTALL += "util-linux-getopt"

sysarcher commented 7 years ago

Hello @pohly thank you very much. I'll give it a shot today!!

sysarcher commented 7 years ago

Builds like a charm now after doing the changes in your comment!! Thanks @gvancuts and @pohly !!

Updates seem to work well over the internet too! Awesome. You can close this issue if you want to.

pohly commented 7 years ago

Yes, let's close the issue. It's not really a bug.