From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <bounce+27952+120902+7686176+12367111@groups.io> Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 614D3740038 for <rebecca@openfw.io>; Tue, 17 Dec 2024 10:14:59 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=KICcHksNrdcm2aB5NOyx4pCz1z3wvBgM5m2Nq69R4Wg=; c=relaxed/simple; d=groups.io; h=Subject:To:From:User-Agent:MIME-Version:Date:Message-ID:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240830; t=1734430499; v=1; x=1734689697; b=YpKL97vl76grXzWWhACEtvoE/NVDIVisPj2dGb8lLyTD/4zm3vWOnJNDOYs341PvIxsVZ7fP d1Bg8kCxGR7VdAJ7VImDT8pO2CPDtZPkWErsFsVkUPjA0E3me80BMBEC0OsFsm9VWroCxSiFTet /qdwtDRWvOkoNH2QJ+3xVOegf+0FiJc61BiZ+nfgkyFnAHPVAiiy+2YjErhB3yax9voWviV50mO FfMpu5p8eCr0bC/H8oGK2x63M351svPbUskk+Ny5Q2SDM8fdNZtjNjoWd6U2vAeGPGZxYfxPBx4 WePPmnGd/3NMu3oiCDBg3yL4Ue3BziDExLHvAVvcbgHRA== X-Received: by 127.0.0.2 with SMTP id AOP5YY7687511xwESpFv8rxd; Tue, 17 Dec 2024 02:14:57 -0800 Subject: [edk2-devel] Setting a static IP address in EDK2 Payload prior to UEFI Shell To: devel@edk2.groups.io From: "greg.wilson via groups.io" <greg.wilson=gd-ms.uk@groups.io> X-Originating-Location: Winchester, England, GB (31.121.119.225) X-Originating-Platform: Windows Chrome 131 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 17 Dec 2024 02:14:57 -0800 Message-ID: <rOXg.1734430497123281356.CwVt@groups.io> Precedence: Bulk List-Subscribe: <mailto:devel+subscribe@edk2.groups.io> List-Help: <mailto:devel+help@edk2.groups.io> Sender: devel@edk2.groups.io List-Id: <devel.edk2.groups.io> Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,greg.wilson@gd-ms.uk List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: <https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/plugh> X-Gm-Message-State: ce9rDQqpjbd2L36rfXdXFpvBx7686176AA= Content-Type: multipart/alternative; boundary="vjaGgjQKeKGp0BzdFExD" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=YpKL97vl; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --vjaGgjQKeKGp0BzdFExD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, Within EDK2 payload, I am trying to get a static IP address set, so that wh= en I enter UEFI Shell, I can ping another computer. At the moment I have the network stack elements started automatically, but = still need to type 'ifconfig -s eth0 static 192.168.1.5 255.255.255.0 192.1= 68.1.1' every time to get the IP address assigned before i can ping 192.168= .1.10 I'd like to start the UEFI shell and just run the ping command, and it chec= k if 192.168.1.10 is available. The current versions of EDK2 and Slimboot from github I am using are listed= below EDK2 - d13f31c3fe17eb532bf9016a2d8de3885642cba0 (https://github.com/tianoco= re/edk2/tree/d13f31c3fe17eb532bf9016a2d8de3885642cba0) from September 30th = (I tried a newer version, but got build errors) Slimboot - ca00703127e34c84c3e6d3d129ebc5ef292ba963 (https://github.com/sli= mbootloader/slimbootloader/tree/ca00703127e34c84c3e6d3d129ebc5ef292ba963) f= rom October 25th I've tried the following... Creating a C and INF file, C File =3D=3D=3D=3D #include <Library/DebugLib.h> #include <Uefi.h> #include <Library/UefiBootServicesTableLib.h> #include <Protocol/Ip4Config2.h> //#include <Library/BaseMemoryLib.h> #include <Library/MemoryAllocationLib.h> //#include <Library/PrintLib.h> EFI_STATUS EFIAPI StaticIpDriverEntryPoint ( IN EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageHandle, IN EFI_SYSTEM_TABLE =C2=A0*SystemTable ) { EFI_STATUS =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Status; EFI_IP4_CONFIG2_PROTOCOL =C2=A0 *Ip4Config2; EFI_IP4_CONFIG2_MANUAL_ADDRESS Address; EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *HandleB= uffer; UINTN =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0HandleCount; UINTN =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0Index; // Print(L"GREG - Setting Static IP Address - Using StaticIpDriverEntryPoin= t\n"); DEBUG ((DEBUG_INFO, "GREG - =C2=A0- Setting Static IP Address - Using Stati= cIpDriverEntryPoint\n")); // Locate all handles that support the EFI_IP4_CONFIG2_PROTOCOL Status =3D gBS->LocateHandleBuffer(ByProtocol, &gEfiIp4Config2ProtocolGuid,= NULL, &HandleCount, &HandleBuffer); if (EFI_ERROR(Status)) { return Status; } for (Index =3D 0; Index < HandleCount; Index++) { Status =3D gBS->HandleProtocol(HandleBuffer[Index], &gEfiIp4Config2Protocol= Guid, (VOID **)&Ip4Config2); if (EFI_ERROR(Status)) { continue; } // Set the manual IP address Address.Address.Addr[0] =3D 192; Address.Address.Addr[1] =3D 168; Address.Address.Addr[2] =3D 1; Address.Address.Addr[3] =3D 5; Address.SubnetMask.Addr[0] =3D 255; Address.SubnetMask.Addr[1] =3D 255; Address.SubnetMask.Addr[2] =3D 255; Address.SubnetMask.Addr[3] =3D 0; Status =3D Ip4Config2->SetData(Ip4Config2, Ip4Config2DataTypeManualAddress,= sizeof(Address), &Address); if (EFI_ERROR(Status)) { continue; } // Optionally, set the gateway and DNS server addresses here // Break after setting the IP on the first interface break; } // Free the handle buffer if (HandleBuffer !=3D NULL) { FreePool(HandleBuffer); } return Status; } //VOID EFI_STATUS EFIAPI _ModuleEntryPoint ( IN EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageHandle, IN EFI_SYSTEM_TABLE =C2=A0*SystemTable ) { EFI_STATUS =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Status; EFI_IP4_CONFIG2_PROTOCOL =C2=A0 *Ip4Config2; EFI_IP4_CONFIG2_MANUAL_ADDRESS Address; EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *HandleB= uffer; UINTN =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0HandleCount; UINTN =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0Index; // =C2=A0Print(L"GREG - Setting Static IP Address - Using _ModuleEntryPoint= \n"); DEBUG ((DEBUG_INFO, "GREG - =C2=A0- Setting Static IP Address - Using _Modu= leEntryPoint\n")); // Locate all handles that support the EFI_IP4_CONFIG2_PROTOCOL Status =3D gBS->LocateHandleBuffer(ByProtocol, &gEfiIp4Config2ProtocolGuid,= NULL, &HandleCount, &HandleBuffer); if (EFI_ERROR(Status)) { return Status; } for (Index =3D 0; Index < HandleCount; Index++) { Status =3D gBS->HandleProtocol(HandleBuffer[Index], &gEfiIp4Config2Protocol= Guid, (VOID **)&Ip4Config2); if (EFI_ERROR(Status)) { continue; } // Set the manual IP address Address.Address.Addr[0] =3D 192; Address.Address.Addr[1] =3D 168; Address.Address.Addr[2] =3D 1; Address.Address.Addr[3] =3D 100; Address.SubnetMask.Addr[0] =3D 255; Address.SubnetMask.Addr[1] =3D 255; Address.SubnetMask.Addr[2] =3D 255; Address.SubnetMask.Addr[3] =3D 0; Status =3D Ip4Config2->SetData(Ip4Config2, Ip4Config2DataTypeManualAddress,= sizeof(Address), &Address); if (EFI_ERROR(Status)) { continue; } // Optionally, set the gateway and DNS server addresses here // Break after setting the IP on the first interface break; } // Free the handle buffer if (HandleBuffer !=3D NULL) { FreePool(HandleBuffer); } return Status; } and INF File [Defines] INF_VERSION =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=3D 0x00010017 BASE_NAME =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0=3D StaticIpConfigDxe FILE_GUID =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0=3D 7283e2fb-eeca-47d8-8576-5d55225ec820 MODULE_TYPE =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=3D DXE_DRIVER VERSION_STRING =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D = 1.0 ENTRY_POINT =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=3D StaticIpDriverEntryPoint [Sources] StaticIpConfigDxe.c [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec UefiPayloadPkg/UefiPayloadPkg.dec [LibraryClasses] UefiLib UefiBootServicesTableLib DebugLib MemoryAllocationLib PrintLib [Protocols] gEfiIp4Config2ProtocolGuid [Depex] gEfiIp4Config2ProtocolGuid but loading the INF file into sbl_02\edk2\UefiPayloadPkg\UefiPayloadPkg.dsc= and sbl_02\edk2\UefiPayloadPkg\UefiPayloadPkg.fdf caused the build binary = to not load. I commented out the above entries and then modified sbl_02\edk2\UefiPayload= Pkg\UefiPayloadPkg.dsc and sbl_02\edk2\UefiPayloadPkg\UefiPayloadPkg.dec I added into the dsc the following # Disable DHCP gUefiPayloadPkgTokenSpaceGuid.PcdIPv4Enable|TRUE gUefiPayloadPkgTokenSpaceGuid.PcdDhcp|FALSE # Static IP configuration for eth0 gUefiPayloadPkgTokenSpaceGuid.PcdIp4Address0|192.168.1.5 gUefiPayloadPkgTokenSpaceGuid.PcdIp4SubnetMask0|255.255.255.0 gUefiPayloadPkgTokenSpaceGuid.PcdIp4Gateway0|192.168.1.1 In the dec I added [PcdsFixedAtBuild] gUefiPayloadPkgTokenSpaceGuid.PcdIPv4Enable|TRUE|BOOLEAN|0x00000001 gUefiPayloadPkgTokenSpaceGuid.PcdDhcp|FALSE|BOOLEAN|0x00000002 gUefiPayloadPkgTokenSpaceGuid.PcdIp4Address0|192.168.1.5|VOID*|0x00000042 gUefiPayloadPkgTokenSpaceGuid.PcdIp4SubnetMask0|255.255.255.0|VOID*|0x00000= 043 gUefiPayloadPkgTokenSpaceGuid.PcdIp4Gateway0|192.168.1.1|VOID*|0x00000044 This booted into UEFI shell, but didn't assign the IP address. I will have multiple interfaces i need to set static IP addresses to, but e= th0 is of course the first :-) Any help gratefully received. Kind regards -=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 (#120902): https://edk2.groups.io/g/devel/message/120902 Mute This Topic: https://groups.io/mt/110160546/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --vjaGgjQKeKGp0BzdFExD Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <div>Hi,<br /><br />Within EDK2 payload, I am trying to get a static IP add= ress set, so that when I enter UEFI Shell, I can ping another computer.&nbs= p;<br /><br />At the moment I have the network stack elements started autom= atically, but still need to type 'ifconfig -s eth0 static 192.168.1.5 255.2= 55.255.0 192.168.1.1' every time to get the IP address assigned before i ca= n ping 192.168.1.10<br /><br />I'd like to start the UEFI shell and just ru= n the ping command, and it check if 192.168.1.10 is available.<br /><br /><= /div> <div> <div style=3D"box-sizing: border-box; overflow-wrap: break-word !important;= color: #333333; font-family: system-ui, 'Segoe UI', Roboto, 'Helvetica Neu= e', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji',= 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 16px; = font-style: normal; font-variant-ligatures: normal; font-variant-caps: norm= al; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start= ; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -we= bkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff= ; text-decoration-thickness: initial; text-decoration-style: initial; text-= decoration-color: initial;">The current versions of EDK2 and Slimboot from = github I am using are listed below</div> <div style=3D"box-sizing: border-box; overflow-wrap: break-word !important;= color: #333333; font-family: system-ui, 'Segoe UI', Roboto, 'Helvetica Neu= e', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji',= 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 16px; = font-style: normal; font-variant-ligatures: normal; font-variant-caps: norm= al; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start= ; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -we= bkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff= ; text-decoration-thickness: initial; text-decoration-style: initial; text-= decoration-color: initial;"> </div> <div style=3D"box-sizing: border-box; overflow-wrap: break-word !important;= color: #333333; font-family: system-ui, 'Segoe UI', Roboto, 'Helvetica Neu= e', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji',= 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 16px; = font-style: normal; font-variant-ligatures: normal; font-variant-caps: norm= al; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start= ; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -we= bkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff= ; text-decoration-thickness: initial; text-decoration-style: initial; text-= decoration-color: initial;">EDK2 - d13f31c3fe17eb532bf9016a2d8de3885642cba0= (https://github.com/tianocore/edk2/tree/d13f31c3fe17eb532bf9016a2d8de38856= 42cba0) from September 30th (I tried a newer version, but got build errors)= </div> <div style=3D"box-sizing: border-box; overflow-wrap: break-word !important;= color: #333333; font-family: system-ui, 'Segoe UI', Roboto, 'Helvetica Neu= e', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji',= 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 16px; = font-style: normal; font-variant-ligatures: normal; font-variant-caps: norm= al; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start= ; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -we= bkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff= ; text-decoration-thickness: initial; text-decoration-style: initial; text-= decoration-color: initial;">Slimboot - ca00703127e34c84c3e6d3d129ebc5ef292b= a963 (https://github.com/slimbootloader/slimbootloader/tree/ca00703127e34c8= 4c3e6d3d129ebc5ef292ba963) from October 25th</div> <div style=3D"box-sizing: border-box; overflow-wrap: break-word !important;= color: #333333; font-family: system-ui, 'Segoe UI', Roboto, 'Helvetica Neu= e', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji',= 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 16px; = font-style: normal; font-variant-ligatures: normal; font-variant-caps: norm= al; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start= ; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -we= bkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff= ; text-decoration-thickness: initial; text-decoration-style: initial; text-= decoration-color: initial;"> </div> </div> <div>I've tried the following...<br /><br />Creating a C and INF file,<br /= ><br /></div> <div>C File</div> <div>=3D=3D=3D=3D</div> <div> <div>#include <Library/DebugLib.h><br />#include <Uefi.h><br />= #include <Library/UefiBootServicesTableLib.h><br />#include <Proto= col/Ip4Config2.h><br />//#include <Library/BaseMemoryLib.h><br />#= include <Library/MemoryAllocationLib.h><br />//#include <Library/P= rintLib.h></div> <div>EFI_STATUS<br />EFIAPI<br />StaticIpDriverEntryPoint (<br /> IN = EFI_HANDLE ImageHandle,<br /> IN EFI_SYSTE= M_TABLE *SystemTable<br /> )<br />{<br /> EFI_STATUS &nbs= p; Status;<br /> EFI= _IP4_CONFIG2_PROTOCOL *Ip4Config2;<br /> EFI_IP4_CONFIG2_MANUA= L_ADDRESS Address;<br /> EFI_HANDLE  = ; *HandleBuffer;<br /> UINTN  = ; HandleCount;<br />= UINTN = Index;</div> <div> // Print(L"GREG - Setting Static IP Address - Using StaticIpDri= verEntryPoint\n");<br /> DEBUG ((DEBUG_INFO, "GREG - - Setting = Static IP Address - Using StaticIpDriverEntryPoint\n"));</div> <div> // Locate all handles that support the EFI_IP4_CONFIG2_PROTOCOL= <br /> Status =3D gBS->LocateHandleBuffer(ByProtocol, &gEfiIp4= Config2ProtocolGuid, NULL, &HandleCount, &HandleBuffer);<br /> = ; if (EFI_ERROR(Status)) {<br /> return Status;<br /> }<= /div> <div> for (Index =3D 0; Index < HandleCount; Index++) {<br /> = ; Status =3D gBS->HandleProtocol(HandleBuffer[Index], &gEfiIp= 4Config2ProtocolGuid, (VOID **)&Ip4Config2);<br /> if (EFI= _ERROR(Status)) {<br /> continue;<br /> }<= /div> <div> // Set the manual IP address<br /> Address.= Address.Addr[0] =3D 192;<br /> Address.Address.Addr[1] =3D 168= ;<br /> Address.Address.Addr[2] =3D 1;<br /> Addr= ess.Address.Addr[3] =3D 5;<br /> Address.SubnetMask.Addr[0] = =3D 255;<br /> Address.SubnetMask.Addr[1] =3D 255;<br /> = Address.SubnetMask.Addr[2] =3D 255;<br /> Address.Subn= etMask.Addr[3] =3D 0;<br /> <br /> Status = =3D Ip4Config2->SetData(Ip4Config2, Ip4Config2DataTypeManualAddress, siz= eof(Address), &Address);<br /> if (EFI_ERROR(Status)) {<br= /> continue;<br /> }</div> <div> // Optionally, set the gateway and DNS server addresses = here</div> <div> // Break after setting the IP on the first interface<br = /> break;<br /> }</div> <div> // Free the handle buffer<br /> if (HandleBuffer !=3D NUL= L) {<br /> FreePool(HandleBuffer);<br /> }</div> <div> return Status;<br />}</div> <div>//VOID<br />EFI_STATUS<br />EFIAPI<br />_ModuleEntryPoint (<br /> = ; IN EFI_HANDLE ImageHandle,<br /> IN EFI_= SYSTEM_TABLE *SystemTable<br /> )<br />{<br /> EFI_STATUS= Status;<br /> = ; EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;<br /> EFI_IP4_CONFIG2_= MANUAL_ADDRESS Address;<br /> EFI_HANDLE = *HandleBuffer;<br /> UINTN = HandleCount;<= br /> UINTN &= nbsp; Index;</div> <div>// Print(L"GREG - Setting Static IP Address - Using _ModuleEntry= Point\n");<br /> DEBUG ((DEBUG_INFO, "GREG - - Setting Static I= P Address - Using _ModuleEntryPoint\n"));</div> <div> // Locate all handles that support the EFI_IP4_CONFIG2_PROTOCOL= <br /> Status =3D gBS->LocateHandleBuffer(ByProtocol, &gEfiIp4= Config2ProtocolGuid, NULL, &HandleCount, &HandleBuffer);<br /> = ; if (EFI_ERROR(Status)) {<br /> return Status;<br /> }<= /div> <div> for (Index =3D 0; Index < HandleCount; Index++) {<br /> = ; Status =3D gBS->HandleProtocol(HandleBuffer[Index], &gEfiIp= 4Config2ProtocolGuid, (VOID **)&Ip4Config2);<br /> if (EFI= _ERROR(Status)) {<br /> continue;<br /> }<= /div> <div> // Set the manual IP address<br /> Address.= Address.Addr[0] =3D 192;<br /> Address.Address.Addr[1] =3D 168= ;<br /> Address.Address.Addr[2] =3D 1;<br /> Addr= ess.Address.Addr[3] =3D 100;<br /> Address.SubnetMask.Addr[0] = =3D 255;<br /> Address.SubnetMask.Addr[1] =3D 255;<br /> = Address.SubnetMask.Addr[2] =3D 255;<br /> Address.Subn= etMask.Addr[3] =3D 0;</div> <div> Status =3D Ip4Config2->SetData(Ip4Config2, Ip4Config2= DataTypeManualAddress, sizeof(Address), &Address);<br /> i= f (EFI_ERROR(Status)) {<br /> continue;<br /> &nb= sp; }</div> <div> // Optionally, set the gateway and DNS server addresses = here</div> <div> // Break after setting the IP on the first interface<br = /> break;<br /> }</div> <div> // Free the handle buffer<br /> if (HandleBuffer !=3D NUL= L) {<br /> FreePool(HandleBuffer);<br /> }</div> <div> return Status;<br />}<br /><br />and INF File<br /><br /> <div>[Defines]<br /> INF_VERSION &= nbsp; =3D 0x00010017<br /> BASE_NAME  = ; =3D = StaticIpConfigDxe<br /> FILE_GUID = =3D 7283e2fb-eeca-47d8-8576-5d5522= 5ec820<br /> MODULE_TYPE &n= bsp; =3D DXE_DRIVER<br /> VERSION_STRING &= nbsp; =3D 1.0<br /> ENTRY_P= OINT = =3D StaticIpDriverEntryPoint</div> <div>[Sources]<br /> StaticIpConfigDxe.c</div> <div>[Packages]<br /> MdePkg/MdePkg.dec<br /> MdeModulePkg/MdeM= odulePkg.dec<br /> UefiPayloadPkg/UefiPayloadPkg.dec</div> <div>[LibraryClasses]<br /> UefiLib<br /> UefiBootServicesTable= Lib<br /> DebugLib<br /> MemoryAllocationLib<br /> PrintL= ib</div> <div>[Protocols]<br /> gEfiIp4Config2ProtocolGuid</div> <div>[Depex]<br /> gEfiIp4Config2ProtocolGuid<br /><br /><br />but lo= ading the INF file into sbl_02\edk2\UefiPayloadPkg\UefiPayloadPkg.dsc and s= bl_02\edk2\UefiPayloadPkg\UefiPayloadPkg.fdf caused the build binary to not= load.<br /><br />I commented out the above entries and then modified sbl_0= 2\edk2\UefiPayloadPkg\UefiPayloadPkg.dsc and sbl_02\edk2\UefiPayloadPkg\Uef= iPayloadPkg.dec<br /><br />I added into the dsc the following<br /><br />&n= bsp; # Disable DHCP<br /> gUefiPayloadPkgTokenSpaceGuid.PcdIPv4Enable= |TRUE<br /> gUefiPayloadPkgTokenSpaceGuid.PcdDhcp|FALSE<br /> &n= bsp;<br /> # Static IP configuration for eth0<br /> gUefiPayloa= dPkgTokenSpaceGuid.PcdIp4Address0|192.168.1.5<br /> gUefiPayloadPkgTo= kenSpaceGuid.PcdIp4SubnetMask0|255.255.255.0<br /> gUefiPayloadPkgTok= enSpaceGuid.PcdIp4Gateway0|192.168.1.1</div> <div> </div> <div>In the dec I added<br /><br />[PcdsFixedAtBuild]<br /> gUefiPayl= oadPkgTokenSpaceGuid.PcdIPv4Enable|TRUE|BOOLEAN|0x00000001<br /> gUef= iPayloadPkgTokenSpaceGuid.PcdDhcp|FALSE|BOOLEAN|0x00000002<br /> gUef= iPayloadPkgTokenSpaceGuid.PcdIp4Address0|192.168.1.5|VOID*|0x00000042<br />= gUefiPayloadPkgTokenSpaceGuid.PcdIp4SubnetMask0|255.255.255.0|VOID*|= 0x00000043<br /> gUefiPayloadPkgTokenSpaceGuid.PcdIp4Gateway0|192.168= .1.1|VOID*|0x00000044</div> <div> </div> <div>This booted into UEFI shell, but didn't assign the IP address. </= div> <div> </div> <div>I will have multiple interfaces i need to set static IP addresses to, = but eth0 is of course the first :-)</div> <div> </div> <div>Any help gratefully received.<br /><br />Kind regards</div> </div> </div> <div width=3D"1" style=3D"color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p> =20 You receive all messages sent to this group. =20 =20 <p> <a target=3D"_blank" href=3D"https://edk2.groups.io/g/devel/message/120902"= >View/Reply Online (#120902)</a> | =20 | <a target=3D"_blank" href=3D"https://groups.io/mt/110160546/7686176">Mute= This Topic</a> | <a href=3D"https://edk2.groups.io/g/devel/post">New Topic</a> <br> <a href=3D"https://edk2.groups.io/g/devel/editsub/7686176">Your Subscriptio= n</a> | <a href=3D"mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> | <a href=3D"https://edk2.groups.io/g/devel/unsub">Unsubscribe</a> [rebecca@openfw.io]<br> <div width=3D"1" style=3D"color:white;clear:both">_._,_._,_</div> --vjaGgjQKeKGp0BzdFExD--