From: Vijai Kumar K <vijaikumar.kanagarajan@gmail.com>
To: Gylstorff Quirin <quirin.gylstorff@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH v2] meta: rootfs: Fix manifest generation
Date: Wed, 23 Oct 2019 10:46:00 +0530 [thread overview]
Message-ID: <20191023051600.GA3125@lightning> (raw)
In-Reply-To: <28666b08-fc78-8ad3-083b-f94a345b98ce@siemens.com>
On Tue, Oct 22, 2019 at 06:28:57PM +0200, Gylstorff Quirin wrote:
>
>
> On 10/22/19 4:53 PM, vijaikumar.kanagarajan@gmail.com wrote:
> > From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> >
> > finalize-rootfs task removes qemu-*-static. It is needed for
> > rootfs_generate_manifest to work when HOST_ARCH != DISTRO_ARCH.
> >
> > Make sure a proper chroot environment is available when
> > generating manifest.
> >
> > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> > ---
> > Changes in v2:
> > - Updated commit message.
> >
> > meta/classes/rootfs.bbclass | 20 ++++++++++----------
> > 1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
> > index da66b3f..1da27ff 100644
> > --- a/meta/classes/rootfs.bbclass
> > +++ b/meta/classes/rootfs.bbclass
> > @@ -9,8 +9,8 @@ ROOTFS_PACKAGES ?= ""
> > # available features are:
> > # 'deploy-package-cache' - copy the package cache ${WORKDIR}/apt_cache
> > # 'clean-package-cache' - delete package cache from rootfs
> > -# 'finalize-rootfs' - delete files needed to chroot into the rootfs
> > # 'generate-manifest' - generate a package manifest of the rootfs into ${ROOTFS_MANIFEST_DEPLOY_DIR}
> > +# 'finalize-rootfs' - delete files needed to chroot into the rootfs
> > ROOTFS_FEATURES ?= ""
> > ROOTFS_APT_ARGS="install --yes -o Debug::pkgProblemResolver=yes"
> > @@ -185,6 +185,15 @@ rootfs_postprocess_clean_package_cache() {
> > sudo rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
> > }
> > +ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest', 'rootfs_generate_manifest', '', d)}"
> > +rootfs_generate_manifest () {
> > + mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR}
> > + sudo -E chroot --userspec=$(id -u):$(id -g) '${ROOTFSDIR}' \
> > + dpkg-query -W -f \
> > + '${source:Package}|${source:Version}|${binary:Package}|${Version}\n' > \
> > + ${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'
> > @@ -223,15 +232,6 @@ rootfs_postprocess_finalize() {
> > EOSUDO
> > }
>
> Is it possible to add a guard to finalize to check that it is the last
> command in ROOTFS_POSTPROCESS_COMMAND.
We could use _append instead of += for finalize-rootfs. May be add a comment as well to warn developers
that any postprocess function that needs chroot should go before finalize-rootfs.
Thanks,
Vijai Kumar K
>
> > -ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest', 'rootfs_generate_manifest', '', d)}"
> > -rootfs_generate_manifest () {
> > - mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR}
> > - sudo -E chroot --userspec=$(id -u):$(id -g) '${ROOTFSDIR}' \
> > - dpkg-query -W -f \
> > - '${source:Package}|${source:Version}|${binary:Package}|${Version}\n' > \
> > - ${ROOTFS_MANIFEST_DEPLOY_DIR}/"${PF}".manifest
> > -}
> > -
> > do_rootfs_postprocess[vardeps] = "${ROOTFS_POSTPROCESS_COMMAND}"
> > python do_rootfs_postprocess() {
> > # Take care that its correctly mounted:
> >
>
> Thanks.
>
> This should have been found in the CI build.
> Is the CrossBuild not part of the CI configuration?
>
> Quirin
>
> --
> 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/28666b08-fc78-8ad3-083b-f94a345b98ce%40siemens.com.
next prev parent reply other threads:[~2019-10-23 5:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-22 14:49 [PATCH] " vijaikumar.kanagarajan
2019-10-22 14:53 ` [PATCH v2] meta: rootfs: " vijaikumar.kanagarajan
2019-10-22 16:28 ` Gylstorff Quirin
2019-10-22 16:36 ` Henning Schild
2019-10-23 5:16 ` Vijai Kumar K [this message]
2019-10-23 16:25 ` Baurzhan Ismagulov
2019-10-24 5:37 ` Vijai Kumar K
2019-10-24 12:26 ` Henning Schild
2019-10-24 10:54 ` Baurzhan Ismagulov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191023051600.GA3125@lightning \
--to=vijaikumar.kanagarajan@gmail.com \
--cc=isar-users@googlegroups.com \
--cc=quirin.gylstorff@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox