From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.2626.1681976142089036179 for ; Thu, 20 Apr 2023 00:35:42 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=FrRSBbzS; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: linusx.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681976142; x=1713512142; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XRzIlugUZO8++RpGj9+YW7WMDaM53xXQ3KMJT8TVnrE=; b=FrRSBbzSIYzapsr5v2y3ct/pHZqmwToJCMs80XrLxxcbT1jgt8C48CUY jVHNmvAvRNAmmjIjPSYSqx6g5e3ND6gtQUko8bNc+iAiC5Sq8wb81AyKY Rs5uxl1rO/p6EV6SSY3MPPcgWKUa1h0sQwwKzdOVASBVksDJMYwPnzxxR ahSuArQo/sTt3rXknq1H85ZI56CsY0FWqVoMuZ42h5ukpjJbtkwfcXklg GCcmLP4rWFYg/Mz7LDYHU/QXiUYLnwcdvb30xpcwWTWefPuyQtwxCJyWg UBgL8iP4eD9wJyWYW/ny6mMVJqF4GQC3ErmT1hTel77TtUe/1JLU0hFoP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="343139710" X-IronPort-AV: E=Sophos;i="5.99,211,1677571200"; d="scan'208";a="343139710" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 00:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="685247942" X-IronPort-AV: E=Sophos;i="5.99,211,1677571200"; d="scan'208";a="685247942" Received: from coreboot.itwn.intel.com (HELO linuswux-mobl.gar.corp.intel.com) ([10.5.215.15]) by orsmga007.jf.intel.com with ESMTP; 20 Apr 2023 00:31:34 -0700 From: linusx.wu@intel.com To: devel@edk2.groups.io Cc: Linus Wu , Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [PATCH] UefiPayloadPkg: Move Network modules from Dxe FV to Network FV in elf Date: Thu, 20 Apr 2023 15:31:29 +0800 Message-Id: <5c06696f3b044899e2e80b45742e76448b604cba.1681973922.git.linusx.wu@intel.com> X-Mailer: git-send-email 2.39.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Linus Wu REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4417 Since UefiPayload had supported multiple FV, move Network.fdf.inc to new firmware volume and add this network FV into elf file. Cc: Guo Dong Cc: Ray Ni Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Linus Wu --- UefiPayloadPkg/UefiPayloadPkg.fdf | 32 +++++++++++++++++++++++-- UefiPayloadPkg/UniversalPayloadBuild.py | 12 ++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayload= Pkg.fdf index ee7d718b3f..f8c2aa8c4a 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.fdf +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf @@ -60,6 +60,35 @@ FILE FV_IMAGE =3D 4E35FD93-9C72-4c15-8C4B-E77F1DB2D793 { SECTION FV_IMAGE =3D DXEFV=0D }=0D =0D +!if $(NETWORK_DRIVER_ENABLE) =3D=3D TRUE=0D +##########################################################################= ######=0D +[FV.NETWORKFV]=0D +FvNameGuid =3D 3CF5CB69-C439-4B84-AF11-8167B22D7221=0D +BlockSize =3D $(FD_BLOCK_SIZE)=0D +FvForceRebase =3D FALSE=0D +FvAlignment =3D 16=0D +ERASE_POLARITY =3D 1=0D +MEMORY_MAPPED =3D TRUE=0D +STICKY_WRITE =3D TRUE=0D +LOCK_CAP =3D TRUE=0D +LOCK_STATUS =3D TRUE=0D +WRITE_DISABLED_CAP =3D TRUE=0D +WRITE_ENABLED_CAP =3D TRUE=0D +WRITE_STATUS =3D TRUE=0D +WRITE_LOCK_CAP =3D TRUE=0D +WRITE_LOCK_STATUS =3D TRUE=0D +READ_DISABLED_CAP =3D TRUE=0D +READ_ENABLED_CAP =3D TRUE=0D +READ_STATUS =3D TRUE=0D +READ_LOCK_CAP =3D TRUE=0D +READ_LOCK_STATUS =3D TRUE=0D +=0D +#=0D +# UEFI network modules=0D +#=0D +!include NetworkPkg/Network.fdf.inc=0D +!endif=0D +=0D ##########################################################################= ######=0D [FV.BDSFV]=0D FvNameGuid =3D CA5590AF-9558-4822-B5EA-BE2E876CD3EC=0D @@ -276,14 +305,13 @@ INF MdeModulePkg/Universal/Acpi/BootGraphicsResource= TableDxe/BootGraphicsResour =0D !if $(UNIVERSAL_PAYLOAD) =3D=3D FALSE=0D INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf=0D -!endif=0D -=0D #=0D # UEFI network modules=0D #=0D !if $(NETWORK_DRIVER_ENABLE) =3D=3D TRUE=0D !include NetworkPkg/Network.fdf.inc=0D !endif=0D +!endif=0D =0D #=0D # Shell=0D diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/Unive= rsalPayloadBuild.py index db7ce0500b..83e0de95d8 100644 --- a/UefiPayloadPkg/UniversalPayloadBuild.py +++ b/UefiPayloadPkg/UniversalPayloadBuild.py @@ -108,6 +108,7 @@ def BuildUniversalPayload(Args, MacroList): DscPath =3D os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc")=0D DxeFvOutputDir =3D os.path.join(BuildDir, "{}_{}".format (BuildTarget,= ToolChain), os.path.normpath("FV/DXEFV.Fv"))=0D BdsFvOutputDir =3D os.path.join(BuildDir, "{}_{}".format (BuildTarget,= ToolChain), os.path.normpath("FV/BDSFV.Fv"))=0D + NetworkFvOutputDir =3D os.path.join(BuildDir, "{}_{}".format (BuildTar= get, ToolChain), os.path.normpath("FV/NETWORKFV.Fv"))=0D PayloadReportPath =3D os.path.join(BuildDir, "UefiUniversalPayload.txt= ")=0D ModuleReportPath =3D os.path.join(BuildDir, "UefiUniversalPayloadEntry= .txt")=0D UpldInfoFile =3D os.path.join(BuildDir, "UniversalPayloadInfo.bin")=0D @@ -185,6 +186,17 @@ def BuildUniversalPayload(Args, MacroList): ObjCopyFlag,=0D EntryOutputDir=0D )=0D + #=0D + # Append network fv to sections if exists=0D + #=0D + if os.path.isfile(NetworkFvOutputDir):=0D + index =3D remove_section.find(EntryOutputDir)=0D + remove_section =3D remove_section[:index] + '--remove-section = .upld.network_fv ' + remove_section[index:]=0D + index =3D add_section.find(EntryOutputDir)=0D + add_section =3D add_section[:index] + '--add-section .upld.net= work_fv=3D' + NetworkFvOutputDir + ' ' + add_section[index:]=0D + index =3D set_section.find(EntryOutputDir)=0D + set_section =3D set_section[:index] + '--set-section-alignment= .upld.network_fv=3D16 ' + set_section[index:]=0D +=0D RunCommand(remove_section)=0D RunCommand(add_section)=0D RunCommand(set_section)=0D --=20 2.39.1.windows.1