summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_rpm.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-11-10 10:30:21 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-11 11:01:07 +0000
commitef1d61d711102b3417e83e56d4e2746f5b6a5db9 (patch)
tree11fd7e88d6e9cc6dcfad673211b6259436cbd84b /meta/classes/rootfs_rpm.bbclass
parent298278257bdba9c684ae293351b1cf421b5b3e50 (diff)
downloadpoky-ef1d61d711102b3417e83e56d4e2746f5b6a5db9.tar.gz
rootfs_rpm.bbclass: Enable pre and post install scripts
[YOCTO #1755] We change the want the RPM rootfs install works to install pre and post install scripts. The new method uses a script helper that is invoked by RPM outside of the normal chroot. The wrapper is dynamically generated prior to the install starting. It will check the return code of the script. If the script fails, it will store a copy to be executed on the first system boot. This is similar to the previous mechanism. In addition, a line of debug was added to the scripts as written by package_rpm to list which package and which script for later debugging, if necessary. (From OE-Core rev: 3e7120d6a9fd5e46214673d0a6e1085a7314ff42) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r--meta/classes/rootfs_rpm.bbclass25
1 files changed, 6 insertions, 19 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 95e9455e5c..b3875a437c 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -20,8 +20,6 @@ do_rootfs[depends] += "opkg-native:do_populate_sysroot"
20 20
21do_rootfs[recrdeptask] += "do_package_write_rpm" 21do_rootfs[recrdeptask] += "do_package_write_rpm"
22 22
23AWKPOSTINSTSCRIPT = "${COREBASE}/scripts/rootfs_rpm-extract-postinst.awk"
24
25RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; " 23RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; "
26RPM_POSTPROCESS_COMMANDS = "" 24RPM_POSTPROCESS_COMMANDS = ""
27 25
@@ -108,19 +106,9 @@ EOF
108 106
109 ${ROOTFS_POSTINSTALL_COMMAND} 107 ${ROOTFS_POSTINSTALL_COMMAND}
110 108
111 mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/ 109 # Report delayed package scriptlets
112 ${RPM} --root ${IMAGE_ROOTFS} -D '_dbpath ${rpmlibdir}' -qa \ 110 for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*; do
113 -D "__dbi_txn create nofsync private" \ 111 echo "Delayed package scriptlet: `head -n 3 $i | tail -n 1`"
114 --qf 'Name: %{NAME}\n%|POSTIN?{postinstall scriptlet%|POSTINPROG?{ (using %{POSTINPROG})}|:\n%{POSTIN}\n}:{%|POSTINPROG?{postinstall program: %{POSTINPROG}\n}|}|' \
115 > ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
116 awk -f ${AWKPOSTINSTSCRIPT} < ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
117 rm ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
118
119 for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*.sh; do
120 if [ -f $i ] && sh $i; then
121 # rm $i
122 mv $i $i.done
123 fi
124 done 112 done
125 113
126 install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d 114 install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d
@@ -128,11 +116,10 @@ EOF
128 i=\$i 116 i=\$i
129 cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure << EOF 117 cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure << EOF
130#!/bin/sh 118#!/bin/sh
131for i in /etc/rpm-postinsts/*.sh; do 119for i in /etc/rpm-postinsts/*; do
132 echo "Running postinst $i..." 120 echo "Running postinst $i..."
133 if [ -f $i ] && sh $i; then 121 if [ -f $i ] && $i; then
134 # rm $i 122 rm $i
135 mv $i $i.done
136 else 123 else
137 echo "ERROR: postinst $i failed." 124 echo "ERROR: postinst $i failed."
138 fi 125 fi