From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6790334981638979584 X-Received: by 2002:a6b:5c0d:: with SMTP id z13mr17879160ioh.96.1585725955591; Wed, 01 Apr 2020 00:25:55 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:9cc6:: with SMTP id x67ls7346667ill.1.gmail; Wed, 01 Apr 2020 00:25:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vspSNFeOM8cQ2a5419CTE06PBYnFxLzuMI2eVzg2UONGEkA1KSPMEmwc5MKRklOzC/8u4G4 X-Received: by 2002:a92:8548:: with SMTP id f69mr20205765ilh.20.1585725955186; Wed, 01 Apr 2020 00:25:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585725955; cv=none; d=google.com; s=arc-20160816; b=DVX1Kt4oD9aamftO7Q9dkAFDrhv0uAynPKbzfdhAewXU+6flWFb3LAnYsWejyGmAnE 8IAy1uR5LZu8IKXsYgVGSH6l7E3drEDoaY93VuHkzolGlSQ/9cCbLUlOrYfYfd5mozW2 idOtxAIgP6F1jFRtP8JmcSI0yFGvLMyC7EPsjY8xzZoL8rE5BccV4zH1W/CAS4zJFVx3 dXW8jh6C7/2tq4n3NVtRESvho75k1GomPTwVPLJNI6joyoPY/2ikFUj05S/nVheTkUMr mgNj/vrRV7RTHZy2FFquomuGJ9FxEhuY6BHZ6AZ1+WiInZnW7PY8inCJYREaTbNM4EH6 +UVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=215e5KvnCt9gz5kiHVSLhXB8iwJT4JN5ld9CW5JdPDA=; b=WYvk/7A3jN4PbrLTSPm+TIdkl46Hw2iiojO6+eR+xutlEsE2k6KSDlkVYV5WnNcLO0 UaEIYDMul7gHi5JfSVSFc0Jt3tDFP0C0aisRuhtK1aJeRuAtugCczWcUkLYz+1hhky1L iWNRb6PN/IBW7wKd8DolBMbYF7QvNjhWaOkf/0PuLHORoZe1qoYPzAeo4+WeZ/CPX5Ig nDu6YPbI4UBhXDMoQOxrJE2jV1EiDKbOs5Z9JE1Hr1uGW4s2xIuYQbTb4h/cmlgZLV3j IOKc51eum9ZitiU7uYptXeYfaaSS3Qa/2Hr965LXFOBauuuAyYJhjpVGcojaKuTlLqgf Z7Ew== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=loIrnXxV; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com. [2607:f8b0:4864:20::844]) by gmr-mx.google.com with ESMTPS id m8si67759ili.2.2020.04.01.00.25.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Apr 2020 00:25:55 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) client-ip=2607:f8b0:4864:20::844; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=loIrnXxV; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-qt1-x844.google.com with SMTP id g7so20775911qtj.13 for ; Wed, 01 Apr 2020 00:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=215e5KvnCt9gz5kiHVSLhXB8iwJT4JN5ld9CW5JdPDA=; b=loIrnXxVUWGG2azi22r6SJe7TWvDifAeUzGKZkouy8fDtQdJDIZkf4T8TOucRpn0MY mfVH5CUc94SPveLRiSd4JsNDhqmA1qeGt6RsTvLUxG1ioNGldhhhuoPZT5IY+Z0BjXNa Aic12k34PEvinpww88rAbI1fDMiNC/NDLhJvWLs6Qf8HCCbS6EoRdjyDtLQ8Gny57U5G sVU9u8nE86kvtXY8AjXgUxmalCgAQiGtf/+TjhYxMqFg6Cr/VdvpXxqFX39ZQAgQTf1y CJsEQdxhjGaoYEDYnxj/RBb9fXGTYJsK4o/R2bPIzZygNyC9lJqSeRlMlop44C5nSSdj c6Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=215e5KvnCt9gz5kiHVSLhXB8iwJT4JN5ld9CW5JdPDA=; b=EwbVt/FkovguvGHA7Lu5ABPc5P8a+Ez5v14j5jheWdwCYLXAB0/IfzJo9ZhUT+QdgO wgRqpPbi/T2iaTsyA+2BKHYSgVHWGWo/xpMnkiui1ZcNnZ9yqymNq8Nvnnq02qRvwGKa 7GKBEw8nz3XjiU+iaJgU9bW6a49ObxxJ0A7aypBVsTXMBo0JuxS49tCXWBnHJgWRBPtV wk7jDu11fwqydX6WPX5kU2cO+Iw5I4vpV/yyF0inO/zosfwbCHBjQM1nX5x5QHicHPc/ Jc6aHfvqRNdTKss+UD8ZM+JHzEYS/mYkkCHGWLm3EdZWo1ApQkBmhv723M0SkQDiqy1Q 2mxA== X-Gm-Message-State: ANhLgQ1ZlJJ9iQcZgZTy0Ix80IyhGNEgSDgOs0o9+JWHsOhZMikk57D1 uVHT9UDEUrI63Ttih/v734srk1yHadKmyY8+lIZxf6pMXThAfQ== X-Received: by 2002:ac8:38cc:: with SMTP id g12mr9232019qtc.186.1585725954281; Wed, 01 Apr 2020 00:25:54 -0700 (PDT) MIME-Version: 1.0 References: <20200213100820.23444-2-Vijaikumar_Kanagarajan@mentor.com> <20200214054801.11870-1-Vijaikumar_Kanagarajan@mentor.com> <7a71ebe9-9846-41ed-beae-a02360129b89@googlegroups.com> In-Reply-To: <7a71ebe9-9846-41ed-beae-a02360129b89@googlegroups.com> From: vijai kumar Date: Wed, 1 Apr 2020 12:55:43 +0530 Message-ID: Subject: Re: [PATCH v3 1/2] rootfs: Make rootfs finalize a separate task To: isar-users Cc: Baurzhan Ismagulov , Henning Schild , Jan Kiszka Content-Type: text/plain; charset="UTF-8" X-TUID: FF31QwXACOmD On Wed, Mar 11, 2020 at 12:46 PM vijai kumar wrote: > > As said before, this series, atleast the second patch, depends on Henning's base-apt series. > > I am going to rebase my changes on top of Hennings v5 and test it out. > > Also, should we have these changes as part of Hennings series? Or should I wait for > the series to get in and address these later? > Hi All, While testing this series on top of the current next I got the below error. Any pointers? I am yet to try a local build. Failed to fetch http://deb.debian.org/debian/pool/main/g/gettext/gettext_0.19.8.1.orig.tar.xz Writing more data than expected (7210080 > 7209808) Hashes of expected file: - SHA256:105556dbc5c3fbbc2aa0edb46d22d055748b6f5c7cd7a8d99f8e7eb84e938be4 - Filesize:7209808 [weak] - MD5Sum:df3f5690eaa30fd228537b00cb7b7590 [weak] E: Failed to fetch some archives. http://ci.isar-build.org:8080/job/isar_vkk_devel/40/consoleFull Also, there are some more fixes, to strip the version info from Source field, so v4 is in pipeline. Thanks, Vijai Kumar K > Thanks, > Vijai Kumar K > > On Friday, February 14, 2020 at 11:18:11 AM UTC+5:30, vijai kumar wrote: >> >> With the current implementation it is difficult to append a >> postprocess function which requires a chroot environment. >> For example, to add a postprocess function which runs apt-get to >> download all source of packages installed in the target. >> >> rootfs_postprocess_finalize is not actually an optional feature >> but instead a necessary cleanup function for image class. >> So, move the implementation to image class and make it as a task. >> >> Signed-off-by: Vijai Kumar K >> --- >> Changes in v3: >> - Take care of non-existent downloads/deb-src directory. >> >> meta/classes/image.bbclass | 41 ++++++++++++++++++++++++++++++++++++- >> meta/classes/rootfs.bbclass | 39 ----------------------------------- >> 2 files changed, 40 insertions(+), 40 deletions(-) >> >> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass >> index cfd617a..c5fddba 100644 >> --- a/meta/classes/image.bbclass >> +++ b/meta/classes/image.bbclass >> @@ -60,7 +60,7 @@ image_do_mounts() { >> } >> >> ROOTFSDIR = "${IMAGE_ROOTFS}" >> -ROOTFS_FEATURES += "clean-package-cache finalize-rootfs generate-manifest" >> +ROOTFS_FEATURES += "copy-package-cache clean-package-cache generate-manifest" >> ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${IMAGE_INSTALL}" >> ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}" >> >> @@ -168,5 +168,44 @@ python do_deploy() { >> } >> addtask deploy before do_build after do_image >> >> +do_rootfs_finalize() { >> + sudo -s <<'EOSUDO' >> + test -e "${ROOTFSDIR}/chroot-setup.sh" && \ >> + "${ROOTFSDIR}/chroot-setup.sh" "cleanup" "${ROOTFSDIR}" >> + rm -f "${ROOTFSDIR}/chroot-setup.sh" >> + >> + test ! -e "${ROOTFSDIR}/usr/share/doc/qemu-user-static" && \ >> + find "${ROOTFSDIR}/usr/bin" \ >> + -maxdepth 1 -name 'qemu-*-static' -type f -delete >> + >> + mountpoint -q '${ROOTFSDIR}/isar-apt' && \ >> + umount -l ${ROOTFSDIR}/isar-apt >> + rmdir --ignore-fail-on-non-empty ${ROOTFSDIR}/isar-apt >> + >> + mountpoint -q '${ROOTFSDIR}/base-apt' && \ >> + umount -l ${ROOTFSDIR}/base-apt >> + rmdir --ignore-fail-on-non-empty ${ROOTFSDIR}/base-apt >> + >> + mountpoint -q '${ROOTFSDIR}/dev' && \ >> + umount -l ${ROOTFSDIR}/dev >> + mountpoint -q '${ROOTFSDIR}/sys' && \ >> + umount -l ${ROOTFSDIR}/proc >> + mountpoint -q '${ROOTFSDIR}/sys' && \ >> + umount -l ${ROOTFSDIR}/sys >> + >> + rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/55isar-fallback.conf" >> + >> + 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" >> + >> + mv "${ROOTFSDIR}/etc/apt/sources-list" \ >> + "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" >> + >> + rm -f "${ROOTFSDIR}/etc/apt/sources-list" >> +EOSUDO >> +} >> +addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess >> + >> # Last so that the image type can overwrite tasks if needed >> inherit ${IMAGE_TYPE} >> diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass >> index 54b5e5c..c3af7c1 100644 >> --- a/meta/classes/rootfs.bbclass >> +++ b/meta/classes/rootfs.bbclass >> @@ -201,45 +201,6 @@ rootfs_generate_manifest () { >> ${ROOTFS_MANIFEST_DEPLOY_DIR}/"${PF}".manifest >> } >> >> -ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'finalize-rootfs', 'rootfs_postprocess_finalize', '', d)}" >> -rootfs_postprocess_finalize() { >> - sudo -s <<'EOSUDO' >> - test -e "${ROOTFSDIR}/chroot-setup.sh" && \ >> - "${ROOTFSDIR}/chroot-setup.sh" "cleanup" "${ROOTFSDIR}" >> - rm -f "${ROOTFSDIR}/chroot-setup.sh" >> - >> - test ! -e "${ROOTFSDIR}/usr/share/doc/qemu-user-static" && \ >> - find "${ROOTFSDIR}/usr/bin" \ >> - -maxdepth 1 -name 'qemu-*-static' -type f -delete >> - >> - mountpoint -q '${ROOTFSDIR}/isar-apt' && \ >> - umount -l ${ROOTFSDIR}/isar-apt >> - rmdir --ignore-fail-on-non-empty ${ROOTFSDIR}/isar-apt >> - >> - mountpoint -q '${ROOTFSDIR}/base-apt' && \ >> - umount -l ${ROOTFSDIR}/base-apt >> - rmdir --ignore-fail-on-non-empty ${ROOTFSDIR}/base-apt >> - >> - mountpoint -q '${ROOTFSDIR}/dev' && \ >> - umount -l ${ROOTFSDIR}/dev >> - mountpoint -q '${ROOTFSDIR}/sys' && \ >> - umount -l ${ROOTFSDIR}/proc >> - mountpoint -q '${ROOTFSDIR}/sys' && \ >> - umount -l ${ROOTFSDIR}/sys >> - >> - rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/55isar-fallback.conf" >> - >> - 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" >> - >> - mv "${ROOTFSDIR}/etc/apt/sources-list" \ >> - "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" >> - >> - rm -f "${ROOTFSDIR}/etc/apt/sources-list" >> -EOSUDO >> -} >> - >> do_rootfs_postprocess[vardeps] = "${ROOTFS_POSTPROCESS_COMMAND}" >> python do_rootfs_postprocess() { >> # Take care that its correctly mounted: >> -- >> 2.17.1 >> > -- > You received this message because you are subscribed to the Google Groups "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/7a71ebe9-9846-41ed-beae-a02360129b89%40googlegroups.com.