[OE-core] create_image() fails with cannot concatenate 'str' and 'NoneType'error

Paul Eggleton paul.eggleton at linux.intel.com
Tue Jan 27 09:47:16 UTC 2015


On Monday 26 January 2015 13:23:28 Walter Giroir wrote:
> On Jan 26, 2015, at 12:46 PM, Paul Eggleton
> <paul.eggleton at linux.intel.com> wrote:
> > On Saturday 24 January 2015 17:30:08 Walt wrote:
> >> I have search the web and found a few references to this problem but I
> >> have
> >> not yet found a solution.
> >> 
> >> This is the latest commit.
> >> --------
> >> commit 745cebd635002618d7edd0a109ff07dd2953621a
> >> Author: Richard Purdie <richard.purdie at linuxfoundation.org>
> >> Date:   Fri Jan 23 14:38:12 2015 +0000
> >> 
> >>    bitbake: siggen: Ensure taskdata default functions exist in base class
> >>    
> >>    The get/set_taskdata functions are now part of the API of the class,
> >>    ensure they exist in the base class definition so the noop handler
> >>    works.
> >>    
> >>    [YOCTO #7233]
> >>    
> >>    (Bitbake rev: 9b5b1bd7d77e3f5886f6c557d3b750de1f6d6025)
> >>    
> >>    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
> >> 
> >> And here is the error
> >> =====================
> >> File: '/home/walt/workspace/wwrelay-rootfs/yocto/meta/lib/oe/image.py',
> >> lineno: 355, function: create_image
> >> 
> >>     0351:        execute_pre_post_process(self.d, post_process_cmds)
> >>     0352:
> >>     0353:
> >> 
> >>     0354:def create_image(d):
> >> *** 0355:    Image(d).create()
> >> 
> >>     0356:
> >>     0357:if __name__ == "__main__":
> >>     0358:    """
> >>     0359:    Image creation can be called independent from bitbake
> >> 
> >> environment.
> >> File: '/home/walt/workspace/wwrelay-rootfs/yocto/meta/lib/oe/image.py',
> >> lineno: 333, function: create
> >> 
> >>     0329:        execute_pre_post_process(self.d, pre_process_cmds)
> >>     0330:
> >>     0331:        self._remove_old_symlinks()
> >> 
> >>     0332:
> >> *** 0333:        image_cmd_groups = self._get_imagecmds()
> >> 
> >>     0334:
> >>     0335:        for image_cmds in image_cmd_groups:
> >>     0336:            # create the images in parallel
> >>     0337:            nproc = multiprocessing.cpu_count()
> >> 
> >> File: '/home/walt/workspace/wwrelay-rootfs/yocto/meta/lib/oe/image.py',
> >> lineno: 303, function: _get_imagecmds
> >> 
> >>     0299:                print "************************"
> >>     0300:                print localdata.getVar("IMAGE_CMD", True)
> >>     0301:                print "************************"
> >>     0302:                print "************************"
> >> 
> >> *** 0303:                cmds.append("\t" + localdata.getVar("IMAGE_CMD",
> >> True)) 0304:                cmds.append(localdata.expand("\tcd
> >> ${DEPLOY_DIR_IMAGE}"))
> >> 
> >>     0305:
> >>     0306:                if type in cimages:
> >> 
> >>     0307:                    for ctype in cimages[type]:
> >> Exception: TypeError: cannot concatenate 'str' and 'NoneType' objects
> >> 
> >> ERROR: Function failed: do_rootfs
> >> ERROR: Logfile of failure stored in: /home/walt/workspace/wwrelay-
> >> rootfs/yocto/build/tmp/work/cubietruck-poky-linux-gnueabi/wigwag-prod-
> >> lsb/1.0-r0/temp/log.do_rootfs.13308
> >> ERROR: Task 6 (/home/walt/workspace/wwrelay-
> >> rootfs/yocto/build/recipes/images/wigwag-prod-lsb.bb, do_rootfs) failed
> >> with exit code '1'
> >> NOTE: Tasks Summary: Attempted 3977 tasks of which 3976 didn't need to be
> >> rerun and 1 failed.
> > 
> > What have you got in your value of IMAGE_FSTYPES? It looks to me like
> > there is an invalid value in there. If you aren't sure what it's set to,
> > this command> 
> > should tell you:
> >  bitbake -e | grep ^IMAGE_FSTYPES=
>
> I have IMAGE_FSTYPES defined in build/conf/local.conf…
> 
> > grep IMAGE_FSTYPES build/conf/local.conf
> 
> IMAGE_FSTYPES = "ext3 tar.gz sunxi-wigwag-sdimg"
> 
> 
> When pulling the IMAGE_FSTYPES from the environment with ‘bitbake -e’ I get
> an extended list
> > bitbake -e | grep ^IMAGE_FSTYPES
> 
> IMAGE_FSTYPES="ext3 tar.gz sunxi-wigwag-sdimg ext3 tar.gz sunxi-sdimg"
> 
> Not sure why there are duplicates here unless the definitions in the
> machines configuration is also added to this list.
> 
> It all works with the exception of sunxi-wigwag-relay which is defined in
> the our own meta-wigwag layer in our layer,
> meta-wigwag/classes/sdcard_image-sunxi-wigwag.bbclass
> 
> For some reason, I do not believe this bbclass is even being parsed although
> this layer is defined in the bblayers file.
> 
> I intentionally corrupted the bbclass file, reran bitbake and did not
> receive any errors.
> 
> With a few debug statements in image.py, it’s quite clear that
> sunxi-wigwag-sdimg does not have and IMAGE_CMD

Right. Clearly we should have better error checking here (and I'll look into 
adding that.) Regarding the class, I can only assume that that class is not 
being inherited anywhere - it needs to be explicitly inherited, it's not going 
to be picked up automatically unless the layer does it or you do it in your 
configuration. Does the documentation for the layer in question not specify how 
the class is to be used? At least one way would be:

  IMAGE_CLASSES += "sdcard_image-sunxi-wigwag"

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list