[OE-core] [PATCH] wic: bootimg-partition: Stop removing whole workdir

Alexandre Belloni alexandre.belloni at free-electrons.com
Wed Feb 4 23:39:18 UTC 2015


On 04/02/2015 at 17:18:15 -0600, Tom Zanussi wrote :
> On Wed, 2015-02-04 at 23:49 +0100, Alexandre Belloni wrote:
> > Stop removing the whole working directory as this is also removing
> > eventual previously created partition images, leading to image creation
> > failures.
> > 
> 
> I'm surprised - I've never run into a problem like this.  Can you give
> more details and/or a reproducer?
> 

Sure, something like that in your wks will fail:
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4 --size 16

The error being:
Error: exec_cmd: dd if=/var/tmp/wic/build/rootfs_root.ext4
of=/var/tmp/wic/build/test-201502050034-mmcblk.direct bs=512 seek=8
count=294174 conv=notrunc returned '1' instead of 0

Using bootimg-partition anywhere but in the first position will fail
because the previously generated fs images (in my example
rootfs_root.ext4) will be removed.

> Thanks,
> 
> Tom
> 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni at free-electrons.com>
> > ---
> >  scripts/lib/wic/plugins/source/bootimg-partition.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py
> > index 6ba39a01f700..c5eb7b8b801b 100644
> > --- a/scripts/lib/wic/plugins/source/bootimg-partition.py
> > +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
> > @@ -66,7 +66,7 @@ class BootimgPartitionPlugin(SourcePlugin):
> >          - copies all files listed in IMAGE_BOOT_FILES variable
> >          """
> >          hdddir = "%s/boot" % cr_workdir
> > -        rm_cmd = "rm -rf %s" % cr_workdir
> > +        rm_cmd = "rm -rf %s/boot" % cr_workdir
> >          exec_cmd(rm_cmd)
> >  
> >          install_cmd = "install -d %s" % hdddir
> 
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the Openembedded-core mailing list