Bug 4160 - rpm-postinsts not installed on sato images
Summary: rpm-postinsts not installed on sato images
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 1.4 M6
Assignee: Chen Qi
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-04-01 07:54 UTC by Chen Qi
Modified: 2013-04-02 17:02 UTC (History)
9 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chen Qi 2013-04-01 07:54:37 UTC
rpm-postinsts is not installed on sato images.
In fact, for now, rpm-postinsts will not be installed if 'package-management' is in IMAGE_FEATURES.

meta/classes/image.bbclass:ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"

(This means that if package manager is not installed, we fall back to a bootstrap method, which is 'run-postinst' in case of ipk and deb. But rpm is a little different. Running its postinst scripts doesn't require a package manager installed on target, as these scripts are just shell scripts.)

meta/classes/image.bbclass:export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}"

Anyway, rpm-postinsts should be installed no matter package-management is in IMAGE_FEATURES or not.
Comment 1 Chen Qi 2013-04-01 08:00:12 UTC
Below is patch to try to fix this problem. Any comment or suggestion is welcome.

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 9721a6b..468aaa0 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -21,7 +21,8 @@ IMAGE_FEATURES ?= ""
 IMAGE_FEATURES[type] = "list"
 
 # rootfs bootstrap install
-ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
+# We use weak assignment to allow override.
+ROOTFS_BOOTSTRAP_INSTALL ?= "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
 
 # packages to install from features
 FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index d373dab..9a06a7d 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -4,6 +4,7 @@
 
 ROOTFS_PKGMANAGE = "rpm smartpm"
 ROOTFS_PKGMANAGE_BOOTSTRAP = "rpm-postinsts"
+ROOTFS_BOOTSTRAP_INSTALL = "${ROOTFS_PKGMANAGE_BOOTSTRAP}"
 
 # Add 50Meg of extra space for Smart
 IMAGE_ROOTFS_EXTRA_SPACE_append = "${@base_contains("PACKAGE_INSTALL", "smartpm", " + 51200", "" ,d)}"

//Chen Qi