[yocto] How do I used Yocto to build an sdcard image for my Raspberry Pi 3 Model B?

Thomas Thorne Thomas.Thorne at net2edge.com
Thu Nov 3 04:57:42 PDT 2016


May have solved the issue.  Thank you for your help.  

> What do you get from this?
>    % bitbake rpi-test-image -e | grep ^IMAGE_FSTYPES

I get:
thomasthorne at thorne-ul-dt:~/work/rpi-layer/build$ bitbake rpi-test-image -e | grep ^IMAGE_FSTYPES
IMAGE_FSTYPES_DEBUGFS="tar.xz ext3"
IMAGE_FSTYPES="tar.xz ext3"

Presumably because I have in my local.conf:
IMAGE_FSTYPES = "tar.xz ext3"

If I update that to be "tar.xz ext3 sdimg" I get error messages such as:
$ bitbake rpi-test-image -e | grep ^IMAGE_FSTYPES
ERROR: /home/thomasthorne/work/yocto-rpi/meta-raspberrypi/recipes-core/images/rpi-test-image.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'sdimg' - possibly invalid type name or missing support class
ERROR: /home/thomasthorne/work/yocto-rpi/meta-raspberrypi/recipes-core/images/rpi-hwup-image.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'sdimg' - possibly invalid type name or missing support class
ERROR: /home/thomasthorne/work/yocto-rpi/meta-raspberrypi/recipes-core/images/rpi-basic-image.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'sdimg' - possibly invalid type name or missing support class
ERROR: /home/thomasthorne/work/rpi-layer/meta-rpi/images/qt5-basic-image.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'sdimg' - possibly invalid type name or missing support class
ERROR: /home/thomasthorne/work/rpi-layer/meta-rpi/images/console-image.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'sdimg' - possibly invalid type name or missing support class
ERROR: Failed to parse recipe: /home/thomasthorne/work/yocto-rpi/meta-raspberrypi/recipes-core/images/rpi-hwup-image.bb
ERROR: /home/thomasthorne/work/rpi-layer/meta-rpi/images/audio-image.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'sdimg' - possibly invalid type name or missing support class
ERROR: /home/thomasthorne/work/rpi-layer/meta-rpi/images/qt5-image.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'sdimg' - possibly invalid type name or missing support class

> If it doesn't say (at least)
>    IMAGE_FSTYPES="tar.bz2 ext3 rpi-sdimg"
> then try making those settings in your local.conf

That might help.  I seem to now get:

$ bitbake rpi-test-image -e | grep ^IMAGE_FSTYPES
IMAGE_FSTYPES_DEBUGFS="tar.xz ext3 rpi-sdimg"
IMAGE_FSTYPES="tar.xz ext3 rpi-sdimg"

So the system is happy with the rpi-sdimg but not sdimg on its own.  

Now when I perform `$ bitbake rpi-test-image` I get a few warnings about license files and then the baking seems to fail with an error about "dd: failed to open '/rpi-test-image-raspberrypi3-20161103111232.rootfs.rpi-sdimg': Permission denied". That is documented as do_image_rpi_sdimg failed with oe-core in krogoth branch https://github.com/agherzan/meta-raspberrypi/issues/30 for the meta-raspberrypi layer.  That error is resolved on a krogoth specific branch for the meta-raspberrypi later.  Checking out that branch instead of master allows the SD card image creation to succeed.  I can now see sdimg files:

$ ls tmp/deploy/images/raspberrypi3/*.rpi-sdimg
tmp/deploy/images/raspberrypi3/rpi-test-image-raspberrypi3-20161103113408.rootfs.rpi-sdimg
tmp/deploy/images/raspberrypi3/rpi-test-image-raspberrypi3.rpi-sdimg

Once again thank you for your assistance.  

If you use the Raspberry Pi StackExchange site, please add your suggestion of including rpi-sdimg as an answer to http://raspberrypi.stackexchange.com/questions/57155/how-do-i-used-yocto-to-build-an-sdcard-image-for-my-raspberry-pi-3-model-b  If you do not use that site then I will add an answer with an attribution to you & this list later today.  

Grateful Regards, 

Thomas A. F. Thorne  Software Engineer  Net2Edge




More information about the yocto mailing list