From mboxrd@z Thu Jan 1 00:00:00 1970 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 06A2CC433F5 for ; Thu, 23 Dec 2021 15:12:07 +0000 (UTC) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mx.groups.io with SMTP id smtpd.web11.33924.1640272325904745584 for ; Thu, 23 Dec 2021 07:12:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pODVZyx4; spf=pass (domain: gmail.com, ip: 209.85.167.43, mailfrom: quaresma.jose@gmail.com) Received: by mail-lf1-f43.google.com with SMTP id bq20so13060668lfb.4 for ; Thu, 23 Dec 2021 07:12:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jiMSTjTzIxpo9Q/GmLaZ5MXIf6GpP49hlSiHNBDXk1U=; b=pODVZyx4gdLwkjXyDk5Tep2JQKUiSVdM3MATOCs6CDTyXFCW4n0meTURK8tyb7lqpi XfIdzxdi5t6Ql1BX0RF5wDWWvWBRakDaWS+PawHCeGSwb7HYm5ohR9HolEf35z9xNn5Y KljWNFpj0FPA2ZCbMXT2KFb1iFrgNyxYhT6YGOhhhfpWmkCUOo6AOjTsrDr49fzyuchW pGmK3TTwyQ/Tk4Tx1IuvjvI2vduyRZpb0emf4hOh7/URva+1FdpLkk64J9aB2BIdnx85 cQrG3s7Vi6ajTMR1HtD0gBLrv/TrtJeVxGIIPgKPJe0KqKSF+aYzYgT6QhL11RlfKa53 Y6Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jiMSTjTzIxpo9Q/GmLaZ5MXIf6GpP49hlSiHNBDXk1U=; b=HaStUUQu+KBaZDqD3aDS9QVF1KeJn+Flfxip56E4plVx94/r0lyhJTwSVxywM1DuHp xcVGxxOwMoK9q05AT2x90opQCiWEJLibCpoo63TIRwFngdp444Cpe2ZkvFsQpUgV3cIa KQAXjeibxzBHcUjVY4uAjSKExQ3ffVIe7GDqCvcx4WmqtPoVR1KUXPl6xdFIznOUHEE0 zssfuaMVA9eIzE60KbrPhQoBYH0QiBXJs3hFkzPL/9D8BrsH7WpBPcLKuHb+7VCIoN/e MYh6dk62mS9THw+HAG57oUCXEHm6pH4BHoO9GrlVKtoWUtXyhShSl6I2fCNqOIY4dnUY rCTw== X-Gm-Message-State: AOAM532+CL9u8yESClln8R79yX313UOPQGIiBmt2whljJpKiHiC517l2 42fo17+IRg6mu3m4qfpNFC8QRwkhRdUPd0gnEB4= X-Google-Smtp-Source: ABdhPJxs9SPb9Y4zCeFDBo9f3dhlrL1+EwKqscXUZe4TGghZBNhOXDdWlA7uU1lhJ7hgd5mzPoYQtZI7l7Z4PtPxhoQ= X-Received: by 2002:ac2:5bc1:: with SMTP id u1mr2098253lfn.106.1640272324262; Thu, 23 Dec 2021 07:12:04 -0800 (PST) MIME-Version: 1.0 References: <20211222232035.1036830-1-richard.purdie@linuxfoundation.org> In-Reply-To: From: Jose Quaresma Date: Thu, 23 Dec 2021 15:11:53 +0000 Message-ID: Subject: Re: [OE-core] [PATCH] base/patch: Disable network for unpack/patch/configure/compile/install To: Peter Kjellerstedt Cc: Richard Purdie , "openembedded-core@lists.openembedded.org" Content-Type: multipart/alternative; boundary="00000000000038fe9d05d3d1a9c9" 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 ; Thu, 23 Dec 2021 15:12:07 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/159988 --00000000000038fe9d05d3d1a9c9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Peter Kjellerstedt escreveu no dia quinta, 23/12/2021 =C3=A0(s) 10:49: > > -----Original Message----- > > From: openembedded-core@lists.openembedded.org < > openembedded-core@lists.openembedded.org> On Behalf Of Richard Purdie > > Sent: den 23 december 2021 00:21 > > To: openembedded-core@lists.openembedded.org > > Subject: [OE-core] [PATCH] base/patch: Disable network for > unpack/patch/configure/compile/install > > > > Use the newly added nonetwork task flag to disable network access where > > possible in unpack/patch/configure/compile/install tasks. > > > > We can't disable networking in sstate tasks due to sstate downloads and > > also so we can report hash equivalence to the server. > > Since no tasks except fetch (and apparently the sstate tasks) are expecte= d > to use the network, wouldn't it make more sense to reverse this flag? > I.e., > add do_fetch[network] =3D "1" instead. That way you don't get away with > adding some random task and using the network from it unless you > explicitly > state that you will. > It is more safe and easy to check what are the tasks that need network access. Jose > > > > > Signed-off-by: Richard Purdie > > --- > > meta/classes/base.bbclass | 4 ++++ > > meta/classes/patch.bbclass | 1 + > > 2 files changed, 5 insertions(+) > > > > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass > > index b709777f243..e4c6c983b59 100644 > > --- a/meta/classes/base.bbclass > > +++ b/meta/classes/base.bbclass > > @@ -214,6 +214,7 @@ python create_source_date_epoch_stamp() { > > oe.reproducible.epochfile_write(source_date_epoch, > d.getVar('SDE_FILE'), d) > > } > > do_unpack[postfuncs] +=3D "create_source_date_epoch_stamp" > > +do_unpack[nonetwork] =3D "1" > > > > def get_source_date_epoch_value(d): > > return oe.reproducible.epochfile_read(d.getVar('SDE_FILE'), d) > > @@ -358,6 +359,7 @@ base_do_configure() { > > echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE} > > fi > > } > > +do_configure[nonetwork] =3D "1" > > > > addtask compile after do_configure > > do_compile[dirs] =3D "${B}" > > @@ -368,11 +370,13 @@ base_do_compile() { > > bbnote "nothing to compile" > > fi > > } > > +do_compile[nonetwork] =3D "1" > > > > addtask install after do_compile > > do_install[dirs] =3D "${B}" > > # Remove and re-create ${D} so that is it guaranteed to be empty > > do_install[cleandirs] =3D "${D}" > > +do_install[nonetwork] =3D "1" > > > > base_do_install() { > > : > > diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass > > index 8de70254919..57aaf7c31d1 100644 > > --- a/meta/classes/patch.bbclass > > +++ b/meta/classes/patch.bbclass > > @@ -164,6 +164,7 @@ patch_do_patch[vardepsexclude] =3D "PATCHRESOLVE" > > > > addtask patch after do_unpack > > do_patch[dirs] =3D "${WORKDIR}" > > +do_patch[nonetwork] =3D "1" > > do_patch[depends] =3D "${PATCHDEPENDENCY}" > > > > EXPORT_FUNCTIONS do_patch > > -- > > 2.32.0 > > //Peter > > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > Links: You receive all messages sent to this group. > View/Reply Online (#159975): > https://lists.openembedded.org/g/openembedded-core/message/159975 > Mute This Topic: https://lists.openembedded.org/mt/87909311/5052612 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ > quaresma.jose@gmail.com] > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > --=20 Best regards, Jos=C3=A9 Quaresma --00000000000038fe9d05d3d1a9c9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
Peter Kjellerstedt <peter.kjellerstedt@axis.com> escrev= eu no dia quinta, 23/12/2021 =C3=A0(s) 10:49:
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembed= ded-core@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 23 december 2021 00:21
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] base/patch: Disable network for unpack/patc= h/configure/compile/install
>
> Use the newly added nonetwork task flag to disable network access wher= e
> possible in unpack/patch/configure/compile/install tasks.
>
> We can't disable networking in sstate tasks due to sstate download= s and
> also so we can report hash equivalence to the server.

