diff options
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r-- | meta/classes/package.bbclass | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 7dc759699f..6a7f35a3e7 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -1320,6 +1320,25 @@ python emit_pkgdata() { | |||
1320 | from glob import glob | 1320 | from glob import glob |
1321 | import json | 1321 | import json |
1322 | 1322 | ||
1323 | def process_postinst_on_target(pkg, mlprefix): | ||
1324 | defer_fragment = """ | ||
1325 | if [ -n "$D" ]; then | ||
1326 | $INTERCEPT_DIR/postinst_intercept delay_to_first_boot %s mlprefix=%s | ||
1327 | exit 0 | ||
1328 | fi | ||
1329 | """ % (pkg, mlprefix) | ||
1330 | |||
1331 | postinst = d.getVar('pkg_postinst_%s' % pkg) | ||
1332 | postinst_ontarget = d.getVar('pkg_postinst_ontarget_%s' % pkg) | ||
1333 | |||
1334 | if postinst_ontarget: | ||
1335 | bb.debug(1, 'adding deferred pkg_postinst_ontarget() to pkg_postinst() for %s' % pkg) | ||
1336 | if not postinst: | ||
1337 | postinst = '#!/bin/sh\n' | ||
1338 | postinst += defer_fragment | ||
1339 | postinst += postinst_ontarget | ||
1340 | d.setVar('pkg_postinst_%s' % pkg, postinst) | ||
1341 | |||
1323 | def write_if_exists(f, pkg, var): | 1342 | def write_if_exists(f, pkg, var): |
1324 | def encode(str): | 1343 | def encode(str): |
1325 | import codecs | 1344 | import codecs |
@@ -1415,6 +1434,7 @@ python emit_pkgdata() { | |||
1415 | write_if_exists(sf, pkg, 'ALLOW_EMPTY') | 1434 | write_if_exists(sf, pkg, 'ALLOW_EMPTY') |
1416 | write_if_exists(sf, pkg, 'FILES') | 1435 | write_if_exists(sf, pkg, 'FILES') |
1417 | write_if_exists(sf, pkg, 'CONFFILES') | 1436 | write_if_exists(sf, pkg, 'CONFFILES') |
1437 | process_postinst_on_target(pkg, d.getVar("MLPREFIX")) | ||
1418 | write_if_exists(sf, pkg, 'pkg_postinst') | 1438 | write_if_exists(sf, pkg, 'pkg_postinst') |
1419 | write_if_exists(sf, pkg, 'pkg_postrm') | 1439 | write_if_exists(sf, pkg, 'pkg_postrm') |
1420 | write_if_exists(sf, pkg, 'pkg_preinst') | 1440 | write_if_exists(sf, pkg, 'pkg_preinst') |