summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2013-05-23 12:43:33 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-23 10:28:04 +0100
commitd837fb346d465b34285df36f9533bf39502eff0e (patch)
treedc2ea7a72711d9413354b6266ed4903e499c1e2b /meta/classes/image.bbclass
parent21089515bd18ba18e86ec8f72ff8141b9fb1dea8 (diff)
downloadpoky-d837fb346d465b34285df36f9533bf39502eff0e.tar.gz
image.bbclass: add postinst_enable_logging
Add a function postinst_enable_logging, so that when 'debug-tweaks' is in IMAGE_FEATURES, we create ${sysconfdir}/default/postinst config file, which is sourced by run-postinst scripts to determine whether to log or not, and where to log. [YOCTO #4262] (From OE-Core rev: 99175cabc3936733dd92fac5ebc6f865b864fe92) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 4f077082da..04db533128 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -175,6 +175,10 @@ MACHINE_POSTPROCESS_COMMAND ?= ""
175ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; " 175ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; "
176# Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks is enabled 176# Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks is enabled
177ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "ssh_allow_empty_password; ", "",d)}' 177ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "ssh_allow_empty_password; ", "",d)}'
178# Enable postinst logging if debug-tweaks is enabled
179ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "postinst_enable_logging; ", "",d)}'
180# Set default postinst log file
181POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
178 182
179# some default locales 183# some default locales
180IMAGE_LINGUAS ?= "de-de fr-fr en-gb" 184IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
@@ -484,6 +488,13 @@ ssh_allow_empty_password () {
484 fi 488 fi
485} 489}
486 490
491# Enable postinst logging if debug-tweaks is enabled
492postinst_enable_logging () {
493 mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/default
494 echo "POSTINST_LOGGING=1" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst
495 echo "LOGFILE=${POSTINST_LOGFILE}" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst
496}
497
487# Turn any symbolic /sbin/init link into a file 498# Turn any symbolic /sbin/init link into a file
488remove_init_link () { 499remove_init_link () {
489 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then 500 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then