On Tue, Jan 02, 2018 at 11:50:10PM +0100, Klemens Nanni wrote:
> Finally 1.0 is there! https://flashrom.org/Flashrom/1.0 lists all
> changes, most notably:
> 
> - "layout support for all read, write and erase commands"
> 
> Only build tested at the moment on my amd64 machine since I won't be
> able to test flash some chips until later this week. We've been using
> 1.0-rc2 successfully during the congress, though.
The final 1.0 release works just fine on my ThinkPad X230 using the
internal programmer. I was able to read, erase and (partially) write
regions to the ROM chip. I also instructed it to read the layout
directly from the chip instead of a file: All successfully, machine
comes up again after power cycling.

More tests for various other programmers and chips are welcome.

> I had to remove -lrt to get clock_gettime() detection working and also
> noted single mode as preffered method in the manual page is it is done
> for various help texts already.
> 
> Switch MASTER_SITES to HTTPS.

Updated diff that now also removes the first of the duplicate error
messages when running with insufficient unprivileges:

        $ flashrom -p internal
        flashrom v1.0 on OpenBSD 6.2 (amd64)
        flashrom is free software, get the source code at https://flashrom.org

        Calibrating delay loop... OK.
        ERROR: Could not get I/O privileges (Operation not permitted).
        You need to be root.
-       If you are root already please set securelevel=-1 in 
/etc/rc.securelevel and
-       reboot, or reboot into single user mode.
        If you are root already, please reboot into single user mode 
(preferred),
        or set sysctl kern.securelevel=-1 in /etc/rc.securelevel.
        Error: Programmer initialization failed.

Feedback?

diff --git a/sysutils/flashrom/Makefile b/sysutils/flashrom/Makefile
index f50a5016891..cb244bc47fe 100644
--- a/sysutils/flashrom/Makefile
+++ b/sysutils/flashrom/Makefile
@@ -4,12 +4,12 @@ ONLY_FOR_ARCHS=       i386 amd64
 
 COMMENT=       flash-ROM programmer for BIOS etc
 
-DISTNAME=      flashrom-0.9.9.1
+DISTNAME=      flashrom-1.0
 EXTRACT_SUFX=  .tar.bz2
 
 CATEGORIES=    sysutils
 
-HOMEPAGE=      http://www.flashrom.org/
+HOMEPAGE=      https://www.flashrom.org/
 
 MAINTAINER=    Stuart Henderson <st...@openbsd.org>
 
@@ -18,7 +18,7 @@ PERMIT_PACKAGE_CDROM= Yes
 
 WANTLIB=       c ftdi usb-1.0 usb z
 
-MASTER_SITES=  http://download.flashrom.org/releases/
+MASTER_SITES=  https://download.flashrom.org/releases/
 
 # pciutils' libpci.a is linked statically; a patched version is required.
 BUILD_DEPENDS= sysutils/pciutils:patch
diff --git a/sysutils/flashrom/distinfo b/sysutils/flashrom/distinfo
index c37506c1b20..a85ff460bde 100644
--- a/sysutils/flashrom/distinfo
+++ b/sysutils/flashrom/distinfo
@@ -1,2 +1,2 @@
-SHA256 (flashrom-0.9.9.1.tar.bz2) = 
DhRaW5sYyYdSrPD4MpqaJg3fAwq/aHQW2qufBaD1CNA=
-SIZE (flashrom-0.9.9.1.tar.bz2) = 328047
+SHA256 (flashrom-1.0.tar.bz2) = NwL6IVul+1r45UyFLSOYmc+hOJGUweUcsqFwxNyd7mQ=
+SIZE (flashrom-1.0.tar.bz2) = 321693
diff --git a/sysutils/flashrom/patches/patch-Makefile 
b/sysutils/flashrom/patches/patch-Makefile
index 45818f34748..e7d6da9b8d7 100644
--- a/sysutils/flashrom/patches/patch-Makefile
+++ b/sysutils/flashrom/patches/patch-Makefile
@@ -2,10 +2,20 @@ $OpenBSD: patch-Makefile,v 1.2 2017/11/05 12:00:10 sthen Exp $
 
 use patched pciutils.
 
+fix clock_gettime detection.
+
 Index: Makefile
 --- Makefile.orig
 +++ Makefile
-@@ -1082,11 +1082,7 @@ endif
+@@ -1004,7 +1004,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)
+@@ -1082,11 +1081,7 @@ endif
  define LIBPCI_TEST
  /* Avoid a failing test due to libpci header symbol shadowing breakage */
  #define index shadow_workaround_index
