summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/run-postinsts
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-03-27 14:43:57 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-27 15:44:43 +0000
commitcbefaa3e3160aed390722b301e909f72b22dbbb8 (patch)
treea99ee31169e86eb11ea49bec695d95f893aea579 /meta/recipes-devtools/run-postinsts
parentad1447d6526ace1d8e635fc8a3d15098426f5a6b (diff)
downloadpoky-cbefaa3e3160aed390722b301e909f72b22dbbb8.tar.gz
run-postinsts: fix issue with checking IMAGE_FEATURES
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] (From OE-Core rev: 44902f7550e490a9d4d2e2bcdf8c577329b4af75) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/run-postinsts')
-rwxr-xr-xmeta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts30
-rw-r--r--meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb2
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 08cfa9e59f..f547a7b7bd 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 @@
8# The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts, 8# The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts,
9# #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-posinsts. 9# #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-posinsts.
10 10
11pm=#IMAGE_PKGTYPE# 11# the order of this list is important, do not change!
12pm_installed=#PM_INSTALLED# 12backend_list="rpm deb ipk"
13pi_dir=#SYSCONFDIR#/${pm}-postinsts 13
14pm_installed=false
15
16for pm in $backend_list; do
17 pi_dir="#SYSCONFDIR#/$pm-postinsts"
18
19 [ -d $pi_dir ] && break
20
21 case $pm in
22 "deb")
23 if [ -s "/var/lib/dpkg/status" ]; then
24 pm_installed=true
25 break
26 fi
27 ;;
28
29 "ipk")
30 pm_installed=true
31 ;;
32 esac
33done
14 34
15remove_rcsd_link () { 35remove_rcsd_link () {
16 if [ -n "`which update-rc.d`" ]; then 36 if [ -n "`which update-rc.d`" ]; then
@@ -56,10 +76,6 @@ if $pm_installed; then
56 "deb") 76 "deb")
57 eval dpkg --configure -a $append_log 77 eval dpkg --configure -a $append_log
58 ;; 78 ;;
59
60 "rpm")
61 exec_postinst_scriptlets
62 ;;
63 esac 79 esac
64else 80else
65 exec_postinst_scriptlets 81 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 e990c670c0..64f85c262d 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() {
37 sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \ 37 sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
38 -e 's:#SBINDIR#:${sbindir}:g' \ 38 -e 's:#SBINDIR#:${sbindir}:g' \
39 -e 's:#BASE_BINDIR#:${base_bindir}:g' \ 39 -e 's:#BASE_BINDIR#:${base_bindir}:g' \
40 -e 's:#IMAGE_PKGTYPE#:${IMAGE_PKGTYPE}:g' \
41 -e 's:#PM_INSTALLED#:${@base_contains("IMAGE_FEATURES", "package-management", "true", "false", d)}:g' \
42 ${D}${sbindir}/run-postinsts \ 40 ${D}${sbindir}/run-postinsts \
43 ${D}${systemd_unitdir}/system/run-postinsts.service 41 ${D}${systemd_unitdir}/system/run-postinsts.service
44} 42}