git: d6250b82ecf9 - main - Revert "sysutils/edk2: fix network boot on bhyve"

From: Olivier Cochard <olivier_at_FreeBSD.org>
Date: Wed, 16 Sep 2026 19:46:45 UTC
The branch main has been updated by olivier:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d6250b82ecf9a1877ec64bb432ffcdfe6ccabeed

commit d6250b82ecf9a1877ec64bb432ffcdfe6ccabeed
Author:     Olivier Cochard <olivier@FreeBSD.org>
AuthorDate: 2026-09-16 19:23:58 +0000
Commit:     Olivier Cochard <olivier@FreeBSD.org>
CommitDate: 2026-09-16 19:42:16 +0000

    Revert "sysutils/edk2: fix network boot on bhyve"
    
    This reverts commit 3fcead9dc69a1fb01bf4200ce3b079e942b57f39.
    
    Wrongly added non-related files to previous commit.
---
 .../files/patch-src_ui_http__server.c              | 29 ----------------
 net-mgmt/pmacct/files/patch-src_nfv9__template.c   | 22 ------------
 net/pimd/files/patch-src_main.c                    | 39 ----------------------
 sysutils/edk2/Makefile                             |  2 +-
 .../edk2/files/patch-OvmfPkg_Bhyve_BhyveX64.dsc    | 34 -------------------
 .../edk2/files/patch-OvmfPkg_Bhyve_BhyveX64.fdf    | 21 ------------
 6 files changed, 1 insertion(+), 146 deletions(-)

