mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
dpkg: save output of postinstall scripts when image firstboot
When image feature "debug-tweaks" enabled, save output of postinstall scripts to log file /var/log/postinstall.log when image first boot. And the log file can be configured. It also needs image feature "package-management" enabled. If not, package run-postinsts will be installed and then all packages will be configured by it. Command 'dpkg --configure' outputs nothing. [YOCTO #3223] (From OE-Core rev: 684b94317f5b78f6c9c993f84438f8fa7e59fd5a) Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -2,7 +2,7 @@ DESCRIPTION = "Package maintenance system for Debian."
|
|||||||
LICENSE = "GPLv2.0+"
|
LICENSE = "GPLv2.0+"
|
||||||
SECTION = "base"
|
SECTION = "base"
|
||||||
|
|
||||||
INC_PR = "r18"
|
INC_PR = "r19"
|
||||||
|
|
||||||
SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz \
|
SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz \
|
||||||
file://ignore_extra_fields.patch"
|
file://ignore_extra_fields.patch"
|
||||||
@@ -35,13 +35,15 @@ do_configure () {
|
|||||||
autotools_do_configure
|
autotools_do_configure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POSTLOG ?= "/var/log/postinstall.log"
|
||||||
|
REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
|
||||||
|
|
||||||
DPKG_INIT_POSITION ?= "98"
|
DPKG_INIT_POSITION ?= "98"
|
||||||
do_install_prepend () {
|
do_install_prepend () {
|
||||||
install -d ${D}/${sysconfdir}/rcS.d
|
install -d ${D}/${sysconfdir}/rcS.d
|
||||||
# this happens at S98 where our good 'ole packages script used to run
|
# this happens at S98 where our good 'ole packages script used to run
|
||||||
printf "#!/bin/sh
|
echo "#!/bin/sh
|
||||||
dpkg --configure -a
|
dpkg --configure -a ${REDIRECT_CMD}
|
||||||
rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
|
rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
|
||||||
" > ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
|
" > ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
|
||||||
chmod 0755 ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
|
chmod 0755 ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
|
||||||
|
|||||||
Reference in New Issue
Block a user