[yocto] The BitBake equivalent of "Hello, World!"

Patrick Turley PatrickTurley at gamestop.com
Mon Oct 8 17:30:21 PDT 2012


I am continuing my work on creating a "Hello, World!" BitBake project. Because of the excellent help I got before, things have gone reasonably well, but I'm again running into something I don't know how to fix.

As before, the entire contents of my very small project appear at the end of this message. Here's what works fine:


    $ ../BitBake/bin/bitbake-layers show-layers
    Parsing recipes..done.

    layer     path                                    priority
    ==========================================================
    LayerA    /home/pturley/Workspace/Hello/LayerA    1

    $ ../BitBake/bin/bitbake-layers show-recipes
    Parsing recipes..done.
    === Available recipes: ===
    a:
      LayerA               1


When I tried this:


    ../BitBake/bin/bitbake -c listtasks a


I got a Python stack trace that ended here:


      File "../BitBake/lib/bb/runqueue.py", line 902, in RunQueue.check_stamp_task(task=0, taskname='do_listtasks', recurse=False):
                 # If the stamp is missing its not current
        >        if not os.access(stampfile, os.F_OK):
                     logger.debug(2, "Stampfile %s not available", stampfile)
    TypeError: coercing to Unicode: need string or buffer, NoneType found


This code isn't expecting the "stampfile" variable to be "None" (which it is), so it freaks out. I made a very simple fix to get past the problem:


    if not stampfile or not os.access(stampfile, os.F_OK):


That made a dramatic difference, and enabled me to get this far:


    $ ../BitBake/bin/bitbake -c listtasks a
    Loading cache: 100% |###############################################################| ETA:  00:00:00
    Loaded 2 entries from dependency cache.
    NOTE: Resolving any missing task queue dependencies
    NOTE: Preparing runqueue
    NOTE: Executing RunQueue Tasks
    NOTE: Running task 1 of 1 (ID: 0, /home/pturley/Workspace/Hello/LayerA/a.bb, do_listtasks)
    ERROR: T variable not set, unable to build
    ERROR: Task 0 (/home/pturley/Workspace/Hello/LayerA/a.bb, do_listtasks) failed with exit code '1'
    NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and 1 failed.

    Summary: 1 task failed:
      /home/pturley/Workspace/Hello/LayerA/a.bb, do_listtasks
    Summary: There was 1 ERROR message shown, returning a non-zero exit code.

    $ ../BitBake/bin/bitbake a
    Loading cache: 100% |###############################################################| ETA:  00:00:00
    Loaded 2 entries from dependency cache.
    NOTE: Resolving any missing task queue dependencies
    NOTE: Preparing runqueue
    NOTE: Executing RunQueue Tasks
    NOTE: Running task 1 of 1 (ID: 0, /home/pturley/Workspace/Hello/LayerA/a.bb, do_build)
    ERROR: T variable not set, unable to build
    ERROR: Task 0 (/home/pturley/Workspace/Hello/LayerA/a.bb, do_build) failed with exit code '1'
    NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and 1 failed.

    Summary: 1 task failed:
      /home/pturley/Workspace/Hello/LayerA/a.bb, do_build
    Summary: There was 1 ERROR message shown, returning a non-zero exit code.


As you can see, BitBake is expecting the "T" variable to be set.  I don't think I've ever seen this variable -- so I don't know what it's for or what I should change.

Can anyone offer a hint?


------------------------------------------------------------


├── build
│   │
│   ├── classes
│   │   │
│   │   └── base.bbclass
│   │
│   │       +-----------------------------------------------
│   │       |  addtask listtasks
│   │       |
│   │       |  do_listtasks[nostamp] = "1"
│   │       |
│   │       |  python do_listtasks() {
│   │       |          import sys
│   │       |          # emit variables and shell functions
│   │       |          #bb.data.emit_env(sys.__stdout__, d)
│   │       |          # emit the metadata which isnt valid shell
│   │       |          for e in d.keys():
│   │       |                  if d.getVarFlag(e, 'task'):
│   │       |                          bb.plain("%s" % e)
│   │       |  }
│   │       |
│   │       |  addtask build
│   │       |
│   │       |  do_build() {
│   │       |      echo "Hello"
│   │       |  }
│   │       +-----------------------------------------------
│   │
│   └── conf
│       │
│       ├── bblayers.conf
│       │
│       │   +-----------------------------------------------
│       │   |  BBLAYERS ?= " \
│       │   |    /home/pturley/Workspace/Hello/LayerA \
│       │   |    "
│       │   +-----------------------------------------------
│       │
│       └── bitbake.conf
│
│           +-----------------------------------------------
│           |  CACHE = "${TOPDIR}/cache"
│           +-----------------------------------------------
│
├── LayerA
│   │
│   ├── a.bb
│   │
│   │       +-----------------------------------------------
│   │       |  DESCRIPTION = "Layer A Main Recipe"
│   │       |  PN = 'a'
│   │       |  PV = '1'
│   │       +-----------------------------------------------
│   │
│   └── conf
│       │
│       └── layer.conf
│
│           +-----------------------------------------------
│           |  BBPATH .= ":${LAYERDIR}"
│           |
│           |  BBFILES += "${LAYERDIR}/*.bb"
│           |
│           |  BBFILE_COLLECTIONS += "A"
│           |  BBFILE_PATTERN_A := "^${LAYERDIR}/"
│           +-----------------------------------------------
│
└── BitBake

   The BitBake directory origin is:

       http://git.openembedded.org/bitbake/

   I have the 1.15.2 tag checked out, which is what
   Yocto denzil uses.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20121009/9d1e256e/attachment.html>


More information about the yocto mailing list