<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Another strange thing. The IMG_COMMAND did result in an empty second partition. It did take a while to realize, what the problem was, because there was no error message at all. It just didn´t work. </div><div class=""><br class=""></div><div class="">I had to do this:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><table class=" diff-table tab-size" data-tab-size="8" style="box-sizing: border-box; border-spacing: 0px; width: 978px; tab-size: 8; color: rgb(51, 51, 51); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 13px;"><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box;" class=""><td class="is-hovered blob-code-deletion blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; background-color: rgb(255, 236, 236);"><span class="blob-code-inner" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">-USBIMG_ROOTFS = "${IMAGE_NAME}.rootfs.${USBIMG_ROOTFS_TYPE}“</span></td></tr></tbody></table></div><div><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre; background-color: rgb(234, 255, 234);" class=""> +USBIMG_ROOTFS = "${</span><span class="x x-first x-last" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre; box-sizing: border-box; border-top-left-radius: 0.2em; border-bottom-left-radius: 0.2em; border-top-right-radius: 0.2em; border-bottom-right-radius: 0.2em; background-color: rgb(166, 243, 166);">DEPLOY_DIR_IMAGE}/${</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre; background-color: rgb(234, 255, 234);" class="">IMAGE_NAME}.rootfs.${USBIMG_ROOTFS_TYPE}</span><font color="#333333" face="Consolas, Liberation Mono, Menlo, Courier, monospace" class=""><span style="white-space: pre;" class="">“</span></font></div><div><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre; background-color: rgb(234, 255, 234);" class=""><br class=""></span></div><div><blockquote type="cite" class=""><div class="">Am 16.01.2016 um 21:12 schrieb Markus Volk <<a href="mailto:f_l_k@t-online.de" class="">f_l_k@t-online.de</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">I found the mistake. The Problem seems to be the hyphen in the IMAGE_CMD name<br class=""><br class="">IMAGE_CMD_hd1-usbimg <span class="Apple-tab-span" style="white-space:pre"> </span>didn´t work<br class="">IMAGE_CMD_usbimg <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>does<br class=""><br class="">I´m curious if it still works with IMAGE_CMD_rpi-sdimg on the raspberrypi. Has someone already tried ?<br class=""><br class=""><blockquote type="cite" class=""><br class="">Thank you,<br class=""><br class="">unfortunately this has´t solved the problem for me<br class=""><br class=""><blockquote type="cite" class="">Am 15.01.2016 um 02:56 schrieb Andre McCurdy <<a href="mailto:armccurdy@gmail.com" class="">armccurdy@gmail.com</a>>:<br class=""><br class="">On Wed, Jan 13, 2016 at 12:36 PM, Markus Volk <<a href="mailto:f_l_k@t-online.de" class="">f_l_k@t-online.de</a>> wrote:<br class=""><blockquote type="cite" class="">With the recent improvements in the master branch regarding image creation i´m not able to build usb images anymore.<br class=""></blockquote><br class="">This patch might help:<br class=""><br class=""><a href="http://lists.openembedded.org/pipermail/openembedded-core/2016-January/115474.html" class="">http://lists.openembedded.org/pipermail/openembedded-core/2016-January/115474.html</a><br class=""><br class=""><blockquote type="cite" class="">do_image_ext3 and do_image_jffs2 works well, then i´m getting this error message:<br class=""><br class="">Log data follows:<br class="">| DEBUG: Executing python function set_image_size<br class="">| DEBUG: Python function set_image_size finished<br class="">| DEBUG: Executing shell function do_image_hd1-usbimg<br class="">| /home/flk/yocto/poky/build-zee/tmp-glibc/work/coolstream_hd1-oe-linux-gnueabi/neutrino-image/1.0-r0/temp/run.do_image_hd1-usbimg.126432: 108: /home/flk/yocto/poky/build-zee/tmp-glibc/work/coolstream_hd1-oe-linux-gnueabi/neutrino-image/1.0-r0/temp/run.do_image_hd1-usbimg.126432: do_image_hd1-usbimg: not found<br class="">| WARNING: exit code 127 from a shell command.<br class="">| ERROR: Function failed: do_image_hd1-usbimg (log file is located at /home/flk/yocto/poky/build-zee/tmp-glibc/work/coolstream_hd1-oe-linux-gnueabi/neutrino-image/1.0-r0/temp/log.do_image_hd1-usbimg.126432)<br class="">ERROR: Task 18 (/home/flk/yocto/poky/meta-neutrino/recipes-images/images/neutrino-image.bb, do_image_hd1-usbimg) failed with exit code '1'<br class="">NOTE: Tasks Summary: Attempted 2349 tasks of which 742 didn't need to be rerun and 1 failed.<br class="">Waiting for 0 running tasks to finish:<br class=""><br class="">Summary: 1 task failed:<br class="">/home/flk/yocto/poky/meta-neutrino/recipes-images/images/neutrino-image.bb, do_image_hd1-usbimg<br class="">Summary: There were 3 WARNING messages shown.<br class="">Summary: There was 1 ERROR message shown, returning a non-zero exit code.<br class=""><br class=""><br class="">Until now i used this file for building an usb image (very similar to the way the sd image for raspberrypi is created):<br class=""><br class="">usb_image-hd1.bbclass:<br class=""><br class="">inherit image_types<br class=""><br class="">#<br class="">## this is heavily inspired by the raspberry pi sdimage class.<br class="">#<br class=""># Create an image that can by written onto an USB stick.<br class="">#<br class=""># The disk layout used is:<br class="">#<br class=""># 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved for other data<br class=""># IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - u-boot script and kernel<br class=""># BOOT_SPACE -> USBIMG_SIZE - rootfs<br class="">#<br class=""># Default Free space = 1.3x<br class=""># Use IMAGE_OVERHEAD_FACTOR to add more space<br class=""># <---------><br class=""># 1MiB 20MiB USBIMG_ROOTFS<br class=""># <-----------------------> <----------> <----------------------><br class=""># ------------------------ ------------ ------------------------<br class=""># | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE |<br class=""># ------------------------ ------------ ------------------------<br class=""># ^ ^ ^ ^<br class=""># | | | |<br class=""># 0 1MiB 1MiB + 20MiB 1MiB + 20Mib + USBIMG_ROOTFS<br class=""><br class=""># This image depends on the rootfs image<br class="">IMAGE_TYPEDEP_hd1-usbimg = "${USBIMG_ROOTFS_TYPE}"<br class=""><br class=""># Boot partition volume id<br class="">BOOTDD_VOLUME_ID ?= "KERNEL"<br class=""><br class=""># Boot partition size [in KiB] (will be rounded up to IMAGE_ROOTFS_ALIGNMENT)<br class="">BOOT_SPACE ?= "20480"<br class=""><br class=""># Set alignment to 4MB [in KiB]<br class="">IMAGE_ROOTFS_ALIGNMENT = "1024"<br class=""><br class=""># Use an uncompressed ext3 by default as rootfs<br class="">USBIMG_ROOTFS_TYPE ?= "ext3"<br class="">USBIMG_ROOTFS = "${IMAGE_NAME}.rootfs.${USBIMG_ROOTFS_TYPE}"<br class=""><br class="">IMAGE_DEPENDS_hd1-usbimg = " \<br class=""> parted-native \<br class=""> mtools-native \<br class=""> dosfstools-native \<br class=""> virtual/kernel \<br class="">"<br class=""><br class=""># USB image name<br class="">USBIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.hd1-usbimg"<br class=""><br class=""># Compression method to apply to USBIMG after it has been created. Supported<br class=""># compression formats are "gzip", "bzip2" or "xz". The original .hd1-usbimg file<br class=""># is kept and a new compressed file is created if one of these compression<br class=""># formats is chosen. If USBIMG_COMPRESSION is set to any other value it is<br class=""># silently ignored.<br class="">#USBIMG_COMPRESSION ?= ""<br class=""><br class=""># Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.<br class="">FATPAYLOAD ?= ""<br class=""><br class="">IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}"<br class=""><br class="">IMAGE_CMD_hd1-usbimg () {<br class=""><br class=""> # Align partitions<br class=""> BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)<br class=""> BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})<br class=""> ROOTFS_SIZE=`du -bks ${USBIMG_ROOTFS} | awk '{print $1}'`<br class=""> # Round up RootFS size to the alignment size as well<br class=""> ROOTFS_SIZE_ALIGNED=$(expr ${ROOTFS_SIZE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)<br class=""> ROOTFS_SIZE_ALIGNED=$(expr ${ROOTFS_SIZE_ALIGNED} - ${ROOTFS_SIZE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})<br class=""> USBIMG_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + ${ROOTFS_SIZE_ALIGNED})<br class=""><br class=""> echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS ${ROOTFS_SIZE_ALIGNED} KiB"<br class=""><br class=""> # Initialize usbstick image file<br class=""> dd if=/dev/zero of=${USBIMG} bs=1024 count=0 seek=${USBIMG_SIZE}<br class=""><br class=""> # Create partition table<br class=""> parted -s ${USBIMG} mklabel msdos<br class=""> # Create boot partition and mark it as bootable (not necessary, but does not hurt)<br class=""> parted -s ${USBIMG} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT})<br class=""> parted -s ${USBIMG} set 1 boot on<br class=""> # Create rootfs partition to the end of disk<br class=""> parted -s ${USBIMG} -- unit KiB mkpart primary ext2 $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) -1s<br class=""> parted ${USBIMG} print<br class=""><br class=""> # Create a vfat image with boot files<br class=""> BOOT_BLOCKS=$(LC_ALL=C parted -s ${USBIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')<br class=""> rm -f ${WORKDIR}/boot.img<br class=""> mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS<br class=""> mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::zImage.img<br class=""><br class=""> if [ -n ${FATPAYLOAD} ] ; then<br class=""> echo "Copying payload into VFAT"<br class=""> for entry in ${FATPAYLOAD} ; do<br class=""> # add the || true to stop aborting on vfat issues like not supporting .~lock files<br class=""> mcopy -i ${WORKDIR}/boot.img -s -v ${IMAGE_ROOTFS}$entry :: || true<br class=""> done<br class=""> fi<br class=""><br class=""> # Add stamp file<br class=""> echo "${IMAGE_NAME}-${IMAGEDATESTAMP}" > ${WORKDIR}/image-version-info<br class=""> mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}//image-version-info ::<br class=""><br class=""> # Burn Partitions<br class=""> dd if=${WORKDIR}/boot.img of=${USBIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync<br class=""> # If USBIMG_ROOTFS_TYPE is a .xz file use xzcat<br class=""> if echo "${USBIMG_ROOTFS_TYPE}" | egrep -q "*\.xz"<br class=""> then<br class=""> xzcat ${USBIMG_ROOTFS} | dd of=${USBIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync<br class=""> else<br class=""> dd if=${USBIMG_ROOTFS} of=${USBIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync<br class=""> fi<br class=""><br class=""> # Optionally apply compression<br class=""> case "${USBIMG_COMPRESSION}" in<br class=""> "gzip")<br class=""> gzip -k9 "${USBIMG}"<br class=""> ;;<br class=""> "bzip2")<br class=""> bzip2 -k9 "${USBIMG}"<br class=""> ;;<br class=""> "xz")<br class=""> xz -k "${USBIMG}"<br class=""> ;;<br class=""> esac<br class="">}<br class=""><br class=""><br class="">When reverting those changes, the problem is gone:<br class=""><br class="">git revert 3341f3fbee818a0bd62620b8bc34230b03c0689c<br class="">git revert 0a4e1f968ada5099e3270ed06404d2827e9729aa<br class="">git revert fdced52387613a09368716d1f3bb7a13a6edd46d<br class="">git revert cdc0aeed9b17387ea37dcbfef7d474cce372e8db<br class=""><br class=""><br class="">What am i missing here ?<br class="">--<br class="">_______________________________________________<br class="">yocto mailing list<br class="">yocto@yoctoproject.org<br class="">https://lists.yoctoproject.org/listinfo/yocto<br class=""></blockquote></blockquote><br class="">-- <br class="">_______________________________________________<br class="">yocto mailing list<br class=""><a href="mailto:yocto@yoctoproject.org" class="">yocto@yoctoproject.org</a><br class="">https://lists.yoctoproject.org/listinfo/yocto<br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></body></html>