Patchwork [v2,1/1] image.bbclass: leave metadata in place if a PM is installed in the image

login
register
mail settings
Submitter Laurentiu Palcu
Date Sept. 5, 2013, 9:03 a.m.
Message ID <458079bc072716290bebe261aa1c24d4c40a2b7a.1378371716.git.laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/57441/
State New
Headers show

Comments

Laurentiu Palcu - Sept. 5, 2013, 9:03 a.m.
If IMAGE_FEATURES does not contain 'package-management' but the user
manually installs a package manager (opkg/dpkg/rpm) using
CORE_IMAGE_EXTRA_INSTALL (for example), then do not remove update-rc.d,
base-passwd and package metadata because these will be needed by the
package manager to function correcly.

[YOCTO #4484]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/image.bbclass |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Laurentiu Palcu - Sept. 5, 2013, 2:32 p.m.
Ignore this patch for the moment. I'm investigating another alternative.

Laurentiu

On Thu, Sep 05, 2013 at 12:03:49PM +0300, Laurentiu Palcu wrote:
> If IMAGE_FEATURES does not contain 'package-management' but the user
> manually installs a package manager (opkg/dpkg/rpm) using
> CORE_IMAGE_EXTRA_INSTALL (for example), then do not remove update-rc.d,
> base-passwd and package metadata because these will be needed by the
> package manager to function correcly.
> 
> [YOCTO #4484]
> 
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> ---
>  meta/classes/image.bbclass |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 84f638c..b748397 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -498,7 +498,11 @@ rootfs_install_complementary() {
>  }
>  
>  rootfs_uninstall_unneeded () {
> -	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
> +	rpm_installed=${@base_contains("PACKAGE_INSTALL", "rpm",  "true", "false", d)}
> +	opkg_installed=${@base_contains("PACKAGE_INSTALL", "opkg", "true", "false", d)}
> +	dpkg_installed=${@base_contains("PACKAGE_INSTALL", "dpkg", "true", "false", d)}
> +
> +	if ! $rpm_installed && ! $opkg_installed && ! $dpkg_installed; then
>  		if [ -z "$(delayed_postinsts)" ]; then
>  			# All packages were successfully configured.
>  			# update-rc.d, base-passwd, run-postinsts are no further use, remove them now
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 84f638c..b748397 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -498,7 +498,11 @@  rootfs_install_complementary() {
 }
 
 rootfs_uninstall_unneeded () {
-	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
+	rpm_installed=${@base_contains("PACKAGE_INSTALL", "rpm",  "true", "false", d)}
+	opkg_installed=${@base_contains("PACKAGE_INSTALL", "opkg", "true", "false", d)}
+	dpkg_installed=${@base_contains("PACKAGE_INSTALL", "dpkg", "true", "false", d)}
+
+	if ! $rpm_installed && ! $opkg_installed && ! $dpkg_installed; then
 		if [ -z "$(delayed_postinsts)" ]; then
 			# All packages were successfully configured.
 			# update-rc.d, base-passwd, run-postinsts are no further use, remove them now