diff --git a/devel/codebase-memory-mcp/files/patch-src_ui_http__server.c b/devel/codebase-memory-mcp/files/patch-src_ui_http__server.c
deleted file mode 100644
index 1fd0ad857385..000000000000
--- a/devel/codebase-memory-mcp/files/patch-src_ui_http__server.c
+++ /dev/null
@@ -1,29 +0,0 @@
---- src/ui/http_server.c.orig	2026-08-18 20:39:59 UTC
-+++ src/ui/http_server.c
-@@ -61,6 +61,10 @@
- #endif
- #ifdef __APPLE__
- #include <mach-o/dyld.h>
-+#endif
-+#ifdef __FreeBSD__
-+#include <sys/types.h>
-+#include <sys/sysctl.h>
- #endif
- 
- /* ── Constants ────────────────────────────────────────────────── */
-@@ -929,6 +933,15 @@
-         return copy_path(out, outsz, buf);
-     }
-     return false;
-+#elif defined(__FreeBSD__)
-+    /* No /proc by default on FreeBSD; ask the kernel for our own path. */
-+    char buf[1024];
-+    int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
-+    size_t cb = sizeof(buf);
-+    if (sysctl(mib, 4, buf, &cb, NULL, 0) == 0 && cb > 0) {
-+        return copy_path(out, outsz, buf);
-+    }
-+    return false;
- #else
-     char buf[1024];
-     ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
diff --git a/net-mgmt/pmacct/files/patch-src_nfv9__template.c b/net-mgmt/pmacct/files/patch-src_nfv9__template.c
deleted file mode 100644
index adf595885957..000000000000
--- a/net-mgmt/pmacct/files/patch-src_nfv9__template.c
+++ /dev/null
@@ -1,22 +0,0 @@
-- libcdada >= 0.6.0 added a prev_val out-param to cdada_map_insert_replace()
-
---- src/nfv9_template.c.orig	2022-12-31 19:17:17 UTC
-+++ src/nfv9_template.c
-@@ -1628,7 +1628,7 @@ struct template_cache_entry *handle_template_v2(struct
-   if (tpl_type == 0 || tpl_type == 2) {
-     tpl = compose_template(hdr, (struct sockaddr *)pptrs->f_agent, tpl_type, sid, pens, version, len, seq);
- 
--    ret = cdada_map_insert_replace(tpl_data_map, hash_keyval, tpl);
-+    ret = cdada_map_insert_replace(tpl_data_map, hash_keyval, tpl, NULL);
-     if (ret != CDADA_SUCCESS) {
-       Log(LOG_WARNING, "WARN ( %s/core ): Unable to insert / refresh template in tpl_data_map\n", config.name);
-       goto exit_lane;
-@@ -1638,7 +1638,7 @@ struct template_cache_entry *handle_template_v2(struct
-   else if (tpl_type == 1 || tpl_type == 3) {
-     tpl = compose_opt_template(hdr, (struct sockaddr *)pptrs->f_agent, tpl_type, sid, pens, version, len, seq);
- 
--    ret = cdada_map_insert_replace(tpl_data_map, hash_keyval, tpl);
-+    ret = cdada_map_insert_replace(tpl_data_map, hash_keyval, tpl, NULL);
-     if (ret != CDADA_SUCCESS) {
-       Log(LOG_WARNING, "WARN ( %s/core ): Unable to insert / refresh template in tpl_opt_map\n", config.name);
-       goto exit_lane;
diff --git a/net/pimd/files/patch-src_main.c b/net/pimd/files/patch-src_main.c
deleted file mode 100644
index 75d39d5dc974..000000000000
--- a/net/pimd/files/patch-src_main.c
+++ /dev/null
@@ -1,39 +0,0 @@
---- src/main.c.orig	2022-08-11 06:59:04 UTC
-+++ src/main.c
-@@ -373,20 +373,24 @@ int main(int argc, char *argv[])
- 	    dup2(fd, STDERR_FILENO);
- 	    close(fd);
- 	}
--#if defined(SYSV) || defined(__linux__)
--	setpgrp();
--#else
--#ifdef TIOCNOTTY
--	fd = open("/dev/tty", 2);
--	if (fd >= 0) {
--	    (void)ioctl(fd, TIOCNOTTY, NULL);
--	    close(fd);
--	}
--#else
-+
-+	/*
-+	 * Become a session leader with no controlling terminal.
-+	 *
-+	 * When pimd is started at boot from an rc script whose session is
-+	 * attached to the (serial) console, the forked child otherwise stays
-+	 * in the console's foreground process group.  An INTR character (^C)
-+	 * on the console then reaches pimd through the tty line discipline
-+	 * (tty_signal_pgrp -> SIGINT) and pimd shuts down.  setsid() detaches
-+	 * us from that session and controlling tty entirely.
-+	 *
-+	 * setsid() is the portable primitive; it supersedes the older
-+	 * setpgrp()/TIOCNOTTY variants below, which on FreeBSD left the child
-+	 * in the console process group because TIOCNOTTY was preferred over
-+	 * setsid().
-+	 */
- 	if (setsid() < 0)
- 	    perror("setsid");
--#endif
--#endif
-     }
- 
-     /*
diff --git a/sysutils/edk2/Makefile b/sysutils/edk2/Makefile
index 05bec1f35924..55e051f2f218 100644
--- a/sysutils/edk2/Makefile
+++ b/sysutils/edk2/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	edk2
 PORTVERSION=	g202508
-PORTREVISION=	3
+PORTREVISION=	2
 CATEGORIES=	sysutils
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
diff --git a/sysutils/edk2/files/patch-OvmfPkg_Bhyve_BhyveX64.dsc b/sysutils/edk2/files/patch-OvmfPkg_Bhyve_BhyveX64.dsc
deleted file mode 100644
index f1b2994f0111..000000000000
--- a/sysutils/edk2/files/patch-OvmfPkg_Bhyve_BhyveX64.dsc
+++ /dev/null
@@ -1,34 +0,0 @@
---- OvmfPkg/Bhyve/BhyveX64.dsc.orig	2025-08-12 17:42:44 UTC
-+++ OvmfPkg/Bhyve/BhyveX64.dsc
-@@ -43,8 +43,8 @@
-   # Network definition
-   #
-   DEFINE NETWORK_TLS_ENABLE             = FALSE
--  DEFINE NETWORK_IP6_ENABLE             = FALSE
--  DEFINE NETWORK_HTTP_BOOT_ENABLE       = FALSE
-+  DEFINE NETWORK_IP6_ENABLE             = TRUE
-+  DEFINE NETWORK_HTTP_BOOT_ENABLE       = TRUE
-   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
-   DEFINE NETWORK_ISCSI_ENABLE           = TRUE
- 
-@@ -745,6 +745,20 @@
-   MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf
-   MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
-   MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
-+
-+  #
-+  # EFI_RNG_PROTOCOL producer: the NetworkPkg drivers all carry a
-+  # gEfiRngProtocolGuid depex, and bhyve has no virtio-rng device for
-+  # VirtioRngDxe to bind to, so without this they never dispatch.
-+  #
-+  SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
-+
-+  #
-+  # EFI_HASH2_SERVICE_BINDING_PROTOCOL producer: TcpDxe depends on it,
-+  # and without TcpDxe there is no HttpServiceBinding, so HttpBootDxe
-+  # never binds. OvmfPkgX64.dsc includes this; the Bhyve DSC omitted it.
-+  #
-+  SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf
- 
-   #
-   # Network Support
diff --git a/sysutils/edk2/files/patch-OvmfPkg_Bhyve_BhyveX64.fdf b/sysutils/edk2/files/patch-OvmfPkg_Bhyve_BhyveX64.fdf
deleted file mode 100644
index 315f105e7542..000000000000
--- a/sysutils/edk2/files/patch-OvmfPkg_Bhyve_BhyveX64.fdf
+++ /dev/null
@@ -1,21 +0,0 @@
---- OvmfPkg/Bhyve/BhyveX64.fdf.orig	2025-08-12 17:42:44 UTC
-+++ OvmfPkg/Bhyve/BhyveX64.fdf
-@@ -274,6 +274,18 @@ INF MdeModulePkg/Logo/LogoDxe.inf
- INF MdeModulePkg/Logo/LogoDxe.inf
- 
- #
-+# Protocol producers the NetworkPkg drivers depend on, both absent from
-+# the stock Bhyve build:
-+#  - RngDxe: every NetworkPkg depex requires gEfiRngProtocolGuid, and
-+#    bhyve has no virtio-rng device for VirtioRngDxe to bind to.
-+#  - Hash2DxeCrypto: TcpDxe requires gEfiHash2ServiceBindingProtocolGuid;
-+#    without TcpDxe there is no HttpServiceBinding and HttpBootDxe never
-+#    binds. OvmfPkgX64 ships both; the Bhyve platform omitted them.
-+#
-+INF  SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
-+INF  SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf
-+
-+#
- # Network modules
- #
- !if $(E1000_ENABLE)