Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Laurentiu Palcu <laurentiu.palcu@intel.com>
To: Hongxu Jia <hongxu.jia@windriver.com>
Cc: saul.wold@intel.com, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 5/5] rootfs.py: support BAD_RECOMMENDATIONS for ipk incremental image generation
Date: Thu, 20 Feb 2014 17:22:51 +0200	[thread overview]
Message-ID: <20140220152251.GD30981@lpalcu-linux> (raw)
In-Reply-To: <462aa5e46663d9a7a47f69649e716dbecedb20f7.1392877826.git.hongxu.jia@windriver.com>

On Thu, Feb 20, 2014 at 03:06:55PM +0800, Hongxu Jia wrote:
> While incremental image generation enabled and the previous image is
> existed, if BAD_RECOMMENDATIONS is changed, the operation on the
> existing image is complicated, so remove the existing image in this
> situation.
> 
> The same with PACKAGE_EXCLUDE and NO_RECOMMENDATIONS.
> 
> [YOCTO #1894]
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/lib/oe/rootfs.py | 29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index 6120bce..80be490 100644
> --- a/meta/lib/oe/rootfs.py
> +++ b/meta/lib/oe/rootfs.py
> @@ -445,7 +445,7 @@ class OpkgRootfs(Rootfs):
>          self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True)
>  
>          self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN', True) or ""
> -        if self.inc_opkg_image_gen != '1':
> +        if self._remove_existing_image():
>              bb.utils.remove(self.image_rootfs, True)
>              self.pm = OpkgPM(d,
>                               self.image_rootfs,
> @@ -595,6 +595,33 @@ class OpkgRootfs(Rootfs):
>                  bb.note('decremental removed: %s' % ' '.join(pkg_to_remove))
>                  self.pm.remove(pkg_to_remove)
>  
> +    '''
> +    Compare with previous existing image creation, if some conditions
> +    triggered, the previous existing image should be removed.
> +    The conditions include any of 'PACKAGE_EXCLUDE, NO_RECOMMENDATIONS
> +    and BAD_RECOMMENDATIONS' has been changed.
> +    '''
> +    def _remove_existing_image(self):
Since we're not removing the image, but the old rootfs, a better name
for this would be: _remove_old_rootfs().

> +        if self.inc_opkg_image_gen != "1":
> +            return True
> +
> +        vars_list_file = self.d.expand('${T}/vars_list')
> +
> +        old_vars_list = ""
> +        if os.path.exists(vars_list_file):
> +            old_vars_list = open(vars_list_file, 'r+').read()
> +
> +        new_vars_list = '%s:%s:%s\n' % \
> +                ((self.d.getVar('BAD_RECOMMENDATIONS', True) or '').strip(),
> +                 (self.d.getVar('NO_RECOMMENDATIONS', True) or '').strip(),
> +                 (self.d.getVar('PACKAGE_EXCLUDE', True) or '').strip())
> +        open(vars_list_file, 'w+').write(new_vars_list)
> +
> +        if old_vars_list != new_vars_list:
> +            return True
> +
> +        return False
> +
>      def _create(self):
>          pkgs_to_install = self.manifest.parse_initial_manifest()
>          opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS', True)
> -- 
> 1.8.1.2
> 


      reply	other threads:[~2014-02-20 15:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20  7:06 [PATCH V2 0/5] manifest.py/package_manager.py/rootfs.py: support ipk incremental image generation Hongxu Jia
2014-02-20  7:06 ` [PATCH 1/5] manifest.py: add create_full for OpkgManifest class Hongxu Jia
2014-02-20 15:21   ` Laurentiu Palcu
2014-02-20  7:06 ` [PATCH 2/5] package_manager.py: support ipk incremental image generation Hongxu Jia
2014-02-20 15:22   ` Laurentiu Palcu
2014-02-20  7:06 ` [PATCH 3/5] rootfs.py: " Hongxu Jia
2014-02-20 15:22   ` Laurentiu Palcu
2014-02-20  7:06 ` [PATCH 4/5] rootfs.py: tweak _multilib_sanity_test for " Hongxu Jia
2014-02-20  7:06 ` [PATCH 5/5] rootfs.py: support BAD_RECOMMENDATIONS " Hongxu Jia
2014-02-20 15:22   ` Laurentiu Palcu [this message]

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=20140220152251.GD30981@lpalcu-linux \
    --to=laurentiu.palcu@intel.com \
    --cc=hongxu.jia@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=saul.wold@intel.com \
    /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