Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Andreas Reichel <Andreas.Reichel@tngtech.com>
To: Ed Bartosh <ed.bartosh@linux.intel.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Andreas Reichel <andreas.reichel.ext@siemens.com>,
	Daniel Wagner <daniel.wagner@siemens.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [wic patch 1/5] wic: Catch errors during image files clean-up
Date: Wed, 3 May 2017 10:45:52 +0200	[thread overview]
Message-ID: <20170503084552.GA1431@tng> (raw)
In-Reply-To: <20170502125638.GA17260@linux.intel.com>

[-- Attachment #1: message --]
[-- Type: text/plain, Size: 3069 bytes --]

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 <andreas.reichel.ext@siemens.com>
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
> > 
> > ---
> >  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
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> -- 
> --
> Regards,
> Ed

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

Andreas.Reichel@tngtech.com 
+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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

  reply	other threads:[~2017-05-03  8:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 12:11 [wic patch 0/5] Add option to wic and use argparse Andreas J. Reichel
2017-04-21 12:11 ` [wic patch 1/5] wic: Catch errors during image files clean-up Andreas J. Reichel
2017-05-02 12:56   ` Ed Bartosh
2017-05-03  8:45     ` Andreas Reichel [this message]
2017-05-03 10:32       ` Ed Bartosh
2017-04-21 12:11 ` [wic patch 2/5] wic: Use argparse instead of optparse Andreas J. Reichel
2017-04-23 19:58   ` Burton, Ross
2017-04-26 10:34     ` Andreas Reichel
2017-04-26 13:03       ` Burton, Ross
2017-04-21 12:11 ` [wic patch 3/5] wic: Add missing text to usage and help strings Andreas J. Reichel
2017-04-21 12:11 ` [wic patch 4/5] wic: Add option to keep partition images Andreas J. Reichel
2017-04-21 12:11 ` [wic patch 5/5] wic: Use enum like dicts for string constants Andreas J. Reichel
2017-05-02 13:36   ` Ed Bartosh
2017-05-03  8:47     ` Andreas Reichel
2017-05-03 12:18       ` Ed Bartosh
2017-05-02 14:37 ` [wic patch 0/5] Add option to wic and use argparse Ed Bartosh
2017-05-03  8:49   ` Andreas Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170503084552.GA1431@tng \
    --to=andreas.reichel@tngtech.com \
    --cc=andreas.reichel.ext@siemens.com \
    --cc=daniel.wagner@siemens.com \
    --cc=ed.bartosh@linux.intel.com \
    --cc=jan.kiszka@siemens.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox