| Summary: | WIC error when using rawcopy | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Fabio Berton <fabio.berton> | ||||||||||
| Component: | Scripts and Tools | Assignee: | Ed Bartosh <eduard.bartosh> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | Medium | CC: | ross.burton, sgw | ||||||||||
| Version: | 2.1 | ||||||||||||
| Target Milestone: | 2.2 M2 | ||||||||||||
| Hardware: | x86 | ||||||||||||
| OS: | arm | ||||||||||||
| Whiteboard: | |||||||||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||||||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||||||||
| Attachments: |
|
||||||||||||
|
Description
Fabio Berton
2016-06-27 12:22:39 UTC
I need more information about the setup. I can't reproduce the issue as u-boot.imx file is not present in deploy/images/nitrogen6x/ in my setup. Here is what I did: - Added meta-fsl-arm and meta-fsl-arm-extra to conf/bblayers.conf - Changed MACHINE to 'nitrogen6x' in conf/local.conf - Built core-image-minimal: bitbake core-image-minimal - run wic create test.wks -e core-image-minimal and it failed as u-boot.imx doesn't exist Here is how wic fails in my setup: [ed@build (krogoth)]$ wic create test.wks -e core-image-minimal Checking basic build environment... Done. Creating image(s)... Error: exec_cmd: cp /home/ed/git/yocto/poky/build/tmp/deploy/images/nitrogen6x/u-boot.imx /var/tmp/wic/build/u-boot.imx returned '1' instead of I'm using krogoth branch and this test.wks: part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 1 part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --align 8192 --size 25M --extra-space 0 part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label system --size 512M --align 8192 --extra-space 0 part / --size 512M --ondisk mmcblk0 --align 8192 --extra-space 0 bootloader --ptable msdos Fabio, can you explain how to build u-boot.imx? Looks like in my setup wic breaks because u-boot.imx is not in tmp/deploy/images/nitrogen6x/, but in your setup it seems to be there. Hi Ed! I added this to local.conf IMAGE_FSTYPES += "wic" IMAGE_BOOT_FILES = "6x_bootscript-nitrogen6x;6x_bootscript zImage zImage-imx6q-nitrogen6x.dtb;imx6q-nitrogen6x.dtb" You can run bitbake virtual/bootloader before run bitbake core-image-minimal, or add virtual/bootloader to wic depends. For test just run: bitbake virtual/bootloader ; bitbake core-image-minimal Thank you! Now I'm able to reproduce the error: Error: exec_cmd: dd if=/var/tmp/wic/build/u-boot.imx of=/var/tmp/wic/build/test-201606291203-mmcblk.direct bs=512 seek=2 count=854 conv=notrunc returned '1' instead of 0 Created attachment 3261 [details]
fix
Fabio, can you try if attached patch works for you? The u-boot rawcopy was fixed, but I'm getting other error:
| Info: The new image(s) can be found here:
| /home/user/src/prj/build/tmp/deploy/images/nitrogen6x/core-image-minimal-nitrogen6x-20160629130621/build/prj-image-201606291006-mmcblk0.direct
|
| /home/user/src/prj/build/tmp/deploy/images/nitrogen6x/core-image-minimal-nitrogen6x-20160629130621/build/prj-image-201606291006-mmcblk.direct
|
| The following build artifacts were used to create the image(s):
| ROOTFS_DIR: /home/user/src/prj/build/tmp/work/nitrogen6x-tr-linux-gnueabi/core-image-minimal/1.0-r0/rootfs
| BOOTIMG_DIR:
| KERNEL_DIR: /home/user/src/prj/build/tmp/deploy/images/nitrogen6x
| NATIVE_SYSROOT: /home/user/src/prj/build/tmp/sysroots/x86_64-linux
|
|
| The image(s) were created using OE kickstart file:
| /home/user/src/prj/sources/meta-prj/scripts/lib/wic/canned-wks/prj-image.wks
| mv: target '/home/user/src/prj/build/tmp/deploy/images/nitrogen6x/core-image-minimal-nitrogen6x-20160629130621.rootfs.wic' is not a directory
| WARNING: /home/user/src/prj/build/tmp/work/nitrogen6x-tr-linux-gnueabi/core-image-minimal/1.0-r0/temp/run.do_image_wic.7067:1 exit 1 from 'mv "$out/build/$(basename "${wks%.wks}")"*.direct "$out.rootfs.wic"'
It happens to you?
I didn't have this error because I run wic from command line, i.e. 'wic create -e core-image-minimal test.wks', not by bitbake. If you can explain your setup in more details I can try to reproduce it and fix the issue. Created attachment 3263 [details]
fix v2
I've figured out how to fix the error you're having. Please, try this patch.
Created attachment 3264 [details]
wic-raw-copy.patch
If i remove "device" part from image_types.bbclass work for me.
I'm attaching a patch that worked for me, please try this.
Thanks.
your patch rewrites the image. You have 2 different devices in your .wks file: mmcblk and mmcblk0, so 2 images should be produced(i know it could be a typo, but it's valid case anyway). Your change results in rewriting the first image by second one. Can you show me why my patch didn't work for you? With your last patch I get this: | Info: The new image(s) can be found here: | /home/user/src/prj/build/tmp/deploy/images/nitrogen6x/core-image-minimal-nitrogen6x-20160630120720/build/core-image-minimal-201606300907-mmcblk0.direct | | /home/user/src/prj/build/tmp/deploy/images/nitrogen6x/core-image-minimal-nitrogen6x-20160630120720/build/core-image-minimal-201606300907-mmcblk.direct | | The following build artifacts were used to create the image(s): | ROOTFS_DIR: /home/user/src/prj/build/tmp/work/nitrogen6x-prj-linux-gnueabi/core-image-minimal/1.0-r0/rootfs | BOOTIMG_DIR: | KERNEL_DIR: /home/user/src/prj/build/tmp/deploy/images/nitrogen6x | NATIVE_SYSROOT: /home/user/src/prj/build/tmp/sysroots/x86_64-linux | | | The image(s) were created using OE kickstart file: | /home/user/src/prj/sources/meta-prj/scripts/lib/wic/canned-wks/core-image-minimal.wks | gzip: skipping: core-image-minimal-nitrogen6x-20160630120720.rootfs.wic does not exist | rm: cannot remove 'core-image-minimal-nitrogen6x-20160630120720.rootfs.wic': No such file or directory | WARNING: /home/user/src/prj/build/tmp/work/nitrogen6x-prj-linux-gnueabi/core-image-minimal/1.0-r0/temp/run.do_image_wic.10877:1 exit 1 from 'rm core-image-minimal-nitrogen6x-20160630120720.rootfs.wic' The image copied to deploy image dir is core-image-minimal-201606300905-mmcblk.direct and gzip is trying to compact core-image-minimal-nitrogen6x-20160630120720.rootfs.wic that doesn't exist. Thank you for pointing this out to me. I'll try to fix it. you may have wic.gz in your IMAGE_FSTYPES. I didn't see this error as I have only 'wic' there, so my images are not compressed. Yes, I'm using IMAGE_FSTYPES = "wic.gz" The problem here is that current image machinery in meta/classes/ doesn't support multiple images. I can fix this particular error, but i'm sure it will create more as it's just contradicts with the current design. Can you explain why do you need to generate 2 images? When I saw mmcblk0 and mmcblk in your .wks file I thought it's just a typo as names look very similar. Ahh sorry, mmcblk on line "part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 1" is a typo. All lines need to be mmcblk0 Created attachment 3265 [details]
fix v3
In this case you don't need most of my changes. This one should fix your issue.
let me know if it works for you.
I'd also suggest you to create a recipe for your image and put all dependencies, image types and other parameters of your image there.
Something like that should be ok:
IMAGE_FSTYPES = "wic.gz"
DEPENDS = "virtual/bootloader dosfstools-native mtools-native"
inherit core-image
# core-image-minimal is referenced in .wks, so we need its rootfs
# to be ready before our rootfs
do_rootfs[depends] += "core-image-minimal:do_image core-image-minimal:do_rootfs_wicenv"
Now it's working as expected. To resolve wic dependence I'm using: IMAGE_DEPENDS_wic_append = " dosfstools-native mtools-native virtual/bootloader" in my_distro.conf. Can this change be applied to krogoth? Thanks for your help! I'll send a patch for master for sure. I don't know if the issue is important enough to be included in previous releases. It happens only when the same file is used as a source for more than one partition, which is quite rare case. sent a fix for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-June/123384.html send the same fix for krogoth: http://lists.openembedded.org/pipermail/openembedded-core/2016-July/123398.html the fix has been merged into master and krogoth |