summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm-postinsts.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm-postinsts.bb')
-rw-r--r--meta/recipes-devtools/rpm/rpm-postinsts.bb50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm-postinsts.bb b/meta/recipes-devtools/rpm/rpm-postinsts.bb
new file mode 100644
index 0000000000..27ef2aa384
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-postinsts.bb
@@ -0,0 +1,50 @@
1DESCRIPTION = "RPM postinstall script"
2SECTION = "core"
3LICENSE = "LGPLv2.1"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
5
6RDEPENDS_${PN} = "base-files"
7
8inherit update-rc.d allarch
9#
10# Allow distributions to alter when [postponed] package install scripts are run
11#
12POSTINSTALL_INITPOSITION ?= "98"
13
14INITSCRIPT_NAME = "run-postinsts"
15INITSCRIPT_PARAMS = "start ${{POSTINSTALL_INITPOSITION} S ."
16
17POSTLOG ?= "/var/log/postinstall.log"
18REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>>${POSTLOG} 2>&1', '', d)}"
19
20do_fetch() {
21 :
22}
23
24do_configure() {
25 :
26}
27
28do_compile() {
29 :
30}
31
32do_install() {
33 install -d ${D}/${sysconfdir}/rcS.d
34 # Stop $i getting expanded below...
35 i=\$i
36 cat > ${D}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << EOF
37#!/bin/sh
38for i in \`ls /etc/rpm-postinsts/\`; do
39 i=/etc/rpm-postinsts/$i
40 echo "Running postinst $i..."
41 if [ -f $i ] && $i ${REDIRECT_CMD}; then
42 rm $i
43 else
44 echo "ERROR: postinst $i failed."
45 fi
46done
47rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
48EOF
49 chmod 0755 ${D}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
50}