[yocto] How to debug a custom image creation script?

Spriggs, Jim J.Spriggs at raylase.de
Fri May 22 04:52:51 PDT 2015


Hi Paul,
Rodger, thanks.

Strangely, log.do_rootfs says:

        NOTE: The image creation groups are: [['ext3', 'tar'], ['sdcard']]
and
        NOTE: Running image creation script for  sdcard:   .../tmp/work/mymachine-poky-linux-gnuabi/my-image/1.0-r0/temp/create_image.sdcard ...
and
        NOTE: Creating symlinks for  sdcard image ...

But nothing between the last two, as if the output from "create_image.sdcard" is not being captured after all.

That script is present, and appears to contain everything from my bbclass.
The xxxx.rootfs.sdcard is being created in deploy/images, albeit with bogus contents (which is why I want to debug the script), so I have every reason to think that img_creation_func() is indeed being called.
However, not even a simple "echo" at the start of img_creation_func() leaves anything visible in log.do_rootfs.

I guess either I'm still doing something wrong, or the problem with "bbnote", etc., is not just confined to the UI.

I'm using dizzy, btw.

Greets,
--
jim

-----Ursprüngliche Nachricht-----
Von: Paul Eggleton [mailto:paul.eggleton at linux.intel.com]
Gesendet: Freitag, 22. Mai 2015 11:22
An: Spriggs, Jim
Cc: yocto at yoctoproject.org
Betreff: Re: [yocto] How to debug a custom image creation script?

Hi Jim,

On Friday 22 May 2015 08:47:23 Spriggs, Jim wrote:
> I'd like to have my custom layer generate an sdcard image, so I've
> implemented a classes/image_types_xxxxx.bbclass. This contains,
> amongst other things, the (bash) function generate_xxxxx_sdcard().
> Being a naïve n00b, I assumed that I could just scatter "bbnote"s,
> "echo"s, or even "set -x" around inside the function to my heart's
> content, and would be able to see the output "somewhere".
> Trouble is, I can't find it anywhere!
>
> So what is the best/approved/obvious way to get debug traces out of a
> bbclass function?
>
> If I am already doing the Right Thing, where should I be looking for
> the output?

You should see output printed here in log.do_rootfs for the image you are building. In case you're unaware, you can find this in the directory pointed to by the T variable for the recipe, the following command will show this to you:

bitbake -e your-imagename | grep ^T=

As an aside, we do want to change the bbwarn/bbnote/bberror etc. shell functions to output to the UI just like the python equivalents do, it's a known issue that they do not. There's a bug open for that (assigned to me as it happens):

  https://bugzilla.yoctoproject.org/show_bug.cgi?id=5275

I should really get that one sorted out for the next release.

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre

________________________________

RAYLASE AG
Argelsrieder Feld 2+4
82234 Wessling
Germany
Tel.: +49-(0)8153/88 98-0
Fax: +49-(0)8153/88 98-10
http://www.raylase.de

District Court Munich, HRB 131450

Board: Peter von Jan (CEO)

Supervisory Board: Dr. Ulrich Lohmann (Chairman)


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



More information about the yocto mailing list