diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm-postinsts.bb')
-rw-r--r-- | meta/recipes-devtools/rpm/rpm-postinsts.bb | 50 |
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 @@ | |||
1 | DESCRIPTION = "RPM postinstall script" | ||
2 | SECTION = "core" | ||
3 | LICENSE = "LGPLv2.1" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780" | ||
5 | |||
6 | RDEPENDS_${PN} = "base-files" | ||
7 | |||
8 | inherit update-rc.d allarch | ||
9 | # | ||
10 | # Allow distributions to alter when [postponed] package install scripts are run | ||
11 | # | ||
12 | POSTINSTALL_INITPOSITION ?= "98" | ||
13 | |||
14 | INITSCRIPT_NAME = "run-postinsts" | ||
15 | INITSCRIPT_PARAMS = "start ${{POSTINSTALL_INITPOSITION} S ." | ||
16 | |||
17 | POSTLOG ?= "/var/log/postinstall.log" | ||
18 | REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>>${POSTLOG} 2>&1', '', d)}" | ||
19 | |||
20 | do_fetch() { | ||
21 | : | ||
22 | } | ||
23 | |||
24 | do_configure() { | ||
25 | : | ||
26 | } | ||
27 | |||
28 | do_compile() { | ||
29 | : | ||
30 | } | ||
31 | |||
32 | do_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 | ||
38 | for 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 | ||
46 | done | ||
47 | rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts | ||
48 | EOF | ||
49 | chmod 0755 ${D}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts | ||
50 | } | ||