Since no tasks except fetch (and apparently the sstate tasks) are expected =
to use the network, wouldn't it make more sense to reverse this flag? I= .e.,
add do_fetch[network] =3D "1" instead. That way you don't get= away with
adding some random task and using the network from it unless you explicitly=
state that you will.

It is more safe an= d easy to check what are the tasks that need network access.

=
Jose
=C2=A0

>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org&= gt;
> ---
>=C2=A0 meta/classes/base.bbclass=C2=A0 | 4 ++++
>=C2=A0 meta/classes/patch.bbclass | 1 +
>=C2=A0 2 files changed, 5 insertions(+)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index b709777f243..e4c6c983b59 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -214,6 +214,7 @@ python create_source_date_epoch_stamp() {
>=C2=A0 =C2=A0 =C2=A0 oe.reproducible.epochfile_write(source_date_epoch,= d.getVar('SDE_FILE'), d)
>=C2=A0 }
>=C2=A0 do_unpack[postfuncs] +=3D "create_source_date_epoch_stamp&q= uot;
> +do_unpack[nonetwork] =3D "1"
>
>=C2=A0 def get_source_date_epoch_value(d):
>=C2=A0 =C2=A0 =C2=A0 return oe.reproducible.epochfile_read(d.getVar(= 9;SDE_FILE'), d)
> @@ -358,6 +359,7 @@ base_do_configure() {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo ${BB_TASKHA= SH} > ${CONFIGURESTAMPFILE}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0fi
>=C2=A0 }
> +do_configure[nonetwork] =3D "1"
>
>=C2=A0 addtask compile after do_configure
>=C2=A0 do_compile[dirs] =3D "${B}"
> @@ -368,11 +370,13 @@ base_do_compile() {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bbnote "not= hing to compile"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0fi
>=C2=A0 }
> +do_compile[nonetwork] =3D "1"
>
>=C2=A0 addtask install after do_compile
>=C2=A0 do_install[dirs] =3D "${B}"
>=C2=A0 # Remove and re-create ${D} so that is it guaranteed to be empty=
>=C2=A0 do_install[cleandirs] =3D "${D}"
> +do_install[nonetwork] =3D "1"
>
>=C2=A0 base_do_install() {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:
> diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass > index 8de70254919..57aaf7c31d1 100644
> --- a/meta/classes/patch.bbclass
> +++ b/meta/classes/patch.bbclass
> @@ -164,6 +164,7 @@ patch_do_patch[vardepsexclude] =3D "PATCHRESO= LVE"
>
>=C2=A0 addtask patch after do_unpack
>=C2=A0 do_patch[dirs] =3D "${WORKDIR}"
> +do_patch[nonetwork] =3D "1"
>=C2=A0 do_patch[depends] =3D "${PATCHDEPENDENCY}"
>
>=C2=A0 EXPORT_FUNCTIONS do_patch
> --
> 2.32.0

//Peter


-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
Links: You receive all messages sent to this group.
View/Reply Online (#159975): https:= //lists.openembedded.org/g/openembedded-core/message/159975
Mute This Topic: https://lists.openembedded.org/mt= /87909311/5052612
Group Owner: openembedded-core+owner@lists.openembedded.org<= br> Unsubscribe: https://lists.openembedded.org/= g/openembedded-core/unsub [quaresma.jose@gmail.com]
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-



--
Best regards,

Jos=C3=A9= Quaresma
--00000000000038fe9d05d3d1a9c9--