@@ -450,11 +450,6 @@ do_rootfs_finalize() {
mountpoint -q '${ROOTFSDIR}/sys' && \
umount -l ${ROOTFSDIR}/sys
- rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/isar-apt.list"
- rm -f "${ROOTFSDIR}/etc/apt/preferences.d/isar-apt"
- rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
- rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar"
-
if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ]; then
mv "${ROOTFSDIR}/etc/apt/sources-list" \
"${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
@@ -293,6 +293,18 @@ rootfs_export_dpkg_status() {
'${ROOTFS_DPKGSTATUS_DEPLOY_DIR}'/'${ROOTFS_PACKAGE_SUFFIX}'.dpkg_status
}
+ROOTFS_POSTPROCESS_COMMAND += "rootfs_cleanup_isar_apt"
+rootfs_cleanup_isar_apt[weight] = "2"
+rootfs_cleanup_isar_apt() {
+ sudo -s <<'EOSUDO'
+ set -e
+ rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/isar-apt.list"
+ rm -f "${ROOTFSDIR}/etc/apt/preferences.d/isar-apt"
+ rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
+ rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar"
+EOSUDO
+}
+
do_rootfs_postprocess[vardeps] = "${ROOTFS_POSTPROCESS_COMMAND}"
do_rootfs_postprocess[network] = "${TASK_USE_SUDO}"
python do_rootfs_postprocess() {
@@ -51,6 +51,7 @@ ROOTFS_PACKAGES = "${SBUILD_CHROOT_PREINSTALL}"
# We don't need /etc/apt/sources.list.d/isar-apt.list' while it's handled by sbuild
ROOTFS_CONFIGURE_COMMAND:remove = "rootfs_configure_isar_apt"
+ROOTFS_POSTPROCESS_COMMAND:remove = "rootfs_cleanup_isar_apt"
DEPLOY_SCHROOT = "${@d.getVar('SCHROOT_' + d.getVar('SBUILD_VARIANT').upper() + '_DIR')}"
As isar-apt now used only for packages install move its cleanup stage from finalize task to postprocessing. Signed-off-by: Anton Mikanovich <amikan@ilbers.de> --- meta/classes/image.bbclass | 5 ----- meta/classes/rootfs.bbclass | 12 ++++++++++++ .../recipes-devtools/sbuild-chroot/sbuild-chroot.inc | 1 + 3 files changed, 13 insertions(+), 5 deletions(-)