git: 42acb16bb86f - main - rescue: add ipfw, pfctl

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 19 Apr 2024 23:11:42 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=42acb16bb86fe6ec18c0591f9a9a3dbad1719d1d

commit 42acb16bb86fe6ec18c0591f9a9a3dbad1719d1d
Author:     Lexi Winter <lexi@le-Fay.ORG>
AuthorDate: 2024-04-19 22:53:23 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-19 22:54:31 +0000

    rescue: add ipfw, pfctl
    
    Rationale for this change:
    
    - ipf is already there
    
    - if the kernel is configured with a packet filter which drops packets
      by default, pfctl or ipfw will be required in the rescue environment
      to make the network functional.
    
    - rescue's stated purpose is to be useful for small/embedded systems
      (and is also quite useful for small jails); a rescue-based router
      would want these binaries.
    
    On amd64, this increases the size of rescue from 17346200 to 17907248,
    or 561048 bytes (3.2%).
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1169
---
 rescue/rescue/Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile
index c1ba22885618..6dceea6f5077 100644
--- a/rescue/rescue/Makefile
+++ b/rescue/rescue/Makefile
@@ -119,6 +119,15 @@ CRUNCH_PROGS_sbin+= ipf
 CRUNCH_LIBS_ipf+=	${LIBIPF}
 .endif
 
+.if ${MK_IPFW} != "no"
+CRUNCH_PROGS_sbin+= ipfw
+.endif
+
+.if ${MK_PF} != "no"
+CRUNCH_PROGS_sbin+= pfctl
+CRUNCH_LIBS_pfctl+= ${LIBPFCTL} ${LIBNV}
+.endif
+
 .if ${MK_ROUTED} != "no"
 CRUNCH_PROGS_sbin+= routed rtquery
 .endif