On Tue, May 02, 2017 at 03:56:38PM +0300, Ed Bartosh wrote:
> On Fri, Apr 21, 2017 at 02:11:41PM +0200, Andreas J. Reichel wrote:
> > Handle exception if a file could not be deleted during clean-up of
> > unwanted files, thus preventing a failure of wic in this case.
> 
> Can you explain why partition images can't be deleted?
> As wic creates them it's not obvious why it can't remove them.
> 
As part of our internal project, we generate artifacts to be packaged
in further archives and only contain one single partition image. The
image generation process is solely done by wic and post-processing
scripts, therefore we always used the .p2 file for the root partition,
that had already peen patched (for example fstab by wic). Suddenly the
file was missing and CI was not working anymore. Here, instead of
just stating, that *nobody* needs these files, my idea was to
introduce a parameter, so that people can chose if they want them or
not. 
We do not want to generate any image artifacts with bitbake to keep
things separated better.
Just saving space is not a valid argument to me because building
a system with bitbake needs up to 50 GB and if you do it for several
machines, a few hundred MB should not matter. However, no problem for me
to delete them per standard, if you say *most* people don' use them.

> > Signed-off-by: Andreas Reichel <[email protected]>
> > Signed-off-by: Jan Kiszka <[email protected]>
> > Signed-off-by: Daniel Wagner <[email protected]>
> > 
> > ---
> >  scripts/lib/wic/plugins/imager/direct.py | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/scripts/lib/wic/plugins/imager/direct.py 
> > b/scripts/lib/wic/plugins/imager/direct.py
> > index f2e6127331..d6b47ff0bb 100644
> > --- a/scripts/lib/wic/plugins/imager/direct.py
> > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > @@ -541,7 +541,12 @@ class PartitionedImage():
> >      def cleanup(self):
> >          # remove partition images
> >          for image in set(self.partimages):
> > -            os.remove(image)
> > +            try:
> > +                os.remove(image)
> > +            except IOError as e:
> > +                logger.warning(
> > +                    "Could not delete file. {0}: I/O error ({1}): 
> > {2}\n".format(
> > +                    image, e.errno, e.strerror))
> >  
> >      def assemble(self):
> >          logger.debug("Installing partitions")
> > -- 
> > 2.11.0
> > 
> > -- 
> > _______________________________________________
> > Openembedded-core mailing list
> > [email protected]
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> -- 
> --
> Regards,
> Ed

-- 
Andreas Reichel 
Dipl.-Phys. (Univ.) 
Software Consultant

[email protected] 
+49-174-3180074

TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Christoph Stock, Dr. Robert Dahlke
Sitz: Unterföhring * Amtsgericht München * HRB 135082

Attachment: signature.asc
Description: PGP signature

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to