Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38B9DC433F5 for ; Wed, 27 Oct 2021 16:58:23 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by mx.groups.io with SMTP id smtpd.web08.25.1635353900922055569 for ; Wed, 27 Oct 2021 09:58:21 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: collabora.com, ip: 46.235.227.227, mailfrom: martyn.welch@collabora.com) Received: from [IPv6:2a00:23c6:c31a:b300:7353:f37b:e749:b5d9] (unknown [IPv6:2a00:23c6:c31a:b300:7353:f37b:e749:b5d9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: martyn) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 15B571F4474B; Wed, 27 Oct 2021 17:58:19 +0100 (BST) Message-ID: <750238e7cd9b0804df692109ddc5c03d21abc271.camel@collabora.com> Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default IMAGE_QA_PROHIBIT_PATHS variable From: Martyn Welch To: Peter Kjellerstedt , Konrad Weihmann , OE-core Date: Wed, 27 Oct 2021 17:58:16 +0100 In-Reply-To: <74fe18d0a46440768666c0aacb7f0479@axis.com> References: <63d5cd9f7264871df79099b1831d5a8a85ca34b1.camel@collabora.com> <83e703f86472f188406fa1f6004aca66ffb0ff0a.camel@collabora.com> <74fe18d0a46440768666c0aacb7f0479@axis.com> Organization: Collabora Ltd. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.0-2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 27 Oct 2021 16:58:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/157560 On Wed, 2021-10-27 at 16:43 +0000, Peter Kjellerstedt wrote: > > -----Original Message----- > > From: Martyn Welch > > Sent: den 26 oktober 2021 17:32 > > To: Peter Kjellerstedt ; Konrad > > Weihmann > > ; OE-core > core@lists.openembedded.org> > > Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add > > default > > IMAGE_QA_PROHIBIT_PATHS variable > >=20 > > On Tue, 2021-10-26 at 14:59 +0000, Peter Kjellerstedt wrote: > > > > -----Original Message----- > > > > From: openembedded-core@lists.openembedded.org=C2=A0 > > > core@lists.openembedded.org> On Behalf Of Konrad Weihmann > > > > Sent: den 26 oktober 2021 13:24 > > > > To: Martyn Welch ; OE-core > > > > > > > core@lists.openembedded.org> > > > > Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add > > > > default > > > > IMAGE_QA_PROHIBIT_PATHS variable > > > >=20 > > > >=20 > > > >=20 > > > > On 26.10.21 13:21, Martyn Welch wrote: > > > > > Note to self - remember to reply to list... > > > > >=20 > > > > > -------- Forwarded Message -------- > > > > > From: Martyn Welch > > > > > To: Konrad Weihmann > > > > > Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add > > > > > default > > > > > IMAGE_QA_PROHIBIT_PATHS variable > > > > > Date: Tue, 26 Oct 2021 12:12:11 +0100 > > > > >=20 > > > > > On Tue, 2021-10-26 at 12:56 +0200, Konrad Weihmann wrote: > > > > > >=20 > > > > > >=20 > > > > > > On 26.10.21 12:50, Martyn Welch wrote: > >=20 > > > >=20 > > > > > > > +# IMAGE_QA_PROHIBITED_PATHS > > > > > > > +# Ensure images aren't including files in places that > > > > > > > will > > > > > > > be used as mount points or that are > > > > > > > +# reserved for runtime data. > > > > > > > +IMAGE_QA_PROHIBITED_PATHS ?=3D > > > > > > > "/dev/pts/*:/media/*:/mnt/*:/proc/*:/run/*:/tmp/*:/var/ru > > > > > > > n/*: > > > > > > > /var/tmp/*:/var/volatile/*" > > > > > >=20 > > > > > > I like the idea, but wouldn't make more sense to do that on > > > > > > a > > > > > > package > > > > > > level, as here the user is more or less left alone in > > > > > > guessing > > > > > > where > > > > > > the file actually does come from > > > > >=20 > > > > > I like that idea, however it would make to assumption that > > > > > there > > > > > wasn't > > > > > any tweaks being made as part of image generation that would > > > > > end > > > > > up > > > > > violating this. A quick check suggests the "build-appliance- > > > > > image_15.0.0.bb" image does this kind of thing in the core > > > > > image > > > > > types. > > > >=20 > > > > As Alex just wrote, I might be beneficial to do both > > > >=20 > > > > > Martyn > > >=20 > > > We have an alternative solution that hooks into the package QA. > > > It > > > focuses on directories that are supposed to be empty. In addition > > > to > > > failing the build if there are files in such a directory, it also > > > allows to specify for each directory why it should be empty. We > > > have > > > used this, e.g., to mark common directories that have been > > > renamed > > > to give an indication of where the files were supposed to have > > > been > > > installed. > > >=20 > > > Do you want me to generalize this and send a patch for it? > >=20 > > Hi Peter, > >=20 > > It would be great if we could merge these approaches, i.e. have one > > way > > to specify directories that need to be empty and test both as part > > of > > package QA and also image QA. > >=20 > > I was just working on adding some package QA support to what I've > > had, > > but can pause that. > >=20 > > Would you be able to provide show how you'd propose managing the > > prohibited directories? I'll try and tweak the image QA stuff > > already > > posted to fit that. > >=20 > > Martyn > >=20 > > > //Peter >=20 > I have sent two patches now. The first makes systemd not install=20 > anything in /var/log, as it otherwise conflicts with the suggested=20 > defaults. And then one patch that adds the package QA check for=20 > empty directories. I used the same defaults as suggested in your=20 > patch, except I removed /mnt since it is not obvious it should be=20 > empty. At least we use subdirectories in /mnt for our mountpoints. >=20 Thanks Peter, Looks good to me. I'll adapt the mine to be an image QA test that complements this. Martyn > //Peter >=20