Attention is currently required from: Thomas Heijligen.
Peter Marheine has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/74924 )
Change subject: makefile: remove gitconfig target
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
Rebased to resolve conflict with https://review.coreboot.org/c/flashrom/+/72657
--
To view, visit https://review.coreboot.org/c/flashrom/+/74924
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I278408bd515c5a5599b5c45c597cc66485a87082
Gerrit-Change-Number: 74924
Gerrit-PatchSet: 4
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Sun, 07 May 2023 23:22:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Peter Marheine.
Hello build bot (Jenkins), Thomas Heijligen, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/74924
to look at the new patch set (#4).
Change subject: makefile: remove gitconfig target
......................................................................
makefile: remove gitconfig target
There's basically no benefit to running `make` over directly running the
script that configures hooks, and implementing similar support in Meson
is difficult. Remove the Makefile target to achieve feature parity
between the build systems.
Ticket: https://ticket.coreboot.org/issues/486
Signed-off-by: Peter Marheine <pmarheine(a)chromium.org>
Change-Id: I278408bd515c5a5599b5c45c597cc66485a87082
---
M Makefile
1 file changed, 16 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/24/74924/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/74924
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I278408bd515c5a5599b5c45c597cc66485a87082
Gerrit-Change-Number: 74924
Gerrit-PatchSet: 4
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nico Huber, Michał Żygowski, Paul Menzel.
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/55715 )
Change subject: ite_ecfw: Implement support for flashing ITE ECs found on TUXEDO laptops
......................................................................
Patch Set 30:
(1 comment)
File ite_ecfw.c:
https://review.coreboot.org/c/flashrom/+/55715/comment/0f75aa93_ef7b2695
PS29, Line 411: }
> The command that is sent when writing the first kilobyte probably indicates to the EC that:
> 1. The flash access is finished after it takes the first kilobyte to be flashed.
> 2. EC can switch back from scratch ROM to the flash ROM with the execution.
>
> That is why it must be done at the end of flashing process.
>
> I hope I didn't make any mistake here, Michael can confirm
I took a deeper look at this once again. That 1kb write doesn't tell the EC that the flash process is finished, but the 0xfe command does.
In theory we could use the read/erase/write1k commands for flashing the way flashrom is usually doing it, but: when anything goes wrong during flashing (wrong byte written, then watchdog reset or power cycle), the autoload feature is not working bc the mirror size byte is still 0x00 (was set by the fw on first boot). The ec would then execute bad/broken code (or fail completely).
We could also erase the whole flash and write without skipping the first 1k. However, if the image has autoload disabled and something goes wrong during flashing somewhere after the signature was written, we have the same problem as above.
That is most likely the reason why the first 1k (which is the region where the signature is allowed to reside in flash) get written at the very end (to minimize the risk).
1k is the erase block size of the IT5570 btw. so we can just skip the signature and flash it alone, as we need to erase 1k anyway.
--
To view, visit https://review.coreboot.org/c/flashrom/+/55715
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0e42260155ffea38a6f60790871cd8da7b657031
Gerrit-Change-Number: 55715
Gerrit-PatchSet: 30
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Benjamin Doron <benjamin.doron00(a)gmail.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Comment-Date: Sun, 07 May 2023 20:27:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Comment-In-Reply-To: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Michał Żygowski, Paul Menzel.
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/55715 )
Change subject: ite_ecfw: Implement support for flashing ITE ECs found on TUXEDO laptops
......................................................................
Patch Set 30:
(2 comments)
File ite_ecfw.c:
https://review.coreboot.org/c/flashrom/+/55715/comment/e62cb60f_0f79b1c4
PS29, Line 495: (uint8_t *)
> To be honest I don't see such modifications in the flashrom tool. Wouldn't mind […]
I did a bunch of tests on the autoload feature and read datasheets and leaked ec code again. It seems, all this is meant to be a recovery mechanism in case something goes wrong during flashing. Since under normal circumstances the external flash is not being modified at all, there is always a working firmware image present.
The autoload feature is copying the external flash contents to the eFlash on power-on and it is controlled by
- the autoload strap (pull-up on GPG2) - let's ignore this, as this pull-up is usually present and thus, autoload is active
- a signature on the external flash
- a signature on the eFlash
- firmware (see below)
The signature is used for determining the code base address, internal/external clock selection and configuring autoload. The relevant bits and bytes for autoload are:
byte 7:
- bit 7 : pwm blink during mirror : 0=on, 1=off
- bit 5 : autoload on 0=on, 1=off
- bit 2 : check crc and halt EC on error : 0=on, 1=off
- bit 0 : select PWM0/PWM1 for blinking
byte 13 :
- mirror length : len = 1024b * (val + 1)
- must be 0xaa if byte 7[5]=1(off)
- 0x00 disables autoload
The signature initially (when the eFlash is empty) is located on the external flash. When autoload is enabled (b7[5]=0) and len (b13) > 0, the EC copies len+1 blocks from the external flash to eFlash, then starts executing from the eFlash.
On the next power cycle the EC evaluates BOTH signatures! Tests showed that:
- eFlash b7[5] overrides external b7[5]
- only external length byte (b13) controls copied range (any eFlash b13 > 0 has no influence at all)
- eFlash b13 == 0 disables mirroring
- eFlash b7[5]=0 (on) && ext Flash b7[5]=1 (off) leads to weird resulting contents in eFlash o.O (1024 bytes 0x55, rest 0xfe)
ITE's reference firmware / fw framework disables autoload on the first startup by writing 0x00 to b13. They call it "mirror once". Vendors like Clevo or Lenovo usually keep this mechanism.
If any (older?) firmware image is missing that "mirror once" mechanism, this might lead to overwriting the flashed image on the next power cycle. Maybe that's the reason for the options in the vendor tool?
=> Anyway, the risk is low, since the worst thing that could happen is a downgrade of the firmware to the one on the external flash. If required we can try to find a solution if such case is being reported.
The signature(s) is/are generated during firmware build and we should expect the clock / code base settings to be correct. We shouldn't mess with these settings, even though the vendor tool does. If anyone wants to modify them, they could use a hex editor or adapt the source code (if built from source).
=> Let's drop patching any of these bits.
If someone really wants to force-off autoload manually, they could use a hex editor for now or write a simple tool for it.
=> I still need to test this to be 100% sure but I'm pretty confident now that we can drop any patching of the signature without affecting the function of this safeguard feature.
File ite_ecfw.c:
https://review.coreboot.org/c/flashrom/+/55715/comment/265b910e_d62fddcf
PS30, Line 580: if (ctx_data->support_ite5570)
: return ite_ecfw_chunkwise_erase(ctx_data, blockaddr, blocklen);
hm, I wonder why this is only done for it5570. (I know, the vendor tool does it... but why?). at least clevo l140cu/l140mu firmware provide the full erase function as well.
--
To view, visit https://review.coreboot.org/c/flashrom/+/55715
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0e42260155ffea38a6f60790871cd8da7b657031
Gerrit-Change-Number: 55715
Gerrit-PatchSet: 30
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Benjamin Doron <benjamin.doron00(a)gmail.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Comment-Date: Sun, 07 May 2023 19:44:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-MessageType: comment
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72657 )
Change subject: meson make: use VERSION file
......................................................................
Patch Set 9:
(1 comment)
Patchset:
PS7:
> This is based on master. I've dropped one commit in the line due to problems with the meson version.
Yes, I clicked the "rebase" button and discovered that my +2 still holds, that was good
Now CB:74519 needs rebase
--
To view, visit https://review.coreboot.org/c/flashrom/+/72657
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idc17eadb397b3c579bddfbf9ae6bf1b171f5dfb7
Gerrit-Change-Number: 72657
Gerrit-PatchSet: 9
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Sun, 07 May 2023 08:40:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Alexander Goncharov.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/74519 )
Change subject: Makefile: Build man-page only when sphinx is available
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
This needs rebase after CB:72657 merged.
--
To view, visit https://review.coreboot.org/c/flashrom/+/74519
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If1b81d9bc25ecac19d493b44b00a7c42d0643fe6
Gerrit-Change-Number: 74519
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Sun, 07 May 2023 08:39:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/72657 )
Change subject: meson make: use VERSION file
......................................................................
meson make: use VERSION file
To create a distribution package with meson you run
`meson dist -C <your_build_dir>`
This will collect all git tracked files and pack them into an archive.
There is no way to collect version information for that.
So now the base version stands in the VERSION file. To relase a flashrom
version you change that file and tag the changing commit.
When building from git the git version is embedded in the flashrom
binary. E.g.:
flashrom 1.4.0-devel (git:v1.2-1172-g7f186838) on Linux 6.1.3 (x86_64)
Change-Id: Idc17eadb397b3c579bddfbf9ae6bf1b171f5dfb7
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/72657
Reviewed-by: Anastasia Klimchuk <aklm(a)chromium.org>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M Makefile
A VERSION
M doc/meson.build
M meson.build
D util/getrevision.sh
D util/getversion.sh
6 files changed, 49 insertions(+), 334 deletions(-)
Approvals:
build bot (Jenkins): Verified
Anastasia Klimchuk: Looks good to me, approved
diff --git a/Makefile b/Makefile
index 3258ac3..6004402 100644
--- a/Makefile
+++ b/Makefile
@@ -398,13 +398,11 @@
CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o
-# versioninfo.inc stores metadata required to build a packaged flashrom. It is generated by the export rule and
-# imported below. If versioninfo.inc is not found and the variables are not defined by the user, the info will
-# be obtained using util/getrevision.sh, which is the common case during development.
--include versioninfo.inc
-VERSION ?= $(shell ./util/getrevision.sh --revision)
-
-SCMDEF := -D'FLASHROM_VERSION="$(VERSION)"'
+VERSION ?= $(shell cat ./VERSION)
+VERSION_GIT ?= $(shell git describe 2>/dev/null)
+ifdef VERSION_GIT
+ VERSION := "$(VERSION) (git:$(VERSION_GIT))"
+endif
# No spaces in release names unless set explicitly
RELEASENAME ?= $(shell echo "$(VERSION)" | sed -e 's/ /_/')
@@ -1021,7 +1019,7 @@
fi
%.o: %.c | config
- $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_FLAGS) $(SCMDEF) -o $@ -c $<
+ $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_FLAGS) -D'FLASHROM_VERSION=$(VERSION)' -o $@ -c $<
$(PROGRAM)$(EXEC_SUFFIX): $(CLI_OBJS) libflashrom.a
$(CC) -o $@ $^ $(LDFLAGS)
@@ -1101,7 +1099,7 @@
make CC="CC=i386-elf-gcc lpgcc" AR=i386-elf-ar RANLIB=i386-elf-ranlib
gitconfig:
- ./util/getrevision.sh -c 2>/dev/null && ./util/git-hooks/install.sh
+ git rev-parse 2>/dev/null && ./util/git-hooks/install.sh
.PHONY: all install clean distclean config _export export tarball libpayload
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..90e4bc2
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.4.0-devel
diff --git a/doc/meson.build b/doc/meson.build
index 70c3280..aca73d8 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -14,7 +14,7 @@
custom_target(
'man-pages',
- command : [sphinx, '-b', 'man', '-q', '-d', '@PRIVATE_DIR@', '-Drelease=' + meson.project_version(),'@CURRENT_SOURCE_DIR@', '@OUTDIR@'],
+ command : [sphinx, '-b', 'man', '-q', '-d', '@PRIVATE_DIR@', '-Drelease=' + flashrom_version,'@CURRENT_SOURCE_DIR@', '@OUTDIR@'],
build_always_stale : true, # sphinx handles rebuilds
output : man_outputs,
install : true,
@@ -25,7 +25,7 @@
if get_option('documentation').auto() or get_option('documentation').enabled()
custom_target(
'documentation',
- command : [sphinx, '-b', 'html', '-q', '-d', '@PRIVATE_DIR@', '-Drelease=' + meson.project_version(),'@CURRENT_SOURCE_DIR@', '@OUTDIR@/html'],
+ command : [sphinx, '-b', 'html', '-q', '-d', '@PRIVATE_DIR@', '-Drelease=' + flashrom_version,'@CURRENT_SOURCE_DIR@', '@OUTDIR@/html'],
build_always_stale : true, # sphinx handles rebuilds
output : 'html',
install : true,
diff --git a/meson.build b/meson.build
index 2784c34..87f7809 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('flashromutils', 'c',
- version : run_command('util/getversion.sh', '--version', check : true).stdout().strip(),
+ version : run_command('cat', 'VERSION', check: true).stdout().strip(),
license : 'GPL-2.0',
meson_version : '>=0.53.0',
default_options : [
@@ -19,14 +19,23 @@
''')
endif
-subdir('doc')
-
# libtool versioning
lt_current = '1'
lt_revision = '0'
lt_age = '0'
lt_version = '@0@.@1@.@2@'.format(lt_current, lt_age, lt_revision)
+flashrom_version = meson.project_version()
+git = find_program('git', native : true, required : false)
+if git.found()
+ version_git = run_command('git', 'describe', check : false)
+ if version_git.returncode() == 0
+ flashrom_version += ' (git:@0@)'.format(version_git.stdout().strip())
+ endif
+endif
+
+subdir('doc')
+
# hide/enable some warnings
warning_flags = [
'-Wshadow',
@@ -47,7 +56,7 @@
add_project_arguments('-D__XSI_VISIBLE', language : 'c') # required for gettimeofday() on FreeBSD
add_project_arguments('-D_NETBSD_SOURCE', language : 'c') # required for indirect include of strings.h on NetBSD
add_project_arguments('-D_DARWIN_C_SOURCE', language : 'c') # required for indirect include of strings.h on MacOS
-add_project_arguments('-DFLASHROM_VERSION="' + meson.project_version() + '"', language : 'c')
+add_project_arguments('-DFLASHROM_VERSION="' + flashrom_version + '"', language : 'c')
# get defaults from configure
config_print_wiki= get_option('classic_cli_print_wiki')
@@ -614,19 +623,10 @@
link_depends : mapfile,
)
-version = meson.project_version()
-#strip leading characters
-if version.startswith('v')
- version = version.split('v')[1]
-endif
-if version.startswith('p')
- version = version.split('p')[1]
-endif
-
pkgg = import('pkgconfig')
pkgg.generate(
libraries : libflashrom,
- version : version,
+ version : flashrom_version.split()[0], # cut off the git version
name : 'flashrom',
filebase : 'flashrom',
description : 'library to interact with flashrom',
diff --git a/util/getrevision.sh b/util/getrevision.sh
deleted file mode 100755
index f7d6bf3..0000000
--- a/util/getrevision.sh
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/bin/sh
-# NB: Supposed to be POSIX compatible but at least the usage of 'local' is not.
-#
-# This file is part of the flashrom project.
-#
-# Copyright (C) 2005 coresystems GmbH <stepan(a)coresystems.de>
-# Copyright (C) 2009,2010 Carl-Daniel Hailfinger
-# Copyright (C) 2010 Chromium OS Authors
-# Copyright (C) 2013-2016 Stefan Tauner
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-
-# Make sure we don't get translated output
-export LC_ALL=C
-# nor local times or dates
-export TZ=UTC0
-
-# Helper functions
-# First argument is the path to inspect (usually optional; without
-# it the whole repository will be considered)
-git_has_local_changes() {
- git update-index -q --refresh >/dev/null
- ! git diff-index --quiet HEAD -- "$1"
-}
-
-git_last_commit() {
- # git rev-parse --short HEAD would suffice if repository as a whole is of interest (no $1)
- git log --pretty=format:"%h" -1 -- "$1"
-}
-
-git_is_file_tracked() {
- git ls-files --error-unmatch -- "$1" >/dev/null 2>&1
-}
-
-is_file_tracked() {
- git_is_file_tracked "$1"
-}
-
-# Tries to find a remote source for the changes committed locally.
-# This includes the URL of the remote repository including the last commit and a suitable branch name.
-# Takes one optional argument: the path to inspect
-git_url() {
- last_commit=$(git_last_commit "$1")
- # get all remote branches containing the last commit (excluding origin/HEAD)
- branches=$(git branch -r --contains $last_commit | sed '/\//!d;/.*->.*/d;s/[\t ]*//')
- if [ -z "$branches" ] ; then
- echo "No remote branch contains a suitable commit">&2
- return
- fi
-
- # find "nearest" branch
- local mindiff=9000
- local target=
- for branch in $branches ; do
- curdiff=$(git rev-list --count $last_commit..$branch)
- if [ $curdiff -ge $mindiff ] ; then
- continue
- fi
- mindiff=$curdiff
- target=$branch
- done
-
- echo "$(git ls-remote --exit-code --get-url ${target%/*}) ${target#*/}"
-}
-
-# Returns a string indicating where others can get the current source code (excluding uncommitted changes).
-# Takes one optional argument: the path to inspect
-scm_url() {
- local url=
-
- if git_is_file_tracked "$1" ; then
- url="$(git_url "$1")"
- else
- return ${EXIT_FAILURE}
- fi
-
- echo "${url}"
-}
-
-# Retrieve timestamp since last modification. If the sources are pristine,
-# then the timestamp will match that of the SCM's most recent modification
-# date.
-timestamp() {
- local t
-
- # date syntaxes are manifold:
- # gnu date [-d input]... [+FORMAT]
- # netbsd date [-ajnu] [-d date] [-r seconds] [+format] [[[[[[CC]yy]mm]dd]HH]MM[.SS]]
- # freebsd date [-jnu] [-d dst] [-r seconds] [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] [...]
- # dragonflybsd date [-jnu] [-d dst] [-r seconds] [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] [...]
- # openbsd date [-aju] [-d dst] [-r seconds] [+format] [[[[[[cc]yy]mm]dd]HH]MM[.SS]] [...]
- if git_is_file_tracked "$2" ; then
- # are there local changes?
- if git_has_local_changes "$2" ; then
- t=$(date -u "${1}")
- else
- # No local changes, get date of the last commit
- case $(uname) in
- # Most BSD dates do not support parsing date values from user input with -d but all of
- # them support parsing epoch seconds with -r. Thanks to git we can easily use that:
- NetBSD|OpenBSD|DragonFly|FreeBSD)
- t=$(date -u -r "$(git log --pretty=format:%ct -1 -- $2)" "$1" 2>/dev/null);;
- *)
- t=$(date -d "$(git log --pretty=format:%cD -1 -- $2)" -u "$1" 2>/dev/null);;
- esac
- fi
- else
- t=$(date -u "$1")
- fi
-
- if [ -z "$t" ]; then
- echo "Warning: Could not determine timestamp." 2>/dev/null
- fi
- echo "${t}"
-}
-
-revision() {
- local r
- if git_is_file_tracked "$1" ; then
- r=$(git describe --always $(git_last_commit "$1"))
- if git_has_local_changes "$1" ; then
- r="$r-dirty"
- fi
- else
- r="unknown"
- fi
-
- echo "${r}"
-}
-
-is_tracked() {
- is_file_tracked "$1"
-}
-
-show_help() {
- echo "Usage:
- ${0} <command> [path]
-
-Commands
- -h or --help
- this message
- -c or --check
- test if path is under version control at all
- -r or --revision
- return unique revision information including an indicator for
- uncommitted changes
- -U or --url
- URL associated with the latest commit
- -d or --date
- date of most recent modification
- -t or --timestamp
- timestamp of most recent modification
-"
- return
-}
-
-check_action() {
- if [ -n "$action" ]; then
- echo "Error: Multiple actions given.">&2
- exit ${EXIT_FAILURE}
- fi
-}
-
-main() {
- local query_path=
- local action=
-
- # Argument parser loop
- while [ $# -gt 0 ];
- do
- case ${1} in
- -h|--help)
- action=show_help;
- shift;;
- -U|--url)
- check_action $1
- action=scm_url
- shift;;
- -d|--date)
- check_action $1
- action="timestamp +%Y-%m-%d" # refrain from suffixing 'Z' to indicate it's UTC
- shift;;
- -r|--revision)
- check_action $1
- action=revision
- shift;;
- -t|--timestamp)
- check_action $1
- action="timestamp +%Y-%m-%dT%H:%M:%SZ" # There is only one valid time format! ISO 8601
- shift;;
- -c|--check)
- check_action $1
- action=is_tracked
- shift;;
- -*)
- show_help;
- echo "Error: Invalid option: ${1}"
- exit ${EXIT_FAILURE};;
- *)
- if [ -z "$query_path" ] ; then
- if [ ! -e "$1" ] ; then
- echo "Error: Path \"${1}\" does not exist.">&2
- exit ${EXIT_FAILURE}
- fi
- query_path=$1
- else
- echo "Warning: Ignoring overabundant parameter: \"${1}\"">&2
- fi
- shift;;
- esac;
- done
-
- # default to current directory (usually equals the whole repository)
- if [ -z "$query_path" ] ; then
- query_path=.
- fi
- if [ -z "$action" ] ; then
- show_help
- echo "Error: No actions specified"
- exit ${EXIT_FAILURE}
- fi
-
- $action "$query_path"
-}
-
-main $@
diff --git a/util/getversion.sh b/util/getversion.sh
deleted file mode 100755
index d3810d2..0000000
--- a/util/getversion.sh
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-#
-# This file is part of the flashrom project.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-
-version() {
- if [ -r versioninfo.inc ]; then
- v=$(sed -n 's/^VERSION = //p' versioninfo.inc)
- else
- v=$($(dirname ${0})/getrevision.sh --revision)
- if [ $? -ne 0 ]; then
- v='unknown'
- fi
- fi
-
- echo ${v}
-}
-
-mandate() {
- if [ -r versioninfo.inc ]; then
- d=$(sed -n 's/^MAN_DATE = //p' versioninfo.inc)
- else
- d=$($(dirname ${0})/getrevision.sh --date flashrom.8.tmpl)
- if [ $? -ne 0 ]; then
- d='unknown'
- fi
- fi
-
- echo ${d}
-}
-
-show_help() {
- echo "Usage:
- ${0} <command>
-
-Commands
- -h or --help
- this message
- -v or --version
- return current/release flashrom version
- -m or --man-date
- return current/release date of the manual page
-"
-}
-
-if [ $# -ne 1 ]; then
- show_help
- echo "Error: Only exactly one command allowed.">&2
- exit 1
-fi
-
-case $1 in
- -h|--help) show_help;;
- -m|--man-date) mandate;;
- -v|--version) version;;
- *)
- show_help
- echo "Error: Invalid option: $1"
- exit 1
- ;;
-esac
--
To view, visit https://review.coreboot.org/c/flashrom/+/72657
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idc17eadb397b3c579bddfbf9ae6bf1b171f5dfb7
Gerrit-Change-Number: 72657
Gerrit-PatchSet: 9
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-MessageType: merged
Attention is currently required from: Anastasia Klimchuk, Alexander Goncharov.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72657 )
Change subject: meson make: use VERSION file
......................................................................
Patch Set 8:
(1 comment)
Patchset:
PS7:
> still counts :)
This is based on master. I've dropped one commit in the line due to problems with the meson version.
--
To view, visit https://review.coreboot.org/c/flashrom/+/72657
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idc17eadb397b3c579bddfbf9ae6bf1b171f5dfb7
Gerrit-Change-Number: 72657
Gerrit-PatchSet: 8
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Sun, 07 May 2023 08:26:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Alexander Goncharov.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72657 )
Change subject: meson make: use VERSION file
......................................................................
Patch Set 8: Code-Review+2
(1 comment)
Patchset:
PS7:
> will you be able to rebase this? I am thinking if I rebase, my approval might not count anymore
still counts :)
--
To view, visit https://review.coreboot.org/c/flashrom/+/72657
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idc17eadb397b3c579bddfbf9ae6bf1b171f5dfb7
Gerrit-Change-Number: 72657
Gerrit-PatchSet: 8
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Sun, 07 May 2023 08:12:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Martin L Roth, Thomas Heijligen, Angel Pons, Anastasia Klimchuk, Steve Markgraf.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71801 )
Change subject: programmer: Add bitbanging programmer driver for Linux libgpiod
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS7:
> Martin, we need your help! How do we setup Jenkins with the new dependency `libgpiod` so that this n […]
coreboot-sdk got it added already in February. Some flashrom-stable builds
succeeded but maybe not all (it's using Meson and that currently just disables
what is missing dependencies). A hunch: maybe not all Jenkins nodes got the
update yet?
--
To view, visit https://review.coreboot.org/c/flashrom/+/71801
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Icad3eb7764f28feaea51bda3a7893da724c86d06
Gerrit-Change-Number: 71801
Gerrit-PatchSet: 7
Gerrit-Owner: Steve Markgraf <steve(a)steve-m.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Martin L Roth <gaumless(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Martin L Roth <gaumless(a)gmail.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Steve Markgraf <steve(a)steve-m.de>
Gerrit-Comment-Date: Sat, 06 May 2023 14:45:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment