From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6519062226403328000 X-Received: by 10.28.69.76 with SMTP id s73mr5242618wma.15.1517837937760; Mon, 05 Feb 2018 05:38:57 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.116.12 with SMTP id p12ls1570055wmc.2.gmail; Mon, 05 Feb 2018 05:38:57 -0800 (PST) X-Google-Smtp-Source: AH8x224pbkQuXzr3VQdmDEuoW+uQ7bDOtOZ9M3w3hzqZxtD3f7iwjEEPSlbwnwXg4qd3CQaEQFii X-Received: by 10.28.136.67 with SMTP id k64mr4681664wmd.27.1517837937186; Mon, 05 Feb 2018 05:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517837937; cv=none; d=google.com; s=arc-20160816; b=fO6hk0xlQ8fzauVvSvmbbpcaADQgIuGj1KHfvHwrWF8YMzsat/hnN0fUERiNYFrUbb ooUziCqmxlV93boWCq/W59a5STKsWqOV5NRHzwXp+Q8AuVZrYae7yzZN4r+0MrSes2Tg g99TcwNl9CSWtncTjfhvqXiOmbWW5FAiQZiIaV69qPjBDhzQqRWe9oQ2OWHNLDpEyhXh Xo4FZlkuYybyEq7DDTWwdkX6BcERfX9IJKQMwjwP5zM/Hc7x11INo8oyl8v6jtf/t2DF vjyp/JLt4hhrUX6/oW2ASU6/MhoPDSdlHvL29PPMdDZZngP5sor03FV66EHbuDAk+037 B+kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=gFaPq5jLNpq736lY6eg3hsClhAhJjA1jEArC/wLKSyQ=; b=Ko1yTxTIKAy4WKkmLSE0OXnq9fUB9qXzzntSn/1nZ0DwTt36TrxZ24P66vnOm7vXBN PeRmgVc6OsbcIoACOYwqndyOcuirUQIib1joJpTd7cXLdu89mDM/jB4CXlYhZqtzxXBA O0onGWNFtJgGPuz4j0aTutxQXzF1nCQ39eA+HivX9qeabrDKJeH5JO+AQxIl+2CePJCM fmEVa2Dn86vU1fz27wm6DtYOmgGkVsVfnaZ8gR4IVdWkt0N0+8OGd3ioi3dhScI4aSvv zGfEbga34WOT7tGQipqqmy5sukzhBplrRC+0DdS7lh9fvrt1EYrHSF+POg2xGGl/i86w QqBg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id j65si492978wmj.0.2018.02.05.05.38.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Feb 2018 05:38:57 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w15Dculo014604 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Feb 2018 14:38:56 +0100 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w15DcutG019869; Mon, 5 Feb 2018 14:38:56 +0100 Subject: Re: [PATCH 1/1] image: create an image manifest listing installed packages To: Cedric_Hombourger@mentor.com, isar-users@googlegroups.com References: <20180205133041.69108-1-Cedric_Hombourger@mentor.com> <20180205133041.69108-2-Cedric_Hombourger@mentor.com> From: Jan Kiszka Message-ID: <368032d9-2506-d7c8-9d99-fdd909e1f565@siemens.com> Date: Mon, 5 Feb 2018 14:38:56 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20180205133041.69108-2-Cedric_Hombourger@mentor.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: /Flvhn2UrKM5 On 2018-02-05 14:30, Cedric_Hombourger@mentor.com wrote: > From: Cedric Hombourger > > Produce an image manifest that lists all packages installed into the > image. Note the architecture, version and (when specified) the source > package. The package details are tab-separated and may easily be > imported into a spreadsheet (e.g. should you need to provide a Bill > Of Material). > > Signed-off-by: Cedric Hombourger > --- > meta/classes/image.bbclass | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index 2c2bafc..c7aa698 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -84,6 +84,16 @@ do_populate() { > addtask populate before do_build after do_unpack > do_populate[deptask] = "do_deploy_deb" > > +# Create a manifest of installed packages and their versions > +do_manifest() { > + install -m 755 -d ${DEPLOY_DIR_IMAGE} > + sudo chroot ${IMAGE_ROOTFS} dpkg-query \ > + -W -f '${Package}\t${Architecture}\t${Version}\t${Source}\n' \ > + >${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.manifest > +} > + > +addtask manifest before do_build after do_populate > + Makes sense. But we should also include the hash of the repo that initiated the build. We do this in several of out Yocto projects to resolve the usual question: "Am I really running the latest version?" The key problem, though, is to establish a way to define the top-level layer and, thus, the repo we are interested in. For the yocto cases, we hard-coded that into the product layers, but there are surely better approaches. > do_copy_boot_files() { > KERNEL_IMAGE=${@get_image_name(d, 'vmlinuz')} > if [ -n "${KERNEL_IMAGE}" ]; then > Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux