git: bc7829212d15 - main - sysutils/cpu-microcode-*: Reorganize CPU microcode ports

From: Joseph Mingrone <jrm_at_FreeBSD.org>
Date: Wed, 16 Aug 2023 17:06:52 UTC
The branch main has been updated by jrm:

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

commit bc7829212d153aeff69b439d08e2e3001ef88ba3
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2023-08-10 16:57:31 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2023-08-16 17:06:40 +0000

    sysutils/cpu-microcode-*: Reorganize CPU microcode ports
    
    Prior to this update, sysutils/devcpu-data, which only contained an RC
    script, had run dependencies on the AMD and Intel microcode ports.  This
    made it cumbersome to have just the AMD or just the Intel microcode
    ports installed.  With this change, the microcode ports now depend on
    the RC script.
    
    Other changes:
    
    - Use more intuitive port names: cpu-microcode, cpu-microcode-amd,
      cpu-microcode-intel, and cpu-microcode-rc.
    - Add the metaport, cpu-microcode, which pulls in all related ports.
    - Pet portclippy/portfmt
    
    Reviewed by:    lwhsu, markj
    Approved by:    sbruno (maintainer)
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D41406
---
 MOVED                                              |  3 ++
 sysutils/Makefile                                  |  7 ++--
 .../Makefile                                       | 10 +++---
 sysutils/cpu-microcode-amd/distinfo                | 11 +++++++
 .../files/LICENSE.amd-ucode                        |  0
 .../pkg-descr                                      |  0
 sysutils/cpu-microcode-amd/pkg-message             |  8 +++++
 .../Makefile                                       |  6 ++--
 .../distinfo                                       |  0
 .../files/LICENSE                                  |  0
 .../files/Makefile                                 |  0
 .../files/ucode-split.c                            |  0
 .../pkg-descr                                      |  0
 sysutils/cpu-microcode-intel/pkg-message           |  8 +++++
 .../pkg-plist                                      |  0
 sysutils/cpu-microcode-rc/Makefile                 | 27 ++++++++++++++++
 .../files/microcode_update.in                      |  0
 .../files/pkg-message.in                           | 19 ++++++-----
 .../{devcpu-data => cpu-microcode-rc}/pkg-descr    |  0
 sysutils/cpu-microcode/Makefile                    | 16 ++++++++++
 sysutils/cpu-microcode/pkg-descr                   |  4 +++
 sysutils/devcpu-data-amd/distinfo                  | 11 -------
 sysutils/devcpu-data-amd/pkg-message               |  7 ----
 sysutils/devcpu-data-intel/pkg-message             |  7 ----
 sysutils/devcpu-data/Makefile                      | 37 ----------------------
 sysutils/devcpu-data/distinfo                      |  1 -
 26 files changed, 100 insertions(+), 82 deletions(-)

diff --git a/MOVED b/MOVED
index f89d5f3491ce..09dc63705d9b 100644
--- a/MOVED
+++ b/MOVED
@@ -7781,3 +7781,6 @@ lang/go118||2023-08-04|Upstream support ended
 devel/hhdate|devel/date|2023-08-05|Dedup library
 x11-toolkits/wlinfo||2023-08-10|Redundant with wayland-info from graphics/wayland-utils
 www/bareos18-webui|www/bareos19-webui|2023-08-16|Has expired
+sysutils/devcpu-data-amd|sysutils/cpu-microcode-amd|2023-08-16|Reorganize CPU microcode ports
+sysutils/devcpu-data-intel|sysutils/cpu-microcode-intel|2023-08-16|Reorganize CPU microcode ports
+sysutils/devcpu-data|sysutils/cpu-microcode-rc|2023-08-16|Reorganize CPU microcode ports
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 34fb475d7f03..95fdf00d8e58 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -234,6 +234,10 @@
     SUBDIR += coreos-ct
     SUBDIR += coreutils
     SUBDIR += cpdup
+    SUBDIR += cpu-microcode
+    SUBDIR += cpu-microcode-amd
+    SUBDIR += cpu-microcode-intel
+    SUBDIR += cpu-microcode-rc
     SUBDIR += cpu-x
     SUBDIR += cpuburn
     SUBDIR += cpufetch
@@ -275,9 +279,6 @@
     SUBDIR += deltup
     SUBDIR += desktop-installer
     SUBDIR += detox
-    SUBDIR += devcpu-data
-    SUBDIR += devcpu-data-amd
-    SUBDIR += devcpu-data-intel
     SUBDIR += devctl-jail-kmod
     SUBDIR += devd-mount
     SUBDIR += devedeng
