@@ -7,6 +7,9 @@
inherit sbuild
+PP = "/home/builder/${PN}-${MACHINE}"
+ext_root="${PP}/rootfs"
+
IMAGER_INSTALL ??= ""
IMAGER_BUILD_DEPS ??= ""
DEPENDS += "${IMAGER_BUILD_DEPS}"
@@ -58,10 +61,17 @@ imager_run() {
EOAPT
deb_dl_dir_export ${schroot_dir} ${distro}
- schroot -r -c ${session_id} -d / -u root -- sh -c " \
+ export local_install=${local_install}
+ schroot -r -c ${session_id} -d / -u root -- /bin/bash <<"EOAPT"
+ rm -f /var/log/dpkg.log
+ pkg_status="$(dpkg-query --showformat='${binary:Package}\t' --show ${local_install} || echo "Not installed")"
apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y \
--allow-unauthenticated --allow-downgrades install \
- ${local_install}"
+ ${local_install}
+ if echo "${pkg_status}" | grep "Not installed"; then
+ cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log
+ fi
+EOAPT
fi
schroot -r -c ${session_id} "$@"
@@ -69,5 +79,10 @@ EOAPT
schroot -e -c ${session_id}
remove_mounts
+
schroot_delete_configs
+
+ if [ -e ${WORKDIR}/rootfs/dpkg_partial.log ]; then
+ sbuild_dpkg_log_export "${WORKDIR}/rootfs/dpkg_partial.log"
+ fi
}
@@ -72,7 +72,13 @@ ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
ROOTFS_PACKAGE_SUFFIX ?= "${PN}-${DISTRO}-${MACHINE}"
-ROOTFS_POSTPROCESS_COMMAND:prepend = "${@bb.utils.contains('BASE_REPO_FEATURES', 'cache-deb-src', 'cache_deb_src', '', d)} "
+CACHE_DEB_SRC = "${@bb.utils.contains('BASE_REPO_FEATURES', 'cache-deb-src', '1', '0', d)}"
+
+python () {
+ if bb.utils.to_boolean(d.getVar('CACHE_DEB_SRC')):
+ bb.build.addtask('do_cache_deb_src', 'do_deploy', 'do_image', d)
+}
+
inherit rootfs
inherit sdk
@@ -272,7 +272,8 @@ python do_rootfs_install() {
}
addtask rootfs_install before do_rootfs_postprocess after do_unpack
-cache_deb_src() {
+do_cache_deb_src[network] = "${TASK_USE_SUDO}"
+do_cache_deb_src() {
if [ -e "${ROOTFSDIR}"/etc/resolv.conf ] ||
[ -h "${ROOTFSDIR}"/etc/resolv.conf ]; then
sudo mv "${ROOTFSDIR}"/etc/resolv.conf "${ROOTFSDIR}"/etc/resolv.conf.isar