From 62f4b393d1b376dfd19fdeaae5f11782ee9682fe Mon Sep 17 00:00:00 2001 From: Patrick Wildt Date: Tue, 13 Aug 2019 09:00:21 +0000 Subject: Allow PXE booting using u-boot by relaxing our requirements of the EFI PXE protocol. This also brings us in line with the GRUB2 implementation. Tested by naddy@ to behave the same Tested by sven falempin on his Pine64 --- sys/arch/arm64/stand/efiboot/conf.c | 4 ++-- sys/arch/arm64/stand/efiboot/efipxe.c | 17 +++-------------- 2 files changed, 5 insertions(+), 16 deletions(-) (limited to 'sys/arch/arm64') diff --git a/sys/arch/arm64/stand/efiboot/conf.c b/sys/arch/arm64/stand/efiboot/conf.c index 3cba4d95faa..3b47ff62681 100644 --- a/sys/arch/arm64/stand/efiboot/conf.c +++ b/sys/arch/arm64/stand/efiboot/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.22 2019/08/12 19:17:35 kettenis Exp $ */ +/* $OpenBSD: conf.c,v 1.23 2019/08/13 09:00:20 patrick Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -45,7 +45,7 @@ #include "efipxe.h" #include "softraid_arm64.h" -const char version[] = "0.18"; +const char version[] = "0.19"; int debug = 0; struct fs_ops file_system[] = { diff --git a/sys/arch/arm64/stand/efiboot/efipxe.c b/sys/arch/arm64/stand/efiboot/efipxe.c index 176f65b4c0d..9a9af5886fa 100644 --- a/sys/arch/arm64/stand/efiboot/efipxe.c +++ b/sys/arch/arm64/stand/efiboot/efipxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efipxe.c,v 1.5 2019/04/25 20:19:30 naddy Exp $ */ +/* $OpenBSD: efipxe.c,v 1.6 2019/08/13 09:00:20 patrick Exp $ */ /* * Copyright (c) 2017 Patrick Wildt * @@ -89,7 +89,7 @@ efi_pxeprobe(void) return; for (i = 0; i < nhandles; i++) { - EFI_PXE_BASE_CODE_DHCPV4_PACKET *dhcp = NULL; + EFI_PXE_BASE_CODE_DHCPV4_PACKET *dhcp; status = EFI_CALL(BS->HandleProtocol, handles[i], &devp_guid, (void **)&dp0); @@ -113,21 +113,10 @@ efi_pxeprobe(void) if (pxe->Mode == NULL) continue; - if (pxe->Mode->DhcpAckReceived) { - dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET *) - &pxe->Mode->DhcpAck; - } - if (pxe->Mode->PxeReplyReceived) { - dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET *) - &pxe->Mode->PxeReply; - } - - if (!dhcp) - continue; - if (pxe->Mtftp != NULL) use_mtftp = 1; + dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET *)&pxe->Mode->DhcpAck; memcpy(&bootip, dhcp->BootpYiAddr, sizeof(bootip)); memcpy(&servip, dhcp->BootpSiAddr, sizeof(servip)); memcpy(&gateip, dhcp->BootpSiAddr, sizeof(gateip)); -- cgit v1.2.3