diff --git a/sysutils/devcpu-data-amd/Makefile b/sysutils/cpu-microcode-amd/Makefile
similarity index 87%
rename from sysutils/devcpu-data-amd/Makefile
rename to sysutils/cpu-microcode-amd/Makefile
index d92dae02950d..6c9cf47fb999 100644
--- a/sysutils/devcpu-data-amd/Makefile
+++ b/sysutils/cpu-microcode-amd/Makefile
@@ -1,8 +1,8 @@
-PORTNAME=	data
+PORTNAME=	microcode
 PORTVERSION=	20230724
 CATEGORIES=	sysutils
 MASTER_SITES=	https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/amd-ucode/
-PKGNAMEPREFIX=	devcpu-
+PKGNAMEPREFIX=	cpu-
 PKGNAMESUFFIX=	-amd
 DISTFILES=	microcode_amd.bin?id=${_REV} \
 		microcode_amd_fam15h.bin?id=${_REV} \
@@ -12,7 +12,7 @@ DISTFILES=	microcode_amd.bin?id=${_REV} \
 DIST_SUBDIR=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
 
 MAINTAINER=	sbruno@FreeBSD.org
-COMMENT=	AMD CPUs microcode updates
+COMMENT=	AMD CPU microcode updates
 
 LICENSE=	EULA
 LICENSE_NAME=	Advanced Micro Devices License Agreement
@@ -21,13 +21,15 @@ LICENSE_PERMS=	dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
 
 ONLY_FOR_ARCHS=	amd64 i386
 
+RUN_DEPENDS=	${LOCALBASE}/etc/rc.d/microcode_update:sysutils/cpu-microcode-rc
+
+DATADIR=	${PREFIX}/share/cpucontrol
 EXTRACT_CMD=	${CP}
 EXTRACT_BEFORE_ARGS=	# empty
 EXTRACT_AFTER_ARGS=	.
 NO_ARCH=	yes
 NO_BUILD=	yes
 
-DATADIR=	${PREFIX}/share/cpucontrol
 NO_WRKSUBDIR=	yes
 PLIST_FILES=	${DISTFILES:S/^/${DATADIR}\//g:C/\?.*//}
 
diff --git a/sysutils/cpu-microcode-amd/distinfo b/sysutils/cpu-microcode-amd/distinfo
new file mode 100644
index 000000000000..63bc387788f3
--- /dev/null
+++ b/sysutils/cpu-microcode-amd/distinfo
@@ -0,0 +1,11 @@
+TIMESTAMP = 1691693284
+SHA256 (cpu-microcode-amd/microcode_amd.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 8a9d9e8b788e31e61cddc03cb1eeab5db99e0f667128943ff0780e6437d2e43e
+SIZE (cpu-microcode-amd/microcode_amd.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 12684
+SHA256 (cpu-microcode-amd/microcode_amd_fam15h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 9d4a668410e72a4bdb86dc23e4261eca04daa83456ada02504115223f356981a
+SIZE (cpu-microcode-amd/microcode_amd_fam15h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 7876
+SHA256 (cpu-microcode-amd/microcode_amd_fam16h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = e02ad653b39c975d6c52674b50f23727bb6706bab7b4e5b391a4ce229e7ff121
+SIZE (cpu-microcode-amd/microcode_amd_fam16h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 3510
+SHA256 (cpu-microcode-amd/microcode_amd_fam17h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 1eeaf4c86fb72a0f0e9d4ff28d3213d264ecb47a8dce8bcbd85addd0cfd999bb
+SIZE (cpu-microcode-amd/microcode_amd_fam17h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 12924
+SHA256 (cpu-microcode-amd/microcode_amd_fam19h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 2e503e1381154297e30f7fdc83a639d81b02196ff965f63427652709423fdcc4
+SIZE (cpu-microcode-amd/microcode_amd_fam19h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 16804
diff --git a/sysutils/devcpu-data-amd/files/LICENSE.amd-ucode b/sysutils/cpu-microcode-amd/files/LICENSE.amd-ucode
similarity index 100%
rename from sysutils/devcpu-data-amd/files/LICENSE.amd-ucode
rename to sysutils/cpu-microcode-amd/files/LICENSE.amd-ucode
diff --git a/sysutils/devcpu-data-amd/pkg-descr b/sysutils/cpu-microcode-amd/pkg-descr
similarity index 100%
rename from sysutils/devcpu-data-amd/pkg-descr
rename to sysutils/cpu-microcode-amd/pkg-descr
diff --git a/sysutils/cpu-microcode-amd/pkg-message b/sysutils/cpu-microcode-amd/pkg-message
new file mode 100644
index 000000000000..a7d69e95a216
--- /dev/null
+++ b/sysutils/cpu-microcode-amd/pkg-message
@@ -0,0 +1,8 @@
+[
+{ type: install
+  message: <<EOM
+Refer to the cpu-microcode-rc installation notes to enable AMD microcode
+updates.
+EOM
+}
+]
diff --git a/sysutils/devcpu-data-intel/Makefile b/sysutils/cpu-microcode-intel/Makefile
similarity index 91%
rename from sysutils/devcpu-data-intel/Makefile
rename to sysutils/cpu-microcode-intel/Makefile
index 0156e4208e24..3bf75e45b495 100644
--- a/sysutils/devcpu-data-intel/Makefile
+++ b/sysutils/cpu-microcode-intel/Makefile
@@ -1,8 +1,8 @@
-PORTNAME=	data
+PORTNAME=	microcode
 DISTVERSIONPREFIX=	microcode-
 DISTVERSION=	20230808
 CATEGORIES=	sysutils
-PKGNAMEPREFIX=	devcpu-
+PKGNAMEPREFIX=	cpu-
 PKGNAMESUFFIX=	-intel
 
 MAINTAINER=	sbruno@FreeBSD.org
@@ -16,6 +16,8 @@ LICENSE_PERMS=	dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
 
 ONLY_FOR_ARCHS=	amd64 i386
 
+RUN_DEPENDS=	${LOCALBASE}/etc/rc.d/microcode_update:sysutils/cpu-microcode-rc
+
 USES=		cpe
 CPE_PART=	o
 CPE_VENDOR=	intel
diff --git a/sysutils/devcpu-data-intel/distinfo b/sysutils/cpu-microcode-intel/distinfo
similarity index 100%
rename from sysutils/devcpu-data-intel/distinfo
rename to sysutils/cpu-microcode-intel/distinfo
diff --git a/sysutils/devcpu-data-intel/files/LICENSE b/sysutils/cpu-microcode-intel/files/LICENSE
similarity index 100%
rename from sysutils/devcpu-data-intel/files/LICENSE
rename to sysutils/cpu-microcode-intel/files/LICENSE
diff --git a/sysutils/devcpu-data-intel/files/Makefile b/sysutils/cpu-microcode-intel/files/Makefile
similarity index 100%
rename from sysutils/devcpu-data-intel/files/Makefile
rename to sysutils/cpu-microcode-intel/files/Makefile
diff --git a/sysutils/devcpu-data-intel/files/ucode-split.c b/sysutils/cpu-microcode-intel/files/ucode-split.c
similarity index 100%
rename from sysutils/devcpu-data-intel/files/ucode-split.c
rename to sysutils/cpu-microcode-intel/files/ucode-split.c
diff --git a/sysutils/devcpu-data-intel/pkg-descr b/sysutils/cpu-microcode-intel/pkg-descr
similarity index 100%
rename from sysutils/devcpu-data-intel/pkg-descr
rename to sysutils/cpu-microcode-intel/pkg-descr
diff --git a/sysutils/cpu-microcode-intel/pkg-message b/sysutils/cpu-microcode-intel/pkg-message
new file mode 100644
index 000000000000..cb644c546b28
--- /dev/null
+++ b/sysutils/cpu-microcode-intel/pkg-message
@@ -0,0 +1,8 @@
+[
+{ type: install
+  message: <<EOM
+Refer to the cpu-microcode-rc installation notes to enable Intel
+microcode updates.
+EOM
+}
+]
diff --git a/sysutils/devcpu-data-intel/pkg-plist b/sysutils/cpu-microcode-intel/pkg-plist
similarity index 100%
rename from sysutils/devcpu-data-intel/pkg-plist
rename to sysutils/cpu-microcode-intel/pkg-plist
diff --git a/sysutils/cpu-microcode-rc/Makefile b/sysutils/cpu-microcode-rc/Makefile
new file mode 100644
index 000000000000..84af71889f20
--- /dev/null
+++ b/sysutils/cpu-microcode-rc/Makefile
@@ -0,0 +1,27 @@
+PORTNAME=	microcode
+PORTVERSION=	1.0
+CATEGORIES=	sysutils
+PKGNAMEPREFIX=	cpu-
+PKGNAMESUFFIX=	-rc
+MASTER_SITES=	# none
+DISTFILES=	# none
+EXTRACT_ONLY=	# none
+
+MAINTAINER=	sbruno@FreeBSD.org
+COMMENT=	RC script for CPU microcode updates
+
+LICENSE=	BSD2CLAUSE
+
+ONLY_FOR_ARCHS=	amd64 i386
+
+USE_RC_SUBR=	microcode_update
+
+DATADIR=	${PREFIX}/share/cpucontrol
+NO_ARCH=	yes
+NO_BUILD=	yes
+NO_INSTALL=	yes
+SUB_FILES=	pkg-message
+
+NO_WRKSUBDIR=	yes
+
+.include <bsd.port.mk>
diff --git a/sysutils/devcpu-data/files/microcode_update.in b/sysutils/cpu-microcode-rc/files/microcode_update.in
similarity index 100%
rename from sysutils/devcpu-data/files/microcode_update.in
rename to sysutils/cpu-microcode-rc/files/microcode_update.in
diff --git a/sysutils/devcpu-data/files/pkg-message.in b/sysutils/cpu-microcode-rc/files/pkg-message.in
similarity index 65%
rename from sysutils/devcpu-data/files/pkg-message.in
rename to sysutils/cpu-microcode-rc/files/pkg-message.in
index c2860f035372..8984694e5476 100644
--- a/sysutils/devcpu-data/files/pkg-message.in
+++ b/sysutils/cpu-microcode-rc/files/pkg-message.in
@@ -1,15 +1,14 @@
 [
 { type: install
   message: <<EOM
-This port includes an RC script, which is one of two methods to update the
-CPU microcode on a FreeBSD system.
+This port includes an RC script, which is one of two methods to update
+the CPU microcode on a FreeBSD system.
 
-1. The first method, which does not require the RC script included in this
-   port is currently only supported on FreeBSD 12.0 or later and Intel i386
-   and amd64 processors.  It is the preferred method when available because
-   it ensures that any CPU features introduced by a microcode update are
-   visible to the kernel by applying the update before the kernel performs
-   CPU feature detection.
+1. The first method does not require the RC script included here and is
+   only supported with Intel processors.  It is the preferred method,
+   because it ensures that any CPU features introduced by a microcode
+   update are visible to the kernel by applying the update before the
+   kernel performs CPU feature detection.
 
    To enable updates using the first method, add the following lines to
    /boot/loader.conf:
@@ -20,8 +19,8 @@ CPU microcode on a FreeBSD system.
    The microcode update will be loaded when the system is rebooted.
 
 
-2. The second method, which uses the RC script included in this port can
-   be enabled by adding the following line to /etc/rc.conf:
+2. The second method, which uses the RC script included here, can be
+   enabled by adding the following line to /etc/rc.conf:
 
    microcode_update_enable="YES"
 
diff --git a/sysutils/devcpu-data/pkg-descr b/sysutils/cpu-microcode-rc/pkg-descr
similarity index 100%
rename from sysutils/devcpu-data/pkg-descr
rename to sysutils/cpu-microcode-rc/pkg-descr
diff --git a/sysutils/cpu-microcode/Makefile b/sysutils/cpu-microcode/Makefile
new file mode 100644
index 000000000000..5e7635129cdf
--- /dev/null
+++ b/sysutils/cpu-microcode/Makefile
@@ -0,0 +1,16 @@
+PORTNAME=	microcode
+PORTVERSION=	1.0
+CATEGORIES=	sysutils
+PKGNAMEPREFIX=	cpu-
+
+MAINTAINER=	sbruno@FreeBSD.org
+COMMENT=	Meta-package for CPU microcode updates
+
+ONLY_FOR_ARCHS=	amd64 i386
+
+RUN_DEPENDS=	${LOCALBASE}/share/cpucontrol/microcode_amd.bin:sysutils/cpu-microcode-amd \
+		/boot/firmware/intel-ucode.bin:sysutils/cpu-microcode-intel
+
+USES=		metaport
+
+.include <bsd.port.mk>
diff --git a/sysutils/cpu-microcode/pkg-descr b/sysutils/cpu-microcode/pkg-descr
new file mode 100644
index 000000000000..c33ddc2e7b1e
--- /dev/null
+++ b/sysutils/cpu-microcode/pkg-descr
@@ -0,0 +1,4 @@
+The cpu-microcode meta-package depends on microcode update packages
+available for all CPU vendors.  Users who wish to install CPU microcode
+updates from a specific vendor can directly install cpu-microcode-amd or
+cpu-microcode-intel.
diff --git a/sysutils/devcpu-data-amd/distinfo b/sysutils/devcpu-data-amd/distinfo
deleted file mode 100644
index ce7f67a2e0d0..000000000000
--- a/sysutils/devcpu-data-amd/distinfo
+++ /dev/null
@@ -1,11 +0,0 @@
-TIMESTAMP = 1690217806
-SHA256 (devcpu-data-amd/microcode_amd.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 8a9d9e8b788e31e61cddc03cb1eeab5db99e0f667128943ff0780e6437d2e43e
-SIZE (devcpu-data-amd/microcode_amd.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 12684
-SHA256 (devcpu-data-amd/microcode_amd_fam15h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 9d4a668410e72a4bdb86dc23e4261eca04daa83456ada02504115223f356981a
-SIZE (devcpu-data-amd/microcode_amd_fam15h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 7876
-SHA256 (devcpu-data-amd/microcode_amd_fam16h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = e02ad653b39c975d6c52674b50f23727bb6706bab7b4e5b391a4ce229e7ff121
-SIZE (devcpu-data-amd/microcode_amd_fam16h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 3510
-SHA256 (devcpu-data-amd/microcode_amd_fam17h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 1eeaf4c86fb72a0f0e9d4ff28d3213d264ecb47a8dce8bcbd85addd0cfd999bb
-SIZE (devcpu-data-amd/microcode_amd_fam17h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 12924
-SHA256 (devcpu-data-amd/microcode_amd_fam19h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 2e503e1381154297e30f7fdc83a639d81b02196ff965f63427652709423fdcc4
-SIZE (devcpu-data-amd/microcode_amd_fam19h.bin?id=0bc3126c9cfa0b8c761483215c25382f831a7c6f) = 16804
diff --git a/sysutils/devcpu-data-amd/pkg-message b/sysutils/devcpu-data-amd/pkg-message
deleted file mode 100644
index 8d00883e6b4f..000000000000
--- a/sysutils/devcpu-data-amd/pkg-message
+++ /dev/null
@@ -1,7 +0,0 @@
-[
-{ type: install
-  message: <<EOM
-Refer to the devcpu-data installation notes to enable AMD microcode updates.
-EOM
-}
-]
diff --git a/sysutils/devcpu-data-intel/pkg-message b/sysutils/devcpu-data-intel/pkg-message
deleted file mode 100644
index 3c06c67759de..000000000000
--- a/sysutils/devcpu-data-intel/pkg-message
+++ /dev/null
@@ -1,7 +0,0 @@
-[
-{ type: install
-  message: <<EOM
-Refer to the devcpu-data installation notes to enable Intel microcode updates.
-EOM
-}
-]
diff --git a/sysutils/devcpu-data/Makefile b/sysutils/devcpu-data/Makefile
deleted file mode 100644
index b8f7e54f2af0..000000000000
--- a/sysutils/devcpu-data/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-PORTNAME=	data
-PORTVERSION=	20230617
-PORTREVISION=	1
-CATEGORIES=	sysutils
-MASTER_SITES=	# none
-PKGNAMEPREFIX=	devcpu-
-DISTFILES=	# none
-EXTRACT_ONLY=	# none
-
-MAINTAINER=	sbruno@FreeBSD.org
-COMMENT=	AMD and Intel CPUs microcode updates
-
-LICENSE=	BSD2CLAUSE
-
-ONLY_FOR_ARCHS=	amd64 i386
-
-USE_RC_SUBR=	microcode_update
-
-DATADIR=	${PREFIX}/share/cpucontrol
-NO_ARCH=	yes
-NO_BUILD=	yes
-NO_INSTALL=	yes
-SUB_FILES=	pkg-message
-
-NO_WRKSUBDIR=	yes
-
-OPTIONS_DEFAULT=	AMD INTEL
-OPTIONS_GROUP=		VENDOR
-OPTIONS_GROUP_VENDOR=	AMD INTEL
-
-AMD_DESC=	Depend on sysutils/devcpu-data-amd
-INTEL_DESC=	Depend on sysutils/devcpu-data-intel
-
-AMD_RUN_DEPENDS=	${LOCALBASE}/share/cpucontrol/microcode_amd.bin:sysutils/devcpu-data-amd
-INTEL_RUN_DEPENDS=	/boot/firmware/intel-ucode.bin:sysutils/devcpu-data-intel
-
-.include <bsd.port.mk>
diff --git a/sysutils/devcpu-data/distinfo b/sysutils/devcpu-data/distinfo
deleted file mode 100644
index 50bdb09a4d73..000000000000
--- a/sysutils/devcpu-data/distinfo
+++ /dev/null
@@ -1 +0,0 @@
-TIMESTAMP = 1644363016