forked from pool/flashrom
Accepting request 990902 from home:mgorse:branches:hardware
- Switch to meson - Add flashrom-install-man-file.patch: install the man file when using meson. - Add flashrom-j-link-spi.patch: Add missing meson option for J-Link SPI. - Drop fix_aarch64.patch: no longer relevant. - Package the library and headers. OBS-URL: https://build.opensuse.org/request/show/990902 OBS-URL: https://build.opensuse.org/package/show/hardware/flashrom?expand=0&rev=45
This commit is contained in:
parent
4cd4fee32e
commit
69c6da06cc
@ -1,91 +0,0 @@
|
|||||||
From da6b3b70cb852dd8e9f9e21aef95fa83e7f7ab0d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pyry Kontio <pyry.kontio@drasa.eu>
|
|
||||||
Date: Mon, 6 Jul 2020 12:57:35 +0900
|
|
||||||
Subject: [PATCH] Makefile: Fix building on AArch64 NixOS
|
|
||||||
|
|
||||||
The parsing of the output of archtest.c produced an unexpected
|
|
||||||
value on AArch64 NixOS. For example, the make variable ARCH was set to:
|
|
||||||
|
|
||||||
```
|
|
||||||
bit outside of fd_set selected
|
|
||||||
arm
|
|
||||||
```
|
|
||||||
|
|
||||||
This made the arch and OS checks fail.
|
|
||||||
|
|
||||||
This commit simplifies the parsing, making it more robust.
|
|
||||||
|
|
||||||
The C files archtest.c, endiantest.c and os.h used to set the
|
|
||||||
TARGET_OS, ARCH and ENDIAN variables, respectively, output
|
|
||||||
the result of the test as the final line, so just extracting
|
|
||||||
the final line and removing double quoting is enough.
|
|
||||||
|
|
||||||
This commit also fixes a bug with debug_shell lacking escaping
|
|
||||||
single quotes, which prevented using the single quote in the
|
|
||||||
debug_shell calls. It used to work by accident before this fix;
|
|
||||||
the line in the call happened to contain a balanced pair of double
|
|
||||||
quotes and lacked other characters that needed escaping, which
|
|
||||||
didn't break the debug_shell, but this was accidental and very
|
|
||||||
brittle.
|
|
||||||
|
|
||||||
Signed-off-by: Pyry Kontio <pyry.kontio@drasa.eu>
|
|
||||||
Change-Id: Iaa4477a71e758cf9ecad2c22f3b77bc6508a3510
|
|
||||||
Reviewed-on: https://review.coreboot.org/c/flashrom/+/43140
|
|
||||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
|
||||||
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
|
|
||||||
---
|
|
||||||
Makefile | 16 ++++++++++------
|
|
||||||
1 file changed, 10 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/Makefile b/Makefile
|
|
||||||
index f3f7717e2..e475cbdbd 100644
|
|
||||||
--- a/Makefile
|
|
||||||
+++ b/Makefile
|
|
||||||
@@ -83,7 +83,8 @@ dummy_for_make_3_80:=$(shell printf "Build started on %s\n\n" "$$(date)" >$(BUIL
|
|
||||||
|
|
||||||
# Provide an easy way to execute a command, print its output to stdout and capture any error message on stderr
|
|
||||||
# in the build details file together with the original stdout output.
|
|
||||||
-debug_shell = $(shell export LC_ALL=C ; { echo 'exec: export LC_ALL=C ; { $(1) ; }' >&2; { $(1) ; } | tee -a $(BUILD_DETAILS_FILE) ; echo >&2 ; } 2>>$(BUILD_DETAILS_FILE))
|
|
||||||
+debug_shell = $(shell export LC_ALL=C ; { echo 'exec: export LC_ALL=C ; { $(subst ','\'',$(1)) ; }' >&2; \
|
|
||||||
+ { $(1) ; } | tee -a $(BUILD_DETAILS_FILE) ; echo >&2 ; } 2>>$(BUILD_DETAILS_FILE))
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# General OS-specific settings.
|
|
||||||
@@ -106,7 +107,8 @@ 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 \
|
|
||||||
+ | tail -1 | cut -f 2 -d'"'))
|
|
||||||
|
|
||||||
ifeq ($(TARGET_OS), Darwin)
|
|
||||||
override CPPFLAGS += -I/opt/local/include -I/usr/local/include
|
|
||||||
@@ -490,8 +492,10 @@ 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 \
|
|
||||||
+ | tail -1 | cut -f 2 -d'"'))
|
|
||||||
+override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null \
|
|
||||||
+ | tail -1))
|
|
||||||
|
|
||||||
# Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
|
|
||||||
ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
|
|
||||||
@@ -1299,12 +1303,12 @@ compiler: featuresavailable
|
|
||||||
@printf "Target arch is "
|
|
||||||
@# FreeBSD wc will output extraneous whitespace.
|
|
||||||
@echo $(ARCH)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
|
|
||||||
- ( echo "unknown. Aborting."; exit 1)
|
|
||||||
+ ( echo "unknown (\"$(ARCH)\"). Aborting."; exit 1)
|
|
||||||
@printf "%s\n" '$(ARCH)'
|
|
||||||
@printf "Target OS is "
|
|
||||||
@# FreeBSD wc will output extraneous whitespace.
|
|
||||||
@echo $(TARGET_OS)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
|
|
||||||
- ( echo "unknown. Aborting."; exit 1)
|
|
||||||
+ ( echo "unknown (\"$(TARGET_OS)\"). Aborting."; exit 1)
|
|
||||||
@printf "%s\n" '$(TARGET_OS)'
|
|
||||||
ifeq ($(TARGET_OS), libpayload)
|
|
||||||
@$(CC) --version 2>&1 | grep -q coreboot || \
|
|
43
flashrom-install-man-file.patch
Normal file
43
flashrom-install-man-file.patch
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
From b820207aeff98b5ccf21649036259333fd0e0175 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Richard Hughes <richard@hughsie.com>
|
||||||
|
Date: Mon, 17 Feb 2020 09:57:01 +0000
|
||||||
|
Subject: [PATCH] Install the man file when using meson as a buildsystem
|
||||||
|
|
||||||
|
This fixes a regression with the Fedora package.
|
||||||
|
|
||||||
|
Change-Id: I881bd5002a842072ce9dadea033c51a2668f9e7c
|
||||||
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
||||||
|
---
|
||||||
|
meson.build | 9 +++++++++
|
||||||
|
1 file changed, 9 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index 375089c3..df39290b 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -299,6 +299,7 @@ endif
|
||||||
|
prefix = get_option('prefix')
|
||||||
|
sbindir = join_paths(prefix, get_option('sbindir'))
|
||||||
|
libdir = join_paths(prefix, get_option('libdir'))
|
||||||
|
+mandir = join_paths(prefix, get_option('mandir'))
|
||||||
|
|
||||||
|
install_headers([
|
||||||
|
'libflashrom.h',
|
||||||
|
@@ -372,6 +373,14 @@ pkgg.generate(
|
||||||
|
description : 'library to interact with flashrom',
|
||||||
|
)
|
||||||
|
|
||||||
|
+configure_file(
|
||||||
|
+ input : 'flashrom.8.tmpl',
|
||||||
|
+ output : 'flashrom.8',
|
||||||
|
+ copy: true,
|
||||||
|
+ install: true,
|
||||||
|
+ install_dir: join_paths(mandir, 'man8'),
|
||||||
|
+)
|
||||||
|
+
|
||||||
|
flashrom_dep = declare_dependency(
|
||||||
|
link_with : flashrom,
|
||||||
|
include_directories : include_directories('.'),
|
||||||
|
--
|
||||||
|
2.24.1
|
||||||
|
|
47
flashrom-j-link-spi.patch
Normal file
47
flashrom-j-link-spi.patch
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
From: Marc Schink <dev@zapb.de>
|
||||||
|
Date: Tue, 8 Dec 2020 22:20:50 +0100
|
||||||
|
Subject: [PATCH] meson: Add missing config option for J-Link SPI
|
||||||
|
|
||||||
|
Signed-off-by: Marc Schink <dev@zapb.de>
|
||||||
|
Change-Id: I476c649f9db7342688560aac9ee5df056517a028
|
||||||
|
Reviewed-on: https://review.coreboot.org/c/flashrom/+/48478
|
||||||
|
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||||
|
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
|
||||||
|
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
|
||||||
|
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index cf91ef4..878cac3 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -38,6 +38,7 @@ config_ch341a_spi = get_option('config_ch341a_spi')
|
||||||
|
config_dediprog = get_option('config_dediprog')
|
||||||
|
config_developerbox_spi = get_option('config_developerbox_spi')
|
||||||
|
config_digilent_spi = get_option('config_digilent_spi')
|
||||||
|
+config_jlink_spi = get_option('config_jlink_spi')
|
||||||
|
config_drkaiser = get_option('config_drkaiser')
|
||||||
|
config_dummy = get_option('config_dummy')
|
||||||
|
config_ft2232_spi = get_option('config_ft2232_spi')
|
||||||
|
@@ -152,6 +153,11 @@ if config_digilent_spi
|
||||||
|
srcs += 'digilent_spi.c'
|
||||||
|
cargs += '-DCONFIG_DIGILENT_SPI=1'
|
||||||
|
endif
|
||||||
|
+if config_jlink_spi
|
||||||
|
+ srcs += 'jlink_spi.c'
|
||||||
|
+ cargs += '-DCONFIG_JLINK_SPI=1'
|
||||||
|
+ deps += dependency('libjaylink')
|
||||||
|
+endif
|
||||||
|
if config_drkaiser
|
||||||
|
srcs += 'drkaiser.c'
|
||||||
|
cargs += '-DCONFIG_DRKAISER=1'
|
||||||
|
diff --git a/meson_options.txt b/meson_options.txt
|
||||||
|
index ea87311..f253f26 100644
|
||||||
|
--- a/meson_options.txt
|
||||||
|
+++ b/meson_options.txt
|
||||||
|
@@ -9,6 +9,7 @@ option('config_ch341a_spi', type : 'boolean', value : true, description : 'Winch
|
||||||
|
option('config_dediprog', type : 'boolean', value : true, description : 'Dediprog SF100')
|
||||||
|
option('config_developerbox_spi', type : 'boolean', value : true, description : 'Developerbox emergency recovery')
|
||||||
|
option('config_digilent_spi', type : 'boolean', value : true, description : 'Digilent Development board JTAG')
|
||||||
|
+option('config_jlink_spi', type : 'boolean', value : false, description : 'SEGGER J-Link and compatible devices')
|
||||||
|
option('config_drkaiser', type : 'boolean', value : true, description : 'Dr. Kaiser')
|
||||||
|
option('config_dummy', type : 'boolean', value : true, description : 'dummy tracing')
|
||||||
|
option('config_ft2232_spi', type : 'boolean', value : true, description : 'FT2232 SPI dongles')
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Jul 24 14:57:24 UTC 2022 - Michael Gorse <mgorse@suse.com>
|
||||||
|
|
||||||
|
- Switch to meson
|
||||||
|
- Add flashrom-install-man-file.patch: install the man file when
|
||||||
|
using meson.
|
||||||
|
- Add flashrom-j-link-spi.patch: Add missing meson option for
|
||||||
|
J-Link SPI.
|
||||||
|
- Drop fix_aarch64.patch: no longer relevant.
|
||||||
|
- Package the library and headers.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 9 15:02:36 UTC 2021 - Andreas Schwab <schwab@suse.de>
|
Thu Sep 9 15:02:36 UTC 2021 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package flashrom
|
# spec file for package flashrom
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021 SUSE LLC
|
# Copyright (c) 2022 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -27,10 +27,16 @@ Source0: https://download.flashrom.org/releases/%{name}-v%{version}.tar.b
|
|||||||
Source1: https://download.flashrom.org/releases/%{name}-v%{version}.tar.bz2.asc#/%{name}-%{version}.tar.bz2.sig
|
Source1: https://download.flashrom.org/releases/%{name}-v%{version}.tar.bz2.asc#/%{name}-%{version}.tar.bz2.sig
|
||||||
# Got the key from David Hendricks
|
# Got the key from David Hendricks
|
||||||
Source2: %{name}.keyring
|
Source2: %{name}.keyring
|
||||||
# PATCH-FIX-UPSTREAM - https://github.com/flashrom/flashrom/commit/da6b3b70cb852dd8e9f9e21aef95fa83e7f7ab0d
|
# PATCH-FIX-UPSTREAM https://github.com/flashrom/flashrom/commit/7aea04f7099ad4dde7b1f5900b54ef603eadf25e
|
||||||
Patch1: fix_aarch64.patch
|
Patch1: flashrom-install-man-file.patch
|
||||||
|
# PATCH-FIX-UPSTREAM https://github.com/flashrom/flashrom/commit/13a356815d2438103689a6ea1ac7e58d4d508ddb
|
||||||
|
Patch2: flashrom-j-link-spi.patch
|
||||||
|
BuildRequires: meson >= 0.47.0
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: pkgconfig(libftdi1)
|
BuildRequires: pkgconfig(libftdi1)
|
||||||
|
%ifarch %{ix86} x86_64
|
||||||
|
BuildRequires: pkgconfig(libjaylink)
|
||||||
|
%endif
|
||||||
BuildRequires: pkgconfig(libpci)
|
BuildRequires: pkgconfig(libpci)
|
||||||
BuildRequires: pkgconfig(libusb)
|
BuildRequires: pkgconfig(libusb)
|
||||||
BuildRequires: pkgconfig(zlib)
|
BuildRequires: pkgconfig(zlib)
|
||||||
@ -47,23 +53,79 @@ It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and
|
|||||||
TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash,
|
TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash,
|
||||||
or SPI.
|
or SPI.
|
||||||
|
|
||||||
|
%package -n libflashrom1
|
||||||
|
Summary: A universal flash programming utility
|
||||||
|
Group: Development/Tools/Other
|
||||||
|
|
||||||
|
%description -n libflashrom1
|
||||||
|
flashrom is a utility for reading, writing, verifying and erasing flash ROM
|
||||||
|
chips. It's often used to flash BIOS/EFI/coreboot/firmware images in-system
|
||||||
|
using a supported mainboard, but it also supports flashing of network
|
||||||
|
cards (NICs), SATA controller cards, and other external devices which can
|
||||||
|
program flash chips.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-v%{version}
|
%autosetup -p1 -n %{name}-v%{version}
|
||||||
%patch1 -p1
|
|
||||||
|
%package devel
|
||||||
|
Summary: A universal flash programming utility
|
||||||
|
Group: Development/Tools/Other
|
||||||
|
Requires: libflashrom1 = %{version}-%{release}
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
flashrom is a utility for reading, writing, verifying and erasing flash ROM
|
||||||
|
chips. It's often used to flash BIOS/EFI/coreboot/firmware images in-system
|
||||||
|
using a supported mainboard, but it also supports flashing of network
|
||||||
|
cards (NICs), SATA controller cards, and other external devices which can
|
||||||
|
program flash chips.
|
||||||
|
|
||||||
|
This package contains the headers needed to compile against libflashrom.
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make %{?_smp_mflags} \
|
%meson \
|
||||||
CFLAGS="%{optflags}"
|
%ifarch %{ix86} x86_64
|
||||||
|
-Dconfig_jlink_spi=true \
|
||||||
|
-Dconfig_internal=true \
|
||||||
|
%else
|
||||||
|
-Dconfig_atahpt=false \
|
||||||
|
-Dconfig_atapromise=false \
|
||||||
|
-Dconfig_atavia=false \
|
||||||
|
-Dconfig_drkaiser=false \
|
||||||
|
-Dconfig_gfxnvidia=false \
|
||||||
|
-Dconfig_it8212=false \
|
||||||
|
-Dconfig_jlink_spi=false \
|
||||||
|
-Dconfig_nic3com=false \
|
||||||
|
-Dconfig_nicintel_eeprom=false \
|
||||||
|
-Dconfig_nicintel=false \
|
||||||
|
-Dconfig_nicintel_spi=false \
|
||||||
|
-Dconfig_nicnatsemi=false \
|
||||||
|
-Dconfig_nicrealtek=false \
|
||||||
|
-Dconfig_ogp_spi=false \
|
||||||
|
-Dconfig_rayer_spi=false \
|
||||||
|
-Dconfig_satamv=false \
|
||||||
|
-Dconfig_satasii=false \
|
||||||
|
-Dconfig_internal=false \
|
||||||
|
%endif
|
||||||
|
%{nil}
|
||||||
|
|
||||||
|
%meson_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
install -d %{buildroot}/%{_sbindir}
|
%meson_install
|
||||||
install -d %{buildroot}/%{_mandir}/man8
|
|
||||||
install -m 0755 flashrom %{buildroot}/%{_sbindir}
|
|
||||||
install -m 0644 flashrom.8 %{buildroot}/%{_mandir}/man8
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc COPYING README
|
%license COPYING
|
||||||
|
%doc README
|
||||||
%{_sbindir}/flashrom
|
%{_sbindir}/flashrom
|
||||||
%{_mandir}/man8/flashrom.8%{ext_man}
|
%{_mandir}/man8/flashrom.8%{ext_man}
|
||||||
|
|
||||||
|
%files -n libflashrom1
|
||||||
|
%{_libdir}/libflashrom.so.1
|
||||||
|
%{_libdir}/libflashrom.so.1.0.0
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%{_includedir}/libflashrom.h
|
||||||
|
%{_libdir}/libflashrom.so
|
||||||
|
%{_libdir}/pkgconfig/flashrom.pc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user