summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2014-02-21 14:21:36 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-21 16:14:15 +0000
commitec87d0c8b952cc106666a3742493f0d9e0648796 (patch)
treebe7fb42374bed47c49a0cea1aebfd8a77bcf47f3 /meta/lib
parent1d4462db62893f2707d896e1c6478b62a6142431 (diff)
downloadpoky-ec87d0c8b952cc106666a3742493f0d9e0648796.tar.gz
rootfs.py: support BAD_RECOMMENDATIONS for ipk incremental image generation
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 old image in this situation. The same with PACKAGE_EXCLUDE and NO_RECOMMENDATIONS. [YOCTO #1894] (From OE-Core rev: 0566de3fa424af3bdfadcd0a08ce4c214abda083) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/rootfs.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index e0f6cd8582..78e9627682 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -443,7 +443,7 @@ class OpkgRootfs(Rootfs):
443 self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True) 443 self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True)
444 444
445 self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN', True) or "" 445 self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN', True) or ""
446 if self.inc_opkg_image_gen != "1": 446 if self._remove_old_rootfs():
447 bb.utils.remove(self.image_rootfs, True) 447 bb.utils.remove(self.image_rootfs, True)
448 self.pm = OpkgPM(d, 448 self.pm = OpkgPM(d,
449 self.image_rootfs, 449 self.image_rootfs,
@@ -546,6 +546,33 @@ class OpkgRootfs(Rootfs):
546 bb.note('decremental removed: %s' % ' '.join(pkg_to_remove)) 546 bb.note('decremental removed: %s' % ' '.join(pkg_to_remove))
547 self.pm.remove(pkg_to_remove) 547 self.pm.remove(pkg_to_remove)
548 548
549 '''
550 Compare with previous existing image creation, if some conditions
551 triggered, the previous old image should be removed.
552 The conditions include any of 'PACKAGE_EXCLUDE, NO_RECOMMENDATIONS
553 and BAD_RECOMMENDATIONS' has been changed.
554 '''
555 def _remove_old_rootfs(self):
556 if self.inc_opkg_image_gen != "1":
557 return True
558
559 vars_list_file = self.d.expand('${T}/vars_list')
560
561 old_vars_list = ""
562 if os.path.exists(vars_list_file):
563 old_vars_list = open(vars_list_file, 'r+').read()
564
565 new_vars_list = '%s:%s:%s\n' % \
566 ((self.d.getVar('BAD_RECOMMENDATIONS', True) or '').strip(),
567 (self.d.getVar('NO_RECOMMENDATIONS', True) or '').strip(),
568 (self.d.getVar('PACKAGE_EXCLUDE', True) or '').strip())
569 open(vars_list_file, 'w+').write(new_vars_list)
570
571 if old_vars_list != new_vars_list:
572 return True
573
574 return False
575
549 def _create(self): 576 def _create(self):
550 pkgs_to_install = self.manifest.parse_initial_manifest() 577 pkgs_to_install = self.manifest.parse_initial_manifest()
551 opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS', True) 578 opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS', True)