@@ -18,7 +28,7 @@ Index: Makefile
  struct pci_access *pacc;
  int main(int argc, char **argv)
  {
-@@ -1101,11 +1097,7 @@ export LIBPCI_TEST
+@@ -1101,11 +1096,7 @@ export LIBPCI_TEST
  define PCI_GET_DEV_TEST
  /* Avoid a failing test due to libpci header symbol shadowing breakage */
  #define index shadow_workaround_index
@@ -31,3 +41,14 @@ Index: Makefile
  struct pci_access *pacc;
  struct pci_dev *dev = {0};
  int main(int argc, char **argv)
+@@ -1358,8 +1349,8 @@ endif
+               ( echo "not found."; echo "UTSNAME := no" >> .features.tmp ) } 
2>>$(BUILD_DETAILS_FILE) | tee -a $(BUILD_DETAILS_FILE)
+       @printf "Checking for clock_gettime support... " | tee -a 
$(BUILD_DETAILS_FILE)
+       @echo "$$CLOCK_GETTIME_TEST" >.featuretest.c
+-      @printf "\nexec: %s\n" "$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -lrt 
.featuretest.c -o .featuretest$(EXEC_SUFFIX)" >>$(BUILD_DETAILS_FILE)
+-      @ { $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -lrt .featuretest.c -o 
.featuretest$(EXEC_SUFFIX) >&2 && \
++      @printf "\nexec: %s\n" "$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) 
.featuretest.c -o .featuretest$(EXEC_SUFFIX)" >>$(BUILD_DETAILS_FILE)
++      @ { $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o 
.featuretest$(EXEC_SUFFIX) >&2 && \
+               ( echo "found."; echo "CLOCK_GETTIME := yes" >>.features.tmp ) 
|| \
+               ( echo "not found."; echo "CLOCK_GETTIME := no" >>.features.tmp 
) } \
+               2>>$(BUILD_DETAILS_FILE) | tee -a $(BUILD_DETAILS_FILE)
diff --git a/sysutils/flashrom/patches/patch-flashrom_8_tmpl 
b/sysutils/flashrom/patches/patch-flashrom_8_tmpl
new file mode 100644
index 00000000000..ba05a5f9d38
--- /dev/null
+++ b/sysutils/flashrom/patches/patch-flashrom_8_tmpl
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: flashrom.8.tmpl
+--- flashrom.8.tmpl.orig
++++ flashrom.8.tmpl
+@@ -1144,7 +1144,7 @@ On OpenBSD, you can obtain raw access permission by se
+ .B "securelevel=-1"
+ in
+ .B "/etc/rc.securelevel"
+-and rebooting, or rebooting into single user mode.
++and rebooting, or rebooting into single user mode (preferred).
+ .SH BUGS
+ Please report any bugs to the
+ .MTOB "flash...@flashrom.org" "flashrom mailing list" .
diff --git a/sysutils/flashrom/patches/patch-hwaccess_c 
b/sysutils/flashrom/patches/patch-hwaccess_c
index 0ebe926fad6..7524ce6585a 100644
--- a/sysutils/flashrom/patches/patch-hwaccess_c
+++ b/sysutils/flashrom/patches/patch-hwaccess_c
@@ -3,10 +3,12 @@ $OpenBSD: patch-hwaccess_c,v 1.2 2017/11/05 12:00:10 sthen 
Exp $
 Index: hwaccess.c
 --- hwaccess.c.orig
 +++ hwaccess.c
-@@ -126,6 +126,8 @@ int rget_io_perms(void)
+@@ -124,8 +124,8 @@ int rget_io_perms(void)
+               msg_perr("ERROR: Could not get I/O privileges (%s).\n", 
strerror(errno));
+               msg_perr("You need to be root.\n");
  #if defined (__OpenBSD__)
-               msg_perr("If you are root already please set securelevel=-1 in 
/etc/rc.securelevel and\n"
-                        "reboot, or reboot into single user mode.\n");
+-              msg_perr("If you are root already please set securelevel=-1 in 
/etc/rc.securelevel and\n"
+-                       "reboot, or reboot into single user mode.\n");
 +              msg_perr("If you are root already, please reboot into single 
user mode (preferred),\n"
 +                       "or set sysctl kern.securelevel=-1 in 
/etc/rc.securelevel.\n");
  #elif defined(__NetBSD__)
diff --git a/sysutils/flashrom/patches/patch-physmap_c 
b/sysutils/flashrom/patches/patch-physmap_c
index 7b5ca19bd05..79758cdc02a 100644
--- a/sysutils/flashrom/patches/patch-physmap_c
+++ b/sysutils/flashrom/patches/patch-physmap_c
@@ -3,7 +3,7 @@ $OpenBSD: patch-physmap_c,v 1.1 2017/05/18 15:29:35 sthen Exp $
 Index: physmap.c
 --- physmap.c.orig
 +++ physmap.c
-@@ -277,9 +277,8 @@ static void *physmap_common(const char *descr, uintptr
+@@ -288,9 +288,8 @@ static void *physmap_common(const char *descr, uintptr
                        msg_perr("disabling the other option unfortunately 
requires a kernel recompile. Sorry!\n");
                }
  #elif defined (__OpenBSD__)

Reply via email to