diff options
author | Gary Thomas <gary@mlbassoc.com> | 2011-04-18 08:23:27 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-04-24 22:50:21 +0100 |
commit | 8e7f1b444e2ea3cc7fe7ddbf0568f4eee15a33b0 (patch) | |
tree | 4464709acb9f8adcb37b640dcc78d24d879f8081 /meta/classes | |
parent | 46197c431d283022acbdec6596f1904d15b545b0 (diff) | |
download | poky-8e7f1b444e2ea3cc7fe7ddbf0568f4eee15a33b0.tar.gz |
Control over when package init scripts are run
When a package is built, some installation scripts must be
performed on the target. In the case of a complete image,
these scripts are run by a separate step at init time, but
only during the first boot (other package install scripts
can just be run when the package is installed on the target).
This patch lets the distribution (or user) decide when these
postponed install scripts should run. The default is normally
near the end of init, but there may be times when it's beneficial
to run them earlier so the "when" can be overridden.
(From OE-Core rev: a46466893407d44dd16ab37ae70e1bee14bdde0a)
Signed-off-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index aa1b339550..3a11858cd0 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass | |||
@@ -26,6 +26,11 @@ RPM_POSTPROCESS_COMMANDS = "" | |||
26 | # | 26 | # |
27 | #IMAGE_LOCALES="en-gb" | 27 | #IMAGE_LOCALES="en-gb" |
28 | 28 | ||
29 | # | ||
30 | # Allow distributions to alter when [postponed] package install scripts are run | ||
31 | # | ||
32 | POSTINSTALL_INITPOSITION ?= "98" | ||
33 | |||
29 | rpmlibdir = "/var/lib/rpm" | 34 | rpmlibdir = "/var/lib/rpm" |
30 | opkglibdir = "${localstatedir}/lib/opkg" | 35 | opkglibdir = "${localstatedir}/lib/opkg" |
31 | 36 | ||
@@ -116,7 +121,7 @@ EOF | |||
116 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d | 121 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d |
117 | # Stop $i getting expanded below... | 122 | # Stop $i getting expanded below... |
118 | i=\$i | 123 | i=\$i |
119 | cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure << EOF | 124 | cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure << EOF |
120 | #!/bin/sh | 125 | #!/bin/sh |
121 | for i in /etc/rpm-postinsts/*.sh; do | 126 | for i in /etc/rpm-postinsts/*.sh; do |
122 | echo "Running postinst $i..." | 127 | echo "Running postinst $i..." |
@@ -127,9 +132,9 @@ for i in /etc/rpm-postinsts/*.sh; do | |||
127 | echo "ERROR: postinst $i failed." | 132 | echo "ERROR: postinst $i failed." |
128 | fi | 133 | fi |
129 | done | 134 | done |
130 | rm -f ${sysconfdir}/rcS.d/S98configure | 135 | rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure |
131 | EOF | 136 | EOF |
132 | chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure | 137 | chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure |
133 | 138 | ||
134 | install -d ${IMAGE_ROOTFS}/${sysconfdir} | 139 | install -d ${IMAGE_ROOTFS}/${sysconfdir} |
135 | echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version | 140 | echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version |