diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2011-11-10 10:30:21 -0600 |
---|---|---|
committer | Saul Wold <sgw@linux.intel.com> | 2011-11-11 00:33:49 -0800 |
commit | 3e7120d6a9fd5e46214673d0a6e1085a7314ff42 (patch) | |
tree | 1dfc78dc1355d509cbf5dd9eb88190a94be7bf08 /meta/classes/rootfs_rpm.bbclass | |
parent | 815560c0ee5a1a984b7d0fc8417c46606854e7fe (diff) | |
download | openembedded-core-3e7120d6a9fd5e46214673d0a6e1085a7314ff42.tar.gz openembedded-core-3e7120d6a9fd5e46214673d0a6e1085a7314ff42.tar.bz2 openembedded-core-3e7120d6a9fd5e46214673d0a6e1085a7314ff42.zip |
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.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 25 |
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" do_rootfs[recrdeptask] += "do_package_write_rpm" -AWKPOSTINSTSCRIPT = "${COREBASE}/scripts/rootfs_rpm-extract-postinst.awk" - RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; " RPM_POSTPROCESS_COMMANDS = "" @@ -108,19 +106,9 @@ EOF ${ROOTFS_POSTINSTALL_COMMAND} - mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/ - ${RPM} --root ${IMAGE_ROOTFS} -D '_dbpath ${rpmlibdir}' -qa \ - -D "__dbi_txn create nofsync private" \ - --qf 'Name: %{NAME}\n%|POSTIN?{postinstall scriptlet%|POSTINPROG?{ (using %{POSTINPROG})}|:\n%{POSTIN}\n}:{%|POSTINPROG?{postinstall program: %{POSTINPROG}\n}|}|' \ - > ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined - awk -f ${AWKPOSTINSTSCRIPT} < ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined - rm ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined - - for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*.sh; do - if [ -f $i ] && sh $i; then - # rm $i - mv $i $i.done - fi + # Report delayed package scriptlets + for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*; do + echo "Delayed package scriptlet: `head -n 3 $i | tail -n 1`" done install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d @@ -128,11 +116,10 @@ EOF i=\$i cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure << EOF #!/bin/sh -for i in /etc/rpm-postinsts/*.sh; do +for i in /etc/rpm-postinsts/*; do echo "Running postinst $i..." - if [ -f $i ] && sh $i; then - # rm $i - mv $i $i.done + if [ -f $i ] && $i; then + rm $i else echo "ERROR: postinst $i failed." fi |