git: 87add5f1f65f - main - net/wifibox: Update to 1.0.0

From: Ashish SHUKLA <ashish_at_FreeBSD.org>
Date: Sat, 07 May 2022 05:29:39 UTC
The branch main has been updated by ashish:

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

commit 87add5f1f65f6551056b53929838bebe64c7637b
Author:     PÁLI Gábor János <pali.gabor@gmail.com>
AuthorDate: 2022-05-05 16:47:39 +0000
Commit:     Ashish SHUKLA <ashish@FreeBSD.org>
CommitDate: 2022-05-07 05:29:10 +0000

    net/wifibox: Update to 1.0.0
    
    - Split the port into net/wifibox-core and net/wifibox-alpine (image)
    - Update net/wifibox-core to 0.9.0
    - Switch to fully scripted image building with minimalistic base (using
      Linux 5.15.36, linux-firmware 20220411) and many selectable components
      (see port options), lower resource needs, based on SquashFS
    - Introduce package flavors per default firmware configuration
    
    Changes:        https://github.com/pgj/freebsd-wifibox/releases/tag/0.9.0
---
 net/Makefile                              |   2 +
 net/wifibox-alpine/Makefile               | 274 ++++++++++++++++++++++++++++++
 net/wifibox-alpine/distinfo               |  53 ++++++
 net/wifibox-alpine/flavors.mk             |   3 +
 net/wifibox-alpine/pkg-descr              |   9 +
 net/{wifibox => wifibox-alpine}/pkg-plist |  22 +--
 net/wifibox-core/Makefile                 |  58 +++++++
 net/wifibox-core/distinfo                 |   3 +
 net/wifibox-core/pkg-descr                |   4 +
 net/wifibox-core/pkg-plist                |  11 ++
 net/wifibox/Makefile                      |  59 +------
 net/wifibox/distinfo                      |   7 -
 12 files changed, 433 insertions(+), 72 deletions(-)

diff --git a/net/Makefile b/net/Makefile
index 42d5c3d040de..7f7715c183d1 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -1562,6 +1562,8 @@
     SUBDIR += whois
     SUBDIR += widentd
     SUBDIR += wifibox
+    SUBDIR += wifibox-alpine
+    SUBDIR += wifibox-core
     SUBDIR += wireguard
     SUBDIR += wireguard-go
     SUBDIR += wireguard-kmod
