Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix run-postinsts
@ 2014-03-27 12:43 Laurentiu Palcu
  2014-03-27 12:43 ` [PATCH 1/1] run-postinsts: fix issue with checking IMAGE_FEATURES Laurentiu Palcu
  0 siblings, 1 reply; 2+ messages in thread
From: Laurentiu Palcu @ 2014-03-27 12:43 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 0150bc30d3674301631c2e9b6c64e01058fd1070:

  bitbake: runqueue: Really fix sigchld handling (2014-03-18 23:05:53 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib lpalcu/b5666_unique_run_postinsts
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=lpalcu/b5666_unique_run_postinsts

Laurentiu Palcu (1):
  run-postinsts: fix issue with checking IMAGE_FEATURES

 .../run-postinsts/run-postinsts/run-postinsts      |   30 +++++++++++++++-----
 .../run-postinsts/run-postinsts_1.0.bb             |    2 --
 2 files changed, 23 insertions(+), 9 deletions(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] run-postinsts: fix issue with checking IMAGE_FEATURES
  2014-03-27 12:43 [PATCH 0/1] Fix run-postinsts Laurentiu Palcu
@ 2014-03-27 12:43 ` Laurentiu Palcu
  0 siblings, 0 replies; 2+ messages in thread
From: Laurentiu Palcu @ 2014-03-27 12:43 UTC (permalink / raw)
  To: openembedded-core

The old implementation was wrong. It was not very generic and it checked
IMAGE_FEATURES while building the recipe, which led to various issues
with the generation of the final script. That is, the run-postinsts
script was generated once, while building the package for the first
time. Hence, any other changes to IMAGE_FEATURES, like removing/adding
'package-management' did not reflect in the final script.

This commit makes run-postinsts script autodetect the backend used for
creating the image, making it generic.

[YOCTO #5666]
[YOCTO #5972]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 .../run-postinsts/run-postinsts/run-postinsts      |   30 +++++++++++++++-----
 .../run-postinsts/run-postinsts_1.0.bb             |    2 --
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
index 08cfa9e..f547a7b 100755
--- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -8,9 +8,29 @@
 # The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts,
 # #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-posinsts.
 
-pm=#IMAGE_PKGTYPE#
-pm_installed=#PM_INSTALLED#
-pi_dir=#SYSCONFDIR#/${pm}-postinsts
+# the order of this list is important, do not change!
+backend_list="rpm deb ipk"
+
+pm_installed=false
+
+for pm in $backend_list; do
+	pi_dir="#SYSCONFDIR#/$pm-postinsts"
+
+	[ -d $pi_dir ] && break
+
+	case $pm in
+		"deb")
+			if [ -s "/var/lib/dpkg/status" ]; then
+				pm_installed=true
+				break
+			fi
+			;;
+
+		"ipk")
+			pm_installed=true
+			;;
+	esac
+done
 
 remove_rcsd_link () {
 	if [ -n "`which update-rc.d`" ]; then
@@ -56,10 +76,6 @@ if $pm_installed; then
 		"deb")
 			eval dpkg --configure -a $append_log
 			;;
-
-		"rpm")
-			exec_postinst_scriptlets
-			;;
 	esac
 else
 	exec_postinst_scriptlets
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb b/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
index e990c67..64f85c2 100644
--- a/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
@@ -37,8 +37,6 @@ do_install() {
 	sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
                -e 's:#SBINDIR#:${sbindir}:g' \
                -e 's:#BASE_BINDIR#:${base_bindir}:g' \
-               -e 's:#IMAGE_PKGTYPE#:${IMAGE_PKGTYPE}:g' \
-               -e 's:#PM_INSTALLED#:${@base_contains("IMAGE_FEATURES", "package-management", "true", "false", d)}:g' \
                ${D}${sbindir}/run-postinsts \
                ${D}${systemd_unitdir}/system/run-postinsts.service
 }
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-27 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 12:43 [PATCH 0/1] Fix run-postinsts Laurentiu Palcu
2014-03-27 12:43 ` [PATCH 1/1] run-postinsts: fix issue with checking IMAGE_FEATURES Laurentiu Palcu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox