Thursday, July 24, 2025

flashrom update

is anyone able to do any runtime testing of this flashrom update?

build and 'make test' ok on amd64/aarch64 (I can probably do a test
on an apu2 later)

Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/flashrom/Makefile,v
diff -u -p -r1.24 Makefile
--- Makefile 25 Nov 2024 00:02:32 -0000 1.24
+++ Makefile 24 Jul 2025 16:02:14 -0000
@@ -1,16 +1,18 @@
COMMENT= flash ROM programmer for BIOS etc

-V= 1.2
+SHARED_LIBS += flashrom 0.0 # 0.0
+
+V= 1.6.0
DISTNAME= flashrom-v${V}
PKGNAME= flashrom-${V}
-EXTRACT_SUFX= .tar.bz2
+EXTRACT_SUFX= .tar.xz
# portroach finds flashrom-1.0 but ignores flashrom-v1.0.1+
PORTROACH= limit:^v?(1\.[1-9]|[2-9])
-REVISION= 1

CATEGORIES= sysutils

HOMEPAGE= https://www.flashrom.org/
+SITES= https://download.flashrom.org/releases/

MAINTAINER= Stuart Henderson <stu.ports@spacehopper.org>

@@ -20,31 +22,32 @@ PERMIT_PACKAGE= Yes
COMPILER= base-clang ports-gcc
COMPILER_LANGS= c

-WANTLIB= c ftdi1 usb-1.0 z
-
-SITES= https://download.flashrom.org/releases/
+WANTLIB= c crypto ftdi1 usb-1.0

+MODULES= devel/meson
+BUILD_DEPENDS= devel/cmocka \
+ textproc/py-sphinx
LIB_DEPENDS= devel/libftdi1 \
devel/libusb1
-MAKE_FLAGS+= WARNERROR=no
-FAKE_FLAGS= PREFIX="${TRUEPREFIX}" MANDIR="${TRUEPREFIX}/man"

+# needs a .git directory
+CONFIGURE_ARGS += -Dgenerate_authors_list=disabled
+
+# for pciutils
USE_GMAKE= Yes
-NO_TEST= Yes
+FIX_EXTRACT_PERMISSIONS= Yes

-.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == i386
-# a patched pciutils libpci.a is needed (see patches/patchpci-*)
-BUILD_DEPENDS= sysutils/pciutils:patch
+# a patched pciutils libpci.a is needed (see patches/patchpci-*);
+# also depend on normal libpci for pkg-config files
+BUILD_DEPENDS+= sysutils/pciutils \
+ sysutils/pciutils:patch
MAKE_FLAGS+= LDFLAGS="-L./pciutils/lib"
PATCH_LIST= patchpci-* patch-*

pre-patch:
mv ${WRKDIR}/sysutils/pciutils/pciutils-* ${WRKSRC}/pciutils

-do-configure:
+pre-configure:
${MAKE_PROGRAM} -C ${WRKSRC}/pciutils CC="${CC}" OPT="${CFLAGS}"
-.else
-MAKE_FLAGS+= CONFIG_ENABLE_LIBPCI_PROGRAMMERS=no
-.endif

.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/flashrom/distinfo,v
diff -u -p -r1.6 distinfo
--- distinfo 13 Jun 2020 14:04:52 -0000 1.6
+++ distinfo 24 Jul 2025 16:02:14 -0000
@@ -1,2 +1,2 @@
-SHA256 (flashrom-v1.2.tar.bz2) = 4fjZWIH1pDZd/lh3bOgh387g8Tj3XQ9E+KPNAy2epCs=
-SIZE (flashrom-v1.2.tar.bz2) = 366995
+SHA256 (flashrom-v1.6.0.tar.xz) = i52zmH35tfyB5wGJ0BeQXdX2vh4UEDR/Imh6ttTJRCM=
+SIZE (flashrom-v1.6.0.tar.xz) = 5285920
Index: patches/patch-Makefile
===================================================================
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- patches/patch-Makefile 7 Mar 2022 21:36:54 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,75 +0,0 @@
-- fix arch/endian detection, machine/endian.h includes some asm that
-isn't stripped by upstream's pipeline
-
-- OpenBSD clock_gettime is in libc not librt
-
-- use patched pciutils
-
-Index: Makefile
---- Makefile.orig
-+++ Makefile
-@@ -106,7 +106,7 @@ endif
- # IMPORTANT: The following line must be placed before TARGET_OS is ever used
- # (of course), but should come after any lines setting CC because the line
- # below uses CC itself.
--override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
-+override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"' | tail -1))
-
- ifeq ($(TARGET_OS), Darwin)
- override CPPFLAGS += -I/opt/local/include -I/usr/local/include
-@@ -421,8 +421,8 @@ endif
- # IMPORTANT: The following line must be placed before ARCH is ever used
- # (of course), but should come after any lines setting CC because the line
- # below uses CC itself.
--override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
--override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | grep -v '^\#'))
-+override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"' | tail -1))
-+override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | grep -v '^\#' | tail -1))
-
- # Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
- ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
-@@ -1120,7 +1120,6 @@ FEATURE_CFLAGS += $(call debug_shell,grep -q "UTSNAME
- FEATURE_LIBS += $(call debug_shell,grep -q "NEEDLIBZ := yes" .libdeps && printf "%s" "-lz")
-
- FEATURE_CFLAGS += $(call debug_shell,grep -q "CLOCK_GETTIME := yes" .features && printf "%s" "-D'HAVE_CLOCK_GETTIME=1'")
--FEATURE_LIBS += $(call debug_shell,grep -q "CLOCK_GETTIME := yes" .features && printf "%s" "-lrt")
-
- LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
- OBJS = $(CLI_OBJS) $(LIBFLASHROM_OBJS)
-@@ -1198,11 +1197,7 @@ endif
- define LIBPCI_TEST
- /* Avoid a failing test due to libpci header symbol shadowing breakage */
- #define index shadow_workaround_index
--#if !defined __NetBSD__
--#include <pci/pci.h>
--#else
--#include <pciutils/pci.h>
--

No comments:

Post a Comment