diff --git a/net/wifibox-alpine/Makefile b/net/wifibox-alpine/Makefile
new file mode 100644
index 000000000000..682d17233ede
--- /dev/null
+++ b/net/wifibox-alpine/Makefile
@@ -0,0 +1,274 @@
+PORTNAME=	wifibox-alpine
+PORTVERSION=	20220430
+CATEGORIES=	net
+
+MAINTAINER=	pali.gabor@gmail.com
+COMMENT=	Wifibox guest based on Alpine Linux
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC_scripts}/LICENSE
+
+ONLY_FOR_ARCHS=	amd64
+EXTRACT_ONLY=	${_DISTFILES:M*_GH0.tar.gz}
+
+BUILD_DEPENDS=	patchelf>0:sysutils/patchelf \
+		squashfs-tools>0:sysutils/squashfs-tools
+
+.include "${.CURDIR}/flavors.mk"
+
+.for flavor in ${_FLAVORS}
+${flavor}_PKGNAMESUFFIX=	-${flavor}
+.endfor
+
+OPTIONS_SUB=			yes
+
+OPTIONS_SINGLE=			COMPRESSION
+OPTIONS_SINGLE_COMPRESSION=	COMP_GZIP COMP_LZO COMP_LZ4 COMP_XZ COMP_ZSTD
+
+OPTIONS_DEFAULT=		COMP_XZ
+
+COMP_GZIP_DESC=		gzip
+COMP_LZO_DESC=		lzo
+COMP_LZ4_DESC=		lz4
+COMP_XZ_DESC=		xz
+COMP_ZSTD_DESC=		zstd
+
+.if ${FLAVOR:U} == default
+OPTIONS_GROUP=		FIRMWARE EXTRAS
+OPTIONS_GROUP_FIRMWARE=	FW_ATH10K FW_ATH11K FW_ATMEL FW_B43 FW_B43LEGACY FW_BRCM\
+			FW_IPW2100 FW_IPW2200 FW_IWL3945 FW_IWL4965 FW_IWLWIFI\
+			FW_MEDIATEK FW_MARVELL FW_RT61 FW_RTLWIFI FW_RTW88 FW_TI
+OPTIONS_GROUP_EXTRAS=	XX_DRIVER_WL XX_DRIVER_RTW89
+
+OPTIONS_DEFAULT+=	FW_ATH10K FW_ATH11K FW_BRCM FW_IWLWIFI FW_MEDIATEK\
+			FW_MARVELL FW_RT61 FW_RTLWIFI FW_RTW88
+
+FW_ATH10K_DESC=		Qualcomm Atheros 802.11ac
+FW_ATH11K_DESC=		Qualcomm Atheros 802.11ax
+FW_ATMEL_DESC=		Atmel at76c50x 802.11b
+FW_B43_DESC=		Broadcom B43xx 802.11a/b/g/n
+FW_B43LEGACY_DESC=	Broadcom B43xx 802.11b (legacy)
+FW_BRCM_DESC=		Broadcom 802.11n
+FW_IWL3945_DESC=	Intel(R) PRO/Wireless 3945ABG 802.11a/b/g
+FW_IWL4965_DESC=	Intel(R) Wireless WiFi 4965AGN 802.11a/b/g/n
+FW_IWLWIFI_DESC=	Intel(R) Wireless WiFi 802.11a/b/g/n
+FW_IPW2100_DESC=	Intel(R) PRO/Wireless 2100 802.11a/b
+FW_IPW2200_DESC=	Intel(R) PRO/Wireless 2200 802.11b/g/n
+FW_MEDIATEK_DESC=	MediaTek MT76xxx 802.11n, MT79xx 802.11ax
+FW_MARVELL_DESC=	Marvell 88W8xxx (TopDog) 802.11b/g/n
+FW_RT61_DESC=		Ralink RT2xxx (RT61) 802.11a/b/g
+FW_RTLWIFI_DESC=	Realtek 802.11n
+FW_RTW88_DESC=		Realtek 802.11ac
+FW_TI_DESC=		Texas Instruments WL1xxx 802.11b/g/n
+
+XX_DRIVER_WL_DESC=	Broadcom 802.11 STA driver (+ firmware, exclusive)
+XX_DRIVER_RTW89_DESC=	Realtek 802.11ax driver (+ firmware)
+.endif
+
+_GITHUB_SITE=	https://github.com/pgj/freebsd-wifibox-alpine/releases/download
+
+USE_GITHUB=	nodefault
+GH_ACCOUNT=	pgj
+GH_PROJECT=	freebsd-wifibox-alpine:scripts
+GH_TAGNAME=	dac84c054786b6eb6f329662748d9a199b05f2df:scripts
+
+ALPINE_VERSION=	3.15.4
+_ALPINE_VER=	${ALPINE_VERSION:C@([0-9]+)\.([0-9]+).*@\1.\2@}
+
+.if defined(ALPINE_DATE)
+_SNAPSHOT=	${ALPINE_DATE:S/./-/g}
+_ALPINE_SITE=	https://mirror.fit.cvut.cz/alpine/snapshots/${_SNAPSHOT}/v${_ALPINE_VER}
+.else
+_ALPINE_SITE=	https://mirror.fit.cvut.cz/alpine/v${_ALPINE_VER}
+.endif
+
+_LINUXFW_SITE=	https://git.kernel.org/pub/scm/linux/kernel/git/firmware/
+_LINUXFW_TAG=	20220411
+_LINUXFW=	linux-firmware-${_LINUXFW_TAG}
+
+MASTER_SITES+=	${_ALPINE_SITE}/releases/x86_64/:rootfs \
+		${_ALPINE_SITE}/main/x86_64/:main_packages \
+		${_ALPINE_SITE}/community/x86_64/:community_packages \
+		${_GITHUB_SITE}/packages/:custom_packages \
+		${_LINUXFW_SITE}/linux-firmware.git/snapshot/:linux_firmware \
+		https://sources.openwrt.org/:openwrt \
+		https://lwfinger.com/b43-firmware/:b43 \
+		https://thekelleys.org.uk/atmel/:atmel \
+		https://github.com/openwrt/mt76/archive/:mt76
+
+_MINIROOTFS=	alpine-minirootfs-${ALPINE_VERSION}-x86_64.tar.gz
+_PACKAGES=	baselayout-3.2.0-r18:wifibox \
+		busybox-1.34.1-r5:wifibox \
+		ifupdown-ng-0.11.3-r0:wifibox \
+		iptables-1.8.7-r1:wifibox \
+		iw-5.16-r0:community \
+		libcrypto1.1-1.1.1n-r0 \
+		libmnl-1.0.4-r2 \
+		libnftnl-1.2.1-r0 \
+		libnl3-3.5.0-r0 \
+		libssl1.1-1.1.1n-r0 \
+		linux-lts-5.15.36-r0:wifibox \
+		musl-1.2.2-r7 \
+		openrc-0.44.7-r5:wifibox \
+		pcsc-lite-libs-1.9.4-r0 \
+		socat-1.7.4.2-r0:wifibox \
+		wpa_passthru-0.1.1-r0:wifibox \
+		wpa_supplicant-2.9-r17:wifibox
+
+_GUEST_MEM=	45M
+
+_ATMEL_FIRMWARE=	atmel-firmware-1.3
+_B43LEGACY_FIRMWARE=	wl_apsta-3.130.20.0
+_B43_FIRMWARE=		broadcom-wl-6.30.163.46
+_IPW2100_FIRMWARE=	ipw/ipw2100-1.3 \
+			ipw/ipw2100-1.3-i
+_IPW2200_FIRMWARE=	iwi/ipw2200-bss \
+			iwi/ipw2200-ibss
+_MT76_FIRMWARE=		eecbb49920732b9b364f15c1ef0066342544b22b
+
+pre-everything::
+.if !defined(FIRMWARE_FILES)
+	@${ECHO_MSG} "===> NOTICE:"
+	@${ECHO_MSG}
+	@${ECHO_MSG} "Use the FIRMWARE_FILES make(1) variable to keep only the firmware"
+	@${ECHO_MSG} "files that are used by the driver to reduce the size of the disk"
+	@${ECHO_MSG} "image."
+	@${ECHO_MSG}
+	@sleep 1
+.endif
+
+.include <bsd.port.options.mk>
+
+.for flavor in ${_FLAVORS}
+.if ${FLAVOR:U} == ${flavor}
+PORT_OPTIONS+=		FW_${flavor:tu}
+.endif
+.endfor
+
+DIST_SUBDIR=	wifibox-alpine
+DISTFILES+=	${_MINIROOTFS}:rootfs
+
+LFW_ATH10K_FILES=	ath10k
+LFW_ATH11K_FILES=	ath11k
+LFW_BRCM_FILES=		brcm
+LFW_IWL3945_FILES=	iwlwifi-3945-*.ucode
+LFW_IWL4965_FILES=	iwlwifi-4965-*.ucode
+LFW_IWLWIFI_FILES=	iwlwifi-*
+LFW_MEDIATEK_FILES=	mediatek
+LFW_MARVELL_FILES=	mwl*
+LFW_RT61_FILES=		rt*.bin
+LFW_RTLWIFI_FILES=	rtlwifi
+LFW_RTW88_FILES=	rtw88
+LFW_TI_FILES=		ti-connectivity
+
+.for fw_opt in ${PORT_OPTIONS:MFW_*}
+.if defined(L${fw_opt}_FILES)
+LINUX_FIRMWARE+=	${L${fw_opt}_FILES}
+.endif
+.endfor
+
+.if ${PORT_OPTIONS:MXX_DRIVER_WL}
+_PACKAGES+=	broadcom-wl-6.30.223.271-r0:wifibox
+_GUEST_MEM=	50M
+.endif
+
+.if ${PORT_OPTIONS:MXX_DRIVER_RTW89}
+_PACKAGES+=	rtw89-20220421-r0:wifibox
+.endif
+
+.if !empty(LINUX_FIRMWARE)
+_LINUXFWFILE=	${_LINUXFW}.tar.gz
+_LINUXFWDIR=	${WRKDIR}/${_LINUXFW}
+DISTFILES+=	${_LINUXFWFILE}:linux_firmware
+.endif
+
+.for package in ${_PACKAGES}
+.if ${package:M*\:wifibox}
+DISTFILES+=	${package:C@^([^:]*):wifibox$@\1@}.apk:custom_packages
+.elif ${package:M*\:community}
+DISTFILES+=	${package:C@^([^:]*):community$@\1@}.apk:community_packages
+.else
+DISTFILES+=	${package:C@^([^:]*):wifibox$@\1@}.apk:main_packages
+.endif
+_APK_FILES+=	${_DISTDIR}/${package:C@^([^:]*):.*$@\1@}.apk
+.endfor
+
+_FIRMWAREDIR=	${WRKSRC}/guest/lib/firmware
+
+.if ${PORT_OPTIONS:MFW_ATMEL}
+DISTFILES+=	${_ATMEL_FIRMWARE}.tar.gz:atmel
+.endif
+
+.if ${PORT_OPTIONS:MFW_B43LEGACY}
+DISTFILES+=	${_B43LEGACY_FIRMWARE}.o:openwrt
+.endif
+
+.if ${PORT_OPTIONS:MFW_B43}
+DISTFILES+=	${_B43_FIRMWARE}.tar.bz2:b43
+EXTRACT_ONLY+=	${_B43_FIRMWARE}.tar.bz2
+.endif
+
+.if ${PORT_OPTIONS:MFW_B43*}
+BUILD_DEPENDS+=		b43-fwcutter>0:sysutils/b43-fwcutter
+FW_B43_TARGETDIR=	${_FIRMWAREDIR}/b43
+FW_B43_FIRMWARE=	${WRKDIR}/${_B43_FIRMWARE}.wl_apsta.o
+FW_B43LEGACY_TARGETDIR=	${_FIRMWAREDIR}/b43legacy
+FW_B43LEGACY_FIRMWARE=	${_DISTDIR}/${_B43LEGACY_FIRMWARE}.o
+.endif
+
+.if ${PORT_OPTIONS:MFW_IPW2*} && !exists(${SRC_BASE}/sys/Makefile)
+IGNORE= requires kernel source files in SRC_BASE=${SRC_BASE}
+.endif
+
+.if ${PORT_OPTIONS:MFW_MEDIATEK}
+DISTFILES+=	${_MT76_FIRMWARE}.zip:mt76
+.endif
+
+pre-build:
+	${MKDIR} ${_FIRMWAREDIR}
+.for fw in ${PORT_OPTIONS:MFW_B43*}
+.if ${fw}
+	(_TARGETDIR=${${fw}_TARGETDIR}; \
+	${MKDIR} $$_TARGETDIR; \
+	${LOCALBASE}/bin/b43-fwcutter -w $$_TARGETDIR ${${fw}_FIRMWARE}; \
+	${FIND} $$_TARGETDIR -mindepth 2 -type f -exec ${MV} {} $$_TARGETDIR \; ; \
+	${FIND} $$_TARGETDIR -type d -delete)
+.endif
+.endfor
+.if ${PORT_OPTIONS:MFW_ATMEL}
+	${TAR} -xf ${_DISTDIR}/${_ATMEL_FIRMWARE}.tar.gz \
+		-C ${_FIRMWAREDIR} --strip-components 2 \
+		*/images/atmel_*.bin
+.endif
+.for fw in ${PORT_OPTIONS:MFW_IPW2*}
+.for fw_file in ${${fw:C@FW@@}_FIRMWARE}
+	uudecode -p ${SRC_BASE}/sys/contrib/dev/${fw_file}.fw.uu \
+		> ${_FIRMWAREDIR}/${fw_file:C@^[^/]*/(.*)@\1@}.fw
+.endfor
+.endfor
+.for fw_files in ${LINUX_FIRMWARE}
+	${TAR} -xf ${_DISTDIR}/${_LINUXFWFILE} \
+		-C ${_FIRMWAREDIR} --strip-components 1 \
+		*/${fw_files}
+.endfor
+.if ${PORT_OPTIONS:MFW_MEDIATEK}
+	${TAR} -xf ${_DISTDIR}/${_MT76_FIRMWARE}.zip \
+		-C ${_FIRMWAREDIR} --strip-components 2 \
+		*/firmware/mt76??_e?.bin
+.endif
+
+post-install:
+	${PRINTF} "cpus=1\nmemory=${_GUEST_MEM}\n" \
+		> ${STAGEDIR}${PREFIX}/share/wifibox/bhyve.conf
+
+WRKSRC=		${WRKSRC_scripts}
+MAKE_ARGS+=	VERSION=${PORTVERSION} \
+		MINIROOTFS=${_DISTDIR}/${_MINIROOTFS} \
+		PACKAGES="${_APK_FILES}" \
+		SQUASHFS_COMP=${PORT_OPTIONS:MCOMP_*:S/COMP_//:tl}
+
+.if defined(FIRMWARE_FILES)
+MAKE_ARGS+=	FIRMWARE_FILES=${FIRMWARE_FILES}
+.endif
+
+.include <bsd.port.mk>
diff --git a/net/wifibox-alpine/distinfo b/net/wifibox-alpine/distinfo
new file mode 100644
index 000000000000..a7202a101a94
--- /dev/null
+++ b/net/wifibox-alpine/distinfo
@@ -0,0 +1,53 @@
+TIMESTAMP = 1651343100
+SHA256 (wifibox-alpine/alpine-minirootfs-3.15.4-x86_64.tar.gz) = 6abd0409ccd6b27cb5311e0d475af5a284515eb219626334b29b1c3141d47653
+SIZE (wifibox-alpine/alpine-minirootfs-3.15.4-x86_64.tar.gz) = 2730061
+SHA256 (wifibox-alpine/linux-firmware-20220411.tar.gz) = 533ae621b3eacf6a4696dab52a9dbc5727403a175c413b1682ab3f9cfb37872f
+SIZE (wifibox-alpine/linux-firmware-20220411.tar.gz) = 406388354
+SHA256 (wifibox-alpine/baselayout-3.2.0-r18.apk) = 196cf83e0fe370a2206e1590e04694a1851e3911b0471ec09483752421036cc6
+SIZE (wifibox-alpine/baselayout-3.2.0-r18.apk) = 14329
+SHA256 (wifibox-alpine/busybox-1.34.1-r5.apk) = 88f636a987ac58d170feb386b4ebe412eda698561462e22d9fecd017d94b965a
+SIZE (wifibox-alpine/busybox-1.34.1-r5.apk) = 340006
+SHA256 (wifibox-alpine/ifupdown-ng-0.11.3-r0.apk) = 7ed998628731d73f1aca736895a3486ec596ee1d1517d0a6a2a6053a39b351fb
+SIZE (wifibox-alpine/ifupdown-ng-0.11.3-r0.apk) = 29480
+SHA256 (wifibox-alpine/iptables-1.8.7-r1.apk) = 3f2b6c01e101ff23be57d6d6a35880f2669020a584563a5b383fbca409fbc66f
+SIZE (wifibox-alpine/iptables-1.8.7-r1.apk) = 467201
+SHA256 (wifibox-alpine/iw-5.16-r0.apk) = 3632bc7cf956f32a449fdbe80faba00bfdde342a6ff8ffa55c6008b818eccc54
+SIZE (wifibox-alpine/iw-5.16-r0.apk) = 99354
+SHA256 (wifibox-alpine/libcrypto1.1-1.1.1n-r0.apk) = bbc4f71851655a61eff270ce01f9a90575344ac645b9b0661ae37af77c952977
+SIZE (wifibox-alpine/libcrypto1.1-1.1.1n-r0.apk) = 1208228
+SHA256 (wifibox-alpine/libmnl-1.0.4-r2.apk) = 6d3215caa5a9f2faac42cf3c2d0999a3ad12f8e95e75839d14ead8e3682d14df
+SIZE (wifibox-alpine/libmnl-1.0.4-r2.apk) = 9393
+SHA256 (wifibox-alpine/libnftnl-1.2.1-r0.apk) = e5b2985212f6cbcf5bbf43ac3235fc0189d6206b9df9d8e012b86b739c7c5b4b
+SIZE (wifibox-alpine/libnftnl-1.2.1-r0.apk) = 70513
+SHA256 (wifibox-alpine/libnl3-3.5.0-r0.apk) = 4bb7863bf7bdeccf07940381974ece2100d5a2ada4061a2aa727da9e252f4bb1
+SIZE (wifibox-alpine/libnl3-3.5.0-r0.apk) = 326405
+SHA256 (wifibox-alpine/libssl1.1-1.1.1n-r0.apk) = 53429d8132c27be764485c8d13fc1d234f90b8627c21eff2307d1ecaf7bf3289
+SIZE (wifibox-alpine/libssl1.1-1.1.1n-r0.apk) = 213209
+SHA256 (wifibox-alpine/linux-lts-5.15.36-r0.apk) = 329a417bb74c2786d6d2a61702ba124e14cb1dc9a623879fd61f4a64c95571fd
+SIZE (wifibox-alpine/linux-lts-5.15.36-r0.apk) = 7662464
+SHA256 (wifibox-alpine/musl-1.2.2-r7.apk) = 618c363879225e0d8075420970eefaafc81e34be9cf717772af76331cb3e9c29
+SIZE (wifibox-alpine/musl-1.2.2-r7.apk) = 383152
+SHA256 (wifibox-alpine/openrc-0.44.7-r5.apk) = 7651ff29cabcdb2ab86bf6e0e74c2e67da98a578d8031b536a6e7bfa9a7f7642
+SIZE (wifibox-alpine/openrc-0.44.7-r5.apk) = 366800
+SHA256 (wifibox-alpine/pcsc-lite-libs-1.9.4-r0.apk) = fe7bdd35bf95247e86961cfa83f16b7071c18798b08b2c69b33213e63515e682
+SIZE (wifibox-alpine/pcsc-lite-libs-1.9.4-r0.apk) = 18252
+SHA256 (wifibox-alpine/socat-1.7.4.2-r0.apk) = 07e21fdadf9fc16638e2a252e42f5adbe9af2c02e595af280507f8b42b155f1f
+SIZE (wifibox-alpine/socat-1.7.4.2-r0.apk) = 69693
+SHA256 (wifibox-alpine/wpa_passthru-0.1.1-r0.apk) = bf44c8a8dc83b6b2c90e6aa3e53210b559f93826bb5aac98bb1c4a925b69e0b0
+SIZE (wifibox-alpine/wpa_passthru-0.1.1-r0.apk) = 2807
+SHA256 (wifibox-alpine/wpa_supplicant-2.9-r17.apk) = 282c7bbb22d1d3ec42fbe60773b73c0876893ef2043f64bbde47cdbfa940b567
+SIZE (wifibox-alpine/wpa_supplicant-2.9-r17.apk) = 747042
+SHA256 (wifibox-alpine/broadcom-wl-6.30.223.271-r0.apk) = 5d372281131c0587d9e7de2cbf1e8b2d99f543f00f4090be5cb70c5ea3df2149
+SIZE (wifibox-alpine/broadcom-wl-6.30.223.271-r0.apk) = 1461668
+SHA256 (wifibox-alpine/rtw89-20220421-r0.apk) = 5da0165c41227254d2426d4a75a5072200d6dff4860f995378935b76990ef32f
+SIZE (wifibox-alpine/rtw89-20220421-r0.apk) = 852386
+SHA256 (wifibox-alpine/atmel-firmware-1.3.tar.gz) = f53160b0b4a824754957d8488f1eba68d3c6379d48c563464bd3924e7be19b3d
+SIZE (wifibox-alpine/atmel-firmware-1.3.tar.gz) = 470254
+SHA256 (wifibox-alpine/wl_apsta-3.130.20.0.o) = 7dba610b1d96dd14e901bcbce14cd6ecd1b1ac6f5c0035b0d6b6dc46a7c3ef90
+SIZE (wifibox-alpine/wl_apsta-3.130.20.0.o) = 652866
+SHA256 (wifibox-alpine/broadcom-wl-6.30.163.46.tar.bz2) = a07c3b6b277833c7dbe61daa511f908cd66c5e2763eb7a0859abc36cd9335c2d
+SIZE (wifibox-alpine/broadcom-wl-6.30.163.46.tar.bz2) = 7684610
+SHA256 (wifibox-alpine/eecbb49920732b9b364f15c1ef0066342544b22b.zip) = 63d17bd14b28167c3b18865525097ba3669725b03952f08770a515c64584e062
+SIZE (wifibox-alpine/eecbb49920732b9b364f15c1ef0066342544b22b.zip) = 4434101
+SHA256 (wifibox-alpine/pgj-freebsd-wifibox-alpine-dac84c054786b6eb6f329662748d9a199b05f2df_GH0.tar.gz) = e13eb1761706cd417d94de10009257fbb828f6d8aee68c27b6d5d7631344f4e1
+SIZE (wifibox-alpine/pgj-freebsd-wifibox-alpine-dac84c054786b6eb6f329662748d9a199b05f2df_GH0.tar.gz) = 126093
diff --git a/net/wifibox-alpine/flavors.mk b/net/wifibox-alpine/flavors.mk
new file mode 100644
index 000000000000..95a088698aaa
--- /dev/null
+++ b/net/wifibox-alpine/flavors.mk
@@ -0,0 +1,3 @@
+_FLAVORS=	ath10k ath11k brcm iwlwifi mediatek marvell rt61 rtlwifi rtw88
+FLAVORS=	default ${_FLAVORS}
+FLAVOR?=	default
diff --git a/net/wifibox-alpine/pkg-descr b/net/wifibox-alpine/pkg-descr
new file mode 100644
index 000000000000..05b372526699
--- /dev/null
+++ b/net/wifibox-alpine/pkg-descr
@@ -0,0 +1,9 @@
+The implementation of the Wifibox embedded wireless router is based on
+the use of a Linux-based guest operating system which can communicate
+with the host's wireless network card on behalf of the host.  In order
+to meet the requirements, this has to be a system with a low resource
+footprint and easy to manage.  This is derived from Alpine Linux,
+which is an actively maintained, security-oriented, lightweight
+distribution, based on musl libc and BusyBox.
+
+WWW: https://github.com/pgj/freebsd-wifibox-alpine
diff --git a/net/wifibox/pkg-plist b/net/wifibox-alpine/pkg-plist
similarity index 60%
rename from net/wifibox/pkg-plist
rename to net/wifibox-alpine/pkg-plist
index 5330a10a838d..17f2471b4a92 100644
--- a/net/wifibox/pkg-plist
+++ b/net/wifibox-alpine/pkg-plist
@@ -1,26 +1,18 @@
-@sample etc/wifibox/bhyve.conf.sample
-@sample etc/wifibox/core.conf.sample
 @sample etc/wifibox/interfaces.conf.sample
 @sample etc/wifibox/udhcpd.conf.sample
-@sample etc/wifibox/wpa_ctrl.conf.sample
-@sample etc/wifibox/wpa_supplicant/wpa_supplicant.conf.sample
-@sample etc/devd/wifibox.conf.sample
-etc/rc.d/wifibox
 man/man5/wifibox-alpine.5.gz
-man/man5/wifibox-guest.5.gz
-man/man8/wifibox.8.gz
-sbin/wifibox
-share/wifibox/device.map
-share/wifibox/grub.cfg
+share/wifibox/bhyve.conf
 share/wifibox/disk.img
+share/wifibox/grub.cfg
+share/wifibox/vmlinuz
 /var/run/wifibox/appliance/lock
 /var/run/wifibox/appliance/run
-@preexec /usr/bin/touch /var/log/wifibox.log
-@preunexec /bin/rm -f /var/log/wifibox.log
-@preunexec /usr/bin/find /var/run/wifibox -type f -delete
+/var/run/wifibox/appliance/spool/cron/crontabs
+/var/run/wifibox/appliance/spool/mail
+@dir /var/run/wifibox/appliance/cache/apk
+@dir /var/run/wifibox/appliance/cache/misc
 @dir /var/run/wifibox/appliance/cache
 @dir /var/run/wifibox/appliance/empty
-@dir /var/run/wifibox/appliance/lib/apk
 @dir /var/run/wifibox/appliance/lib/iptables
 @dir /var/run/wifibox/appliance/lib/misc
 @dir /var/run/wifibox/appliance/lib/udhcpd
diff --git a/net/wifibox-core/Makefile b/net/wifibox-core/Makefile
new file mode 100644
index 000000000000..1657ac495c25
--- /dev/null
+++ b/net/wifibox-core/Makefile
@@ -0,0 +1,58 @@
+PORTNAME=	wifibox-core
+PORTVERSION=	0.9.0
+CATEGORIES=	net
+
+MAINTAINER=	pali.gabor@gmail.com
+COMMENT=	Wifibox core functionality
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+ONLY_FOR_ARCHS=	amd64
+
+RUN_DEPENDS=	grub2-bhyve>0:sysutils/grub2-bhyve
+
+OPTIONS_DEFINE=			BHYVE_PLUS WPA_PASSTHRU
+OPTIONS_DEFAULT=		WPA_PASSTHRU
+OPTIONS_EXCLUDE_FreeBSD_12=	BHYVE_PLUS
+
+BHYVE_PLUS_DESC=		Use bhyve+ (experimental)
+WPA_PASSTHRU_DESC=		WPA Supplicant pass-through
+
+WPA_PASSTHRU_RUN_DEPENDS=	socat>0:net/socat
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MBHYVE_PLUS} || (${OSVERSION} < 1300000)
+RUN_DEPENDS+=	bhyve+>0:sysutils/bhyve+
+_BHYVE_PLUS=	yes
+.endif
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	pgj
+GH_PROJECT=	freebsd-wifibox
+
+NO_BUILD=	yes
+MAKE_ARGS+=	GUEST_ROOT=${LOCALBASE}/share/wifibox \
+		GUEST_MAN=${LOCALBASE}/man/man5/wifibox-alpine.5.gz \
+		VERSION=${PORTVERSION}
+.if defined(_BHYVE_PLUS)
+MAKE_ARGS+=	BHYVE=${LOCALBASE}/sbin/bhyve \
+		BHYVECTL=${LOCALBASE}/sbin/bhyvectl \
+		VMM_KO=${KMODDIR}/vmm.ko
+.endif
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MWPA_PASSTHRU}
+_WPA_PASSTHRU_ENABLED=	yes
+.else
+_WPA_PASSTHRU_ENABLED=	no
+.endif
+
+post-install:
+	${SED} -I '' -E \
+		's%^enabled=no$$%enabled=${_WPA_PASSTHRU_ENABLED}%' \
+		${STAGEDIR}${PREFIX}/etc/wifibox/wpa_ctrl.conf.sample
+
+.include <bsd.port.mk>
diff --git a/net/wifibox-core/distinfo b/net/wifibox-core/distinfo
new file mode 100644
index 000000000000..091277b0f550
--- /dev/null
+++ b/net/wifibox-core/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1651599935
+SHA256 (pgj-freebsd-wifibox-0.9.0_GH0.tar.gz) = c16768ec0f7803590dea65902d48ab7e6463c9c0177f18c99925ec75075219ed
+SIZE (pgj-freebsd-wifibox-0.9.0_GH0.tar.gz) = 15370
diff --git a/net/wifibox-core/pkg-descr b/net/wifibox-core/pkg-descr
new file mode 100644
index 000000000000..aa0df235e6e8
--- /dev/null
+++ b/net/wifibox-core/pkg-descr
@@ -0,0 +1,4 @@
+Core routines of Wifibox that are responsible for implementing the
+orchestration of bhyve and other utilities.
+
+WWW: https://github.com/pgj/freebsd-wifibox
diff --git a/net/wifibox-core/pkg-plist b/net/wifibox-core/pkg-plist
new file mode 100644
index 000000000000..06b66f76eb36
--- /dev/null
+++ b/net/wifibox-core/pkg-plist
@@ -0,0 +1,11 @@
+@sample etc/wifibox/bhyve.conf.sample
+@sample etc/wifibox/core.conf.sample
+@sample etc/wifibox/wpa_ctrl.conf.sample
+@sample etc/wifibox/wpa_supplicant/wpa_supplicant.conf.sample
+@sample etc/devd/wifibox.conf.sample
+etc/rc.d/wifibox
+man/man5/wifibox-guest.5.gz
+man/man8/wifibox.8.gz
+sbin/wifibox
+@preexec /usr/bin/touch /var/log/wifibox.log
+@preunexec /bin/rm -f /var/log/wifibox.log
diff --git a/net/wifibox/Makefile b/net/wifibox/Makefile
index 055aeb690eae..b892390bf154 100644
--- a/net/wifibox/Makefile
+++ b/net/wifibox/Makefile
@@ -1,66 +1,25 @@
 PORTNAME=	wifibox
