Bug 6481 - wic produces traceback
Summary: wic produces traceback
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: configuration (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium major
Target Milestone: 1.7
Assignee: Tom Zanussi
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-06-25 23:44 UTC by Phlip Balister
Modified: 2014-07-15 15:46 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phlip Balister 2014-06-25 23:44:44 UTC
I run:

wic create ~/wic/XXXX-sd.wks -o ~/wic/out -e uhd-dev-image

I see:

Checking basic build environment...
Done.

Creating image(s)...

Traceback (most recent call last):
  File "/home/balister/oe-core/oe-core/scripts/wic", line 262, in <module>
    ret = main()
  File "/home/balister/oe-core/oe-core/scripts/wic", line 257, in main
    invoke_subcommand(args, parser, wic_help_usage, subcommands)
  File "/home/balister/oe-core/oe-core/scripts/lib/image/help.py", line 73, in invoke_subcommand
    subcommands.get(args[0], subcommand_error)[0](args[1:], usage)
  File "/home/balister/oe-core/oe-core/scripts/wic", line 201, in wic_create_subcommand
    image_output_dir, options.debug, options.properties_file)
  File "/home/balister/oe-core/oe-core/scripts/lib/image/engine.py", line 244, in wic_create
    cr.main(direct_args)
TypeError: 'NoneType' object has no attribute '__getitem__'

The wks file is:

# short-description: Create the iot-devkit disk image
# long-description: Creates the partitioned disk image that the user
# can directly dd to the sdcard.

part /boot --source iot-devkit --size 50 --ondisk mmcblkp0 --fstype=msdos --label FAT --active --align 1024

# this assumes that your SD card is 7.05GB+
part / --source rootfs --size 1000 --ondisk mmcblkp0 --fstype=ext4 --label rootfs --align 1024

I realize I do not know what I am doing, but there isn't anything in the traceback to help me fix the problem.
Comment 1 Tom Zanussi 2014-06-26 11:53:42 UTC
Right, and it's not obvious to me what's wrong either - I'll need to build an image and try it myself.

It would be useful to reproduce using the same build artifacts i.e. uhd-dev-image, so if possible could you provide the layers/layer information you used?
Comment 2 Ross Burton 2014-06-26 14:50:41 UTC
Philip, what version of oe-core are you using? I'm sure I've seen this before in the past.
Comment 3 Phlip Balister 2014-06-26 17:12:07 UTC
uhd-dev-image is in meta-sdr at:

https://github.com/balister/meta-sdr

I'll run a core-image and try that.

I am running a very recent oe-core:

commit 01968e9244d0cf3deb1ec5cfb8e562d3b364add6
Author: Cristian Iorga <cristian.iorga@intel.com>
Date:   Fri Jun 20 18:42:20 2014 +0300
Comment 4 Phlip Balister 2014-06-26 17:19:28 UTC
[balister@mattsbaby build]$ wic create ~/wic/e300-sd.wks -o ~/wic/out -e core-image-minimal
Checking basic build environment...
Done.

Creating image(s)...

Traceback (most recent call last):
  File "/home/balister/oe-core/oe-core/scripts/wic", line 262, in <module>
    ret = main()
  File "/home/balister/oe-core/oe-core/scripts/wic", line 257, in main
    invoke_subcommand(args, parser, wic_help_usage, subcommands)
  File "/home/balister/oe-core/oe-core/scripts/lib/image/help.py", line 73, in invoke_subcommand
    subcommands.get(args[0], subcommand_error)[0](args[1:], usage)
  File "/home/balister/oe-core/oe-core/scripts/wic", line 201, in wic_create_subcommand
    image_output_dir, options.debug, options.properties_file)
  File "/home/balister/oe-core/oe-core/scripts/lib/image/engine.py", line 244, in wic_create
    cr.main(direct_args)
TypeError: 'NoneType' object has no attribute '__getitem__'
[balister@mattsbaby build]$
Comment 5 Tom Zanussi 2014-06-27 13:39:43 UTC
So the problem is that there isn't an iot-devkit wic source plugin in oe-core - this was a special plugin for the iot-devkit distro if I remember.

If there was an error message (and there will be shortly - I'll be working on this immediately), it would say something like, "The 'iot-devkit' 
source plugin specified as the --source of content for the /boot partitition, doesn't exist.  You should either add a source plugin with that name (see 'wic help plugins' for details on how to do that) or reference an existing plugin in your kickstart file (see 'wic help kickstart' for information on how to list and use available source plugins from your .wks file).

Obviously the documentation mentioned above doesn't exist in that form - I need to add some new sections to the in-tool documentation for that.  The closest we have right now on how to add plugins is here:

http://lists.openembedded.org/pipermail/openembedded-core/2014-February/089164.html

And for figuring out which plugins are available, the easiest way is to look at the implementation of the existing 'canned images' which you can list using 'wic list images'.  The location of the canned images listed there is scripts/lib/image/canned-wks.  From those, the current set of --sources available in oe-core are: bootimg-pcbios, bootimg-efi and rootfs.  There's some documentation about the canned images and other things here, which is out-of-date and really needs to be incorporated into the in-tool documentation and updated along with the tool. 

http://www.yoctoproject.org/docs/1.5.2/dev-manual/dev-manual.html#creating-partitioned-images
Comment 6 Tom Zanussi 2014-07-08 14:54:29 UTC
(In reply to comment #5)
> So the problem is that there isn't an iot-devkit wic source plugin in
> oe-core - this was a special plugin for the iot-devkit distro if I remember.
> 
> If there was an error message (and there will be shortly - I'll be working
> on this immediately), it would say something like, "The 'iot-devkit' 
> source plugin specified as the --source of content for the /boot
> partitition, doesn't exist.  You should either add a source plugin with that
> name (see 'wic help plugins' for details on how to do that) or reference an
> existing plugin in your kickstart file (see 'wic help kickstart' for
> information on how to list and use available source plugins from your .wks
> file).
> 
> Obviously the documentation mentioned above doesn't exist in that form - I
> need to add some new sections to the in-tool documentation for that.  The
> closest we have right now on how to add plugins is here:
> 
> http://lists.openembedded.org/pipermail/openembedded-core/2014-February/
> 089164.html
> 
> And for figuring out which plugins are available, the easiest way is to look
> at the implementation of the existing 'canned images' which you can list
> using 'wic list images'.  The location of the canned images listed there is
> scripts/lib/image/canned-wks.  From those, the current set of --sources
> available in oe-core are: bootimg-pcbios, bootimg-efi and rootfs.  There's
> some documentation about the canned images and other things here, which is
> out-of-date and really needs to be incorporated into the in-tool
> documentation and updated along with the tool. 
> 
> http://www.yoctoproject.org/docs/1.5.2/dev-manual/dev-manual.html#creating-
> partitioned-images

Patchset submitted to oe-core addressing the above.
Comment 7 Tom Zanussi 2014-07-15 15:46:22 UTC
Fix along with related items pulled into oe-core:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b5dceca4369ef2ae0825d5298aa640b68d7d7da1