From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 7A21E740040 for ; Thu, 25 Jan 2024 13:53:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=BgQPE5c71s0ek6ycwWyK78yUM5W7paqwUl0MlB5TUhk=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706190820; v=1; b=LX1Q4Lqf7NJYar6eYBf72sih+aJj+PtItQ4G0UDd6RlwZchyVW7kjpMlDatI3JdOmyiZL9r5 bCv/PWzgXoQPfml68VtJ0SCKRu/3L58p5T5LQa7M476vZCgJEa8TbjEME2blddwj4CcheU3jvaQ F8iCFo6x36PpAhQpY2qrP9N0= X-Received: by 127.0.0.2 with SMTP id z55nYY7687511xSCTekCdOYG; Thu, 25 Jan 2024 05:53:40 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.18017.1706190819563068451 for ; Thu, 25 Jan 2024 05:53:39 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-nIrL7tPRNaqqvE0kTzeZzA-1; Thu, 25 Jan 2024 08:53:37 -0500 X-MC-Unique: nIrL7tPRNaqqvE0kTzeZzA-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A14A385A58C; Thu, 25 Jan 2024 13:53:36 +0000 (UTC) X-Received: from [10.39.195.100] (unknown [10.39.195.100]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D8AD3C2E; Thu, 25 Jan 2024 13:53:35 +0000 (UTC) Message-ID: <8912261d-3e64-fa48-5927-b40c6ec9709b@redhat.com> Date: Thu, 25 Jan 2024 14:53:34 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 04/11] OvmfPkg: Shell*.inc: allow building without network support To: devel@edk2.groups.io, kraxel@redhat.com Cc: Jiewen Yao , Ard Biesheuvel , Michael Roth , Erdem Aktas , Min Xu , Tom Lendacky , Oliver Steffen References: <20240124163802.2160303-1-kraxel@redhat.com> <20240124163802.2160303-5-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240124163802.2160303-5-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: gdWHN4GUqLR43uLjGLPomsqgx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=LX1Q4Lqf; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 1/24/24 17:37, Gerd Hoffmann wrote: > Add NETWORK_ENABLE conditionals for the components > which need network support. >=20 > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/Include/Dsc/ShellComponents.dsc.inc | 4 ++++ > OvmfPkg/Include/Fdf/ShellDxe.fdf.inc | 2 ++ > 2 files changed, 6 insertions(+) >=20 > diff --git a/OvmfPkg/Include/Dsc/ShellComponents.dsc.inc b/OvmfPkg/Includ= e/Dsc/ShellComponents.dsc.inc > index 1a3a349a9de5..248b4b454b70 100644 > --- a/OvmfPkg/Include/Dsc/ShellComponents.dsc.inc > +++ b/OvmfPkg/Include/Dsc/ShellComponents.dsc.inc > @@ -5,6 +5,7 @@ > !if $(BUILD_SHELL) =3D=3D TRUE > =20 > !if $(TOOL_CHAIN_TAG) !=3D "XCODE5" > +!if $(NETWORK_ENABLE) =3D=3D TRUE > ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { > > gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE > @@ -13,6 +14,7 @@ > > gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE > } > +!endif > ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn= amicCommand.inf { > > gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE (1) This will prevent testing those code paths in these utilities that deal= with *not finding* the underlying networking protocols. That's an argument= against this hunk. However, we already have something similar in place, for UefiShellNetwork2C= ommandsLib and NETWORK_IP6_ENABLE. So, for consistency's sake, this hunk do= es seem justified. OK. (2) Further verification: - if NETWORK_ENABLE is false, then none of the networking stack is built (s= ee NetworkPkg/NetworkComponents.dsc.inc), and then we don't need these util= ities. - if NETWORK_ENABLE is true, then *at least one* of the IPv4 and IPv6 stack= s will be available (see NetworkPkg/NetworkDefines.dsc.inc), and then these= utilities should be functional. OK. > @@ -32,7 +34,9 @@ > NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1= CommandsLib.inf > NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Co= mmandsLib.inf > NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstal= l1CommandsLib.inf > +!if $(NETWORK_ENABLE) =3D=3D TRUE > NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwor= k1CommandsLib.inf > +!endif > !if $(NETWORK_IP6_ENABLE) =3D=3D TRUE > NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwor= k2CommandsLib.inf > !endif (3) This looks incorrect. The Network1 command set is related to IPv4, so w= e should check NETWORK_IP4_ENABLE. More precisely, the conditionals should look like !if $(NETWORK_ENABLE) =3D=3D TRUE !if $(NETWORK_IP4_ENABLE) =3D=3D TRUE NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1C= ommandsLib.inf !endif !if $(NETWORK_IP6_ENABLE) =3D=3D TRUE NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2C= ommandsLib.inf !endif !endif (Meaning that the extant NETWORK_IP6_ENABLE check isn't fully correct eithe= r.) > diff --git a/OvmfPkg/Include/Fdf/ShellDxe.fdf.inc b/OvmfPkg/Include/Fdf/S= hellDxe.fdf.inc > index 0935f06fa368..6536c30c5413 100644 > --- a/OvmfPkg/Include/Fdf/ShellDxe.fdf.inc > +++ b/OvmfPkg/Include/Fdf/ShellDxe.fdf.inc > @@ -5,8 +5,10 @@ > !if $(BUILD_SHELL) =3D=3D TRUE > =20 > !if $(TOOL_CHAIN_TAG) !=3D "XCODE5" > +!if $(NETWORK_ENABLE) =3D=3D TRUE > INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf > INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf > +!endif > INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellComma= nd.inf > !endif > =20 Seems OK. Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114404): https://edk2.groups.io/g/devel/message/114404 Mute This Topic: https://groups.io/mt/103935345/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-