-PORTVERSION=	0.8.3
+PORTVERSION=	1.0.0
 CATEGORIES=	net
 
 MAINTAINER=	pali.gabor@gmail.com
 COMMENT=	Wireless card driver via virtualized Linux
 
 LICENSE=	BSD2CLAUSE
-LICENSE_FILE=	${WRKSRC}/LICENSE
 
 ONLY_FOR_ARCHS=	amd64
-EXTRACT_ONLY=	${_DISTFILES:N*.img.xz}
 
-RUN_DEPENDS=	grub2-bhyve>0:sysutils/grub2-bhyve
+RUN_DEPENDS=	wifibox-core>0:net/wifibox-core
 
-OPTIONS_DEFINE=			BHYVE_PLUS WPA_PASSTHRU
-OPTIONS_DEFAULT=		WPA_PASSTHRU
-OPTIONS_EXCLUDE_FreeBSD_12=	BHYVE_PLUS
+USES=	metaport
 
-BHYVE_PLUS_DESC=		Use bhyve+ (experimental)
-WPA_PASSTHRU_DESC=		WPA Supplicant pass-through
+.include "${.CURDIR}/../wifibox-alpine/flavors.mk"
 
-WPA_PASSTHRU_RUN_DEPENDS=	socat>0:net/socat
+.for flavor in ${_FLAVORS}
+${flavor}_RUN_DEPENDS=         wifibox-alpine-${flavor}>0:net/wifibox-alpine@${flavor}
+${flavor}_PKGNAMESUFFIX=       -${flavor}
+.endfor
 
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MBHYVE_PLUS} || (${OSVERSION} < 1300000)
-RUN_DEPENDS+=	bhyve+>0:sysutils/bhyve+
-_BHYVE_PLUS=	yes
-.endif
-
-USE_GITHUB=	yes
-GH_ACCOUNT=	pgj
-GH_PROJECT=	freebsd-wifibox freebsd-wifibox-image:image
-GH_TAGNAME=	${PORTVERSION}
-GH_TAGNAME+=	${IMAGE_VERSION}:image
-
-IMAGE_VERSION=	snapshot-20220428
-IMAGE_FILE=	freebsd-wifibox-appliance.${IMAGE_VERSION}.img.xz
-IMAGE_MAN=	wifibox-alpine.5
-
-MASTER_SITES+=	https://github.com/pgj/freebsd-wifibox-image/releases/download/${IMAGE_VERSION}/
-DISTFILES+=	${IMAGE_FILE}
-
-NO_BUILD=	yes
-MAKE_ARGS+=	IMGXZ=${DISTDIR}/${IMAGE_FILE} \
-		IMGMAN=${WRKSRC_image}/man/${IMAGE_MAN} \
-		VERSION=${PORTVERSION}
-.if defined(_BHYVE_PLUS)
-MAKE_ARGS+=	BHYVE=${LOCALBASE}/sbin/bhyve \
-		BHYVECTL=${LOCALBASE}/sbin/bhyvectl \
-		VMM_KO=${KMODDIR}/vmm.ko
-.endif
-
-.if ${PORT_OPTIONS:MWPA_PASSTHRU}
-_WPA_PASSTHRU_ENABLED= yes
-.else
-_WPA_PASSTHRU_ENABLED= no
-.endif
-
-post-install:
-	${SED} -I '' -E \
-		's%^enabled=no$$%enabled=${_WPA_PASSTHRU_ENABLED}%' \
-		${STAGEDIR}${PREFIX}/etc/wifibox/wpa_ctrl.conf.sample
+default_RUN_DEPENDS=           wifibox-alpine>0:net/wifibox-alpine
 
 .include <bsd.port.mk>
diff --git a/net/wifibox/distinfo b/net/wifibox/distinfo
deleted file mode 100644
index e831f7194d90..000000000000
--- a/net/wifibox/distinfo
+++ /dev/null
@@ -1,7 +0,0 @@
-TIMESTAMP = 1651104213
-SHA256 (freebsd-wifibox-appliance.snapshot-20220428.img.xz) = bdf19bcf3d162c07f524466819b51594d295bf516da5080b0c88402b7f25f03b
-SIZE (freebsd-wifibox-appliance.snapshot-20220428.img.xz) = 131621268
-SHA256 (pgj-freebsd-wifibox-0.8.3_GH0.tar.gz) = 58e5090893136d5618769cab4e8a3a1d5a43361cae03384044695ee1efeea25f
-SIZE (pgj-freebsd-wifibox-0.8.3_GH0.tar.gz) = 15735
-SHA256 (pgj-freebsd-wifibox-image-snapshot-20220428_GH0.tar.gz) = e5be1f4271b557be8bd1222d80a057cc0d7287e867b3d6f4dfc75de1bcf1378c
-SIZE (pgj-freebsd-wifibox-image-snapshot-20220428_GH0.tar.gz) = 5745