summaryrefslogtreecommitdiff
path: root/meta-selftest/recipes-test
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2018-01-29 14:01:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-29 23:08:12 +0000
commit229f4e975fb6957f44b5c56735fd6d58564098d7 (patch)
tree3b8428bcc601828d3622633a0a1b6cf3b39e4bf1 /meta-selftest/recipes-test
parent939f7f1a06cd2db05aeb5e75a66322314e10aa6d (diff)
downloadopenembedded-core-229f4e975fb6957f44b5c56735fd6d58564098d7.tar.gz
openembedded-core-229f4e975fb6957f44b5c56735fd6d58564098d7.tar.bz2
openembedded-core-229f4e975fb6957f44b5c56735fd6d58564098d7.zip
package.bbclass: add support for pkg_postinst_ontarget()
This function is a convenient and more readable shortcut for situations when the postinst code always needs to run on target. All commands that cannot be executed during cross-install and can only be run on target should go into this function. They will only be executed on first boot (if package was cross-installed) or immediately during package installation on target. Plain pkg_postinst() works as before: it is run during cross-install time, it can contain a request to defer to first boot, and it is also run during package installation on target. Also fix the oeqa test for this functionality to use the new function where appropriate. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest/recipes-test')
-rw-r--r--meta-selftest/recipes-test/postinst/postinst_1.0.bb14
1 files changed, 2 insertions, 12 deletions
diff --git a/meta-selftest/recipes-test/postinst/postinst_1.0.bb b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
index 112aa08c80..d4bab6dcc2 100644
--- a/meta-selftest/recipes-test/postinst/postinst_1.0.bb
+++ b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
@@ -35,14 +35,9 @@ pkg_postinst_${PN}-rootfs () {
# Depends on rootfs, delays until first boot, verifies that the rootfs file was
# written.
-pkg_postinst_${PN}-delayed-a () {
+pkg_postinst_ontarget_${PN}-delayed-a () {
set -e
- if [ -n "$D" ]; then
- echo "Delaying ${PN}-delayed-a until first boot"
- exit 1
- fi
-
if [ ! -e ${TESTDIR}/rootfs ]; then
echo "${PN}-delayed-a: ${TESTDIR}/rootfs not found"
exit 1
@@ -53,14 +48,9 @@ pkg_postinst_${PN}-delayed-a () {
# Depends on delayed-a, delays until first boot, verifies that the delayed-a file was
# written. This verifies the ordering between delayed postinsts.
-pkg_postinst_${PN}-delayed-b () {
+pkg_postinst_ontarget_${PN}-delayed-b () {
set -e
- if [ -n "$D" ]; then
- echo "Delaying ${PN}-delayed-b until first boot"
- exit 1
- fi
-
if [ ! -e ${TESTDIR}/delayed-a ]; then
echo "${PN}-delayed-b: ${TESTDIR}/delayed-a not found"
exit 1