Skip to content

Commit

Permalink
gpg toolstack: Upgrade toolstack in an attempt to fix linuxboot#710 (…
Browse files Browse the repository at this point in the history
…gawk error fixed upstream). Goal of this is to show that x230 board will die if we do not resolve linuxboot#590, or move along with linuxboot#703.
  • Loading branch information
tlaurion committed May 3, 2020
1 parent 00a1a2b commit d1e09e2
Show file tree
Hide file tree
Showing 11 changed files with 217 additions and 22 deletions.
53 changes: 43 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ version: 2
jobs:
build:
docker:
- image: osresearch/musl-cross:38e52db
- image: ubuntu:18.04
steps:
- run:
name: Install dependencies
command: |
apt update
apt install -y build-essential zlib1g-dev uuid-dev libdigest-sha-perl libelf-dev bc bzip2 bison flex git gnupg iasl m4 nasm patch python wget gnat cpio ccache pkg-config cmake libusb-1.0-0-dev autoconf texinfo ncurses-dev
- checkout

- restore_cache:
key: heads-{{ .Branch }}{{ .Environment.CACHE_VERSION }}

- run:
name: Bootstrap make
name: git reset
command: |
make -j4 bootstrap
git reset --hard "$CIRCLE_SHA1" \
# linuxboot steps need something to pass in the kernel header path
# skipping for now
Expand Down Expand Up @@ -40,11 +48,14 @@ jobs:
- run:
name: qemu-coreboot
command: |
./build/make-4.2.1/make \
CROSS=/cross/bin/x86_64-linux-musl- \
--load 2 \
rm -rf build/make-4.2.1/ build/qemu-coreboot/* && make --load 2 \
V=1 \
BOARD=qemu-coreboot \
no_output_timeout: 3h
- run:
name: Output qemu-coreboot hashes
command: |
cat build/qemu-coreboot/hashes.txt \
- store-artifacts:
path: build/qemu-coreboot/coreboot.rom
Expand All @@ -54,17 +65,39 @@ jobs:
- run:
name: x230
command: |
./build/make-4.2.1/make \
CROSS=/cross/bin/x86_64-linux-musl- \
--load 2 \
make --load 2 \
V=1 \
BOARD=x230 \
no_output_timeout: 3h
- run:
name: Ouput x230 hashes
command: |
cat build/x230/hashes.txt \
- run:
name: Archiving build logs to bundle in artifacts
command: |
tar zcvf logs.tar.gz ./build/log/*
- store-artifacts:
path: build/x230/coreboot.rom
- store-artifacts:
path: build/x230/hashes.txt
path: build/x230/initrd.cpio.xz
- store-artifacts:
path: build/x230/modules.cpio
- store-artifacts:
path: build/x230/heads.cpio
- store-artifacts:
path: build/x230/tools.cpio
- store-artifacts:
path: logs.tar.gz

- save_cache:
key: heads-{{ .Branch }}{{ .Environment.CACHE_VERSION }}
paths:
- packages
- crossgcc
- build

workflows:
version: 2
Expand Down
4 changes: 1 addition & 3 deletions config/coreboot-x230.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
CONFIG_LOCALVERSION="heads"
CONFIG_ANY_TOOLCHAIN=y
# CONFIG_INCLUDE_CONFIG_FILE is not set
# CONFIG_COLLECT_TIMESTAMPS is not set
CONFIG_USE_BLOBS=y
CONFIG_USE_BLOBS=n
CONFIG_MEASURED_BOOT=y
CONFIG_VENDOR_LENOVO=y
CONFIG_CBFS_SIZE=0x700000
Expand Down
5 changes: 3 additions & 2 deletions modules/gpg2
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
modules-$(CONFIG_GPG2) += gpg2

gpg2_version := 2.2.10
gpg2_version := 2.2.20
gpg2_dir := gnupg-$(gpg2_version)
gpg2_tar := gnupg-$(gpg2_version).tar.bz2
gpg2_url := https://www.gnupg.org/ftp/gcrypt/gnupg/$(gpg2_tar)
gpg2_hash := 799dd37a86a1448732e339bd20440f4f5ee6e69755f6fd7a73ee8af30840c915
gpg2_hash := 04a7c9d48b74c399168ee8270e548588ddbe52218c337703d7f06373d326ca30

# For reproducibility reasons we have to override the exec_prefix
# and datarootdir on the configure line so that the Makefiles will
Expand Down Expand Up @@ -46,6 +46,7 @@ gpg2_configure := ./configure \
--disable-wks-tools \
--disable-gnutls \
--disable-dirmngr \
--disable-static \

# Run one build to generate the executables with the pre-defined
# exec_prefix and datarootdir, then a second make to install the binaries
Expand Down
4 changes: 2 additions & 2 deletions modules/libassuan
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
modules-$(CONFIG_GPG2) += libassuan
libassuan_version := 2.5.1
libassuan_version := 2.5.3
libassuan_dir := libassuan-$(libassuan_version)
libassuan_tar := libassuan-$(libassuan_version).tar.bz2
libassuan_url := https://gnupg.org/ftp/gcrypt/libassuan/$(libassuan_tar)
libassuan_hash := 47f96c37b4f2aac289f0bc1bacfa8bd8b4b209a488d3d15e2229cb6cc9b26449
libassuan_hash := 91bcb0403866b4e7c4bc1cc52ed4c364a9b5414b3994f718c70303f7f765e702

libassuan_configure := ./configure \
$(CROSS_TOOLS) \
Expand Down
4 changes: 2 additions & 2 deletions modules/libgcrypt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
modules-$(CONFIG_GPG2) += libgcrypt
libgcrypt_version := 1.8.3
libgcrypt_version := 1.8.5
libgcrypt_dir := libgcrypt-$(libgcrypt_version)
libgcrypt_tar := libgcrypt-$(libgcrypt_version).tar.bz2
libgcrypt_url := https://gnupg.org/ftp/gcrypt/libgcrypt/$(libgcrypt_tar)
libgcrypt_hash := 66ec90be036747602f2b48f98312361a9180c97c68a690a5f376fa0f67d0af7c
libgcrypt_hash := 3b4a2a94cb637eff5bdebbcaf46f4d95c4f25206f459809339cdada0eb577ac3

libgcrypt_configure := ./configure \
$(CROSS_TOOLS) \
Expand Down
4 changes: 2 additions & 2 deletions modules/libgpg-error
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
modules-$(CONFIG_GPG2) += libgpg-error
libgpg-error_version := 1.32
libgpg-error_version := 1.37
libgpg-error_dir := libgpg-error-$(libgpg-error_version)
libgpg-error_tar := libgpg-error-$(libgpg-error_version).tar.bz2
libgpg-error_url := https://gnupg.org/ftp/gcrypt/libgpg-error/$(libgpg-error_tar)
libgpg-error_hash := c345c5e73cc2332f8d50db84a2280abfb1d8f6d4f1858b9daa30404db44540ca
libgpg-error_hash := b32d6ff72a73cf79797f7f2d039e95e9c6f92f0c1450215410840ab62aea9763

libgpg-error_configure := ./configure \
$(CROSS_TOOLS) \
Expand Down
8 changes: 7 additions & 1 deletion modules/pinentry
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ pinentry_configure := ./configure \
--disable-libsecret \
--disable-fallback-curses \
--disable-pinentry-curses \
--disable-pinentry-qt \
--disable-pinentry-gtk2 \
--disable-pinentry-gnome3 \
--disable-pinentry-fltk \
--disable-pinentry-emacs \
--disable-fallback-curses \
--disable-pinentry-qt5 \
--disable-pinentry-fltk \
--disable-modular-tests \
--disable-qt --disable-ft --disable-fc \
--disable-qt \
--disable-gtk-doc \
--disable-cups \
--with-libgpg-error-prefix="$(INSTALL)" \
--with-libassuan-prefix="$(INSTALL)" \

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
157 changes: 157 additions & 0 deletions patches/libgpg-error-1.32.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
From 7865041c77f4f7005282f10f9b6666b19072fbdf Mon Sep 17 00:00:00 2001
From: NIIBE Yutaka <[email protected]>
Date: Mon, 15 Apr 2019 15:10:44 +0900
Subject: [PATCH] awk: Prepare for Gawk 5.0.

* src/Makefile.am: Use pkg_namespace (instead of namespace).
* src/mkerrnos.awk: Likewise.
* lang/cl/mkerrcodes.awk: Don't escape # in regexp.
* src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto.

--

In Gawk 5.0, regexp routines are replaced by Gnulib implementation,
which only allows escaping specific characters.

GnuPG-bug-id: 4459
Reported-by: Marius Schamschula
Signed-off-by: NIIBE Yutaka <[email protected]>
---
lang/cl/mkerrcodes.awk | 2 +-
src/Makefile.am | 2 +-
src/mkerrcodes.awk | 2 +-
src/mkerrcodes1.awk | 2 +-
src/mkerrcodes2.awk | 2 +-
src/mkerrnos.awk | 2 +-
src/mkstrtable.awk | 10 +++++-----
7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lang/cl/mkerrcodes.awk b/lang/cl/mkerrcodes.awk
index ae29043..9a1fc18 100644
--- a/lang/cl/mkerrcodes.awk
+++ b/lang/cl/mkerrcodes.awk
@@ -122,7 +122,7 @@ header {
}

!header {
- sub (/\#.+/, "");
+ sub (/#.+/, "");
sub (/[ ]+$/, ""); # Strip trailing space and tab characters.

if (/^$/)
diff --git a/src/Makefile.am b/src/Makefile.am
index ce1b882..f2590cb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -293,7 +293,7 @@ code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile

errnos-sym.h: Makefile mkstrtable.awk errnos.in
$(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
- -v prefix=GPG_ERR_ -v namespace=errnos_ \
+ -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
$(srcdir)/errnos.in >$@


diff --git a/src/mkerrcodes.awk b/src/mkerrcodes.awk
index 46d436c..e9c857c 100644
--- a/src/mkerrcodes.awk
+++ b/src/mkerrcodes.awk
@@ -85,7 +85,7 @@ header {
}

!header {
- sub (/\#.+/, "");
+ sub (/#.+/, "");
sub (/[ ]+$/, ""); # Strip trailing space and tab characters.

if (/^$/)
diff --git a/src/mkerrcodes1.awk b/src/mkerrcodes1.awk
index a771a73..4578e29 100644
--- a/src/mkerrcodes1.awk
+++ b/src/mkerrcodes1.awk
@@ -81,7 +81,7 @@ header {
}

!header {
- sub (/\#.+/, "");
+ sub (/#.+/, "");
sub (/[ ]+$/, ""); # Strip trailing space and tab characters.

if (/^$/)
diff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk
index ea58503..188f7a4 100644
--- a/src/mkerrcodes2.awk
+++ b/src/mkerrcodes2.awk
@@ -91,7 +91,7 @@ header {
}

!header {
- sub (/\#.+/, "");
+ sub (/#.+/, "");
sub (/[ ]+$/, ""); # Strip trailing space and tab characters.

if (/^$/)
diff --git a/src/mkerrnos.awk b/src/mkerrnos.awk
index f79df66..15b1aad 100644
--- a/src/mkerrnos.awk
+++ b/src/mkerrnos.awk
@@ -83,7 +83,7 @@ header {
}

!header {
- sub (/\#.+/, "");
+ sub (/#.+/, "");
sub (/[ ]+$/, ""); # Strip trailing space and tab characters.

if (/^$/)
diff --git a/src/mkstrtable.awk b/src/mkstrtable.awk
index c9de9c1..285e45f 100644
--- a/src/mkstrtable.awk
+++ b/src/mkstrtable.awk
@@ -77,7 +77,7 @@
#
# The variable prefix can be used to prepend a string to each message.
#
-# The variable namespace can be used to prepend a string to each
+# The variable pkg_namespace can be used to prepend a string to each
# variable and macro name.

BEGIN {
@@ -102,7 +102,7 @@ header {
print "/* The purpose of this complex string table is to produce";
print " optimal code with a minimum of relocations. */";
print "";
- print "static const char " namespace "msgstr[] = ";
+ print "static const char " pkg_namespace "msgstr[] = ";
header = 0;
}
else
@@ -110,7 +110,7 @@ header {
}

!header {
- sub (/\#.+/, "");
+ sub (/#.+/, "");
sub (/[ ]+$/, ""); # Strip trailing space and tab characters.

if (/^$/)
@@ -150,7 +150,7 @@ END {
else
print " gettext_noop (\"" last_msgstr "\");";
print "";
- print "static const int " namespace "msgidx[] =";
+ print "static const int " pkg_namespace "msgidx[] =";
print " {";
for (i = 0; i < coded_msgs; i++)
print " " pos[i] ",";
@@ -158,7 +158,7 @@ END {
print " };";
print "";
print "static GPG_ERR_INLINE int";
- print namespace "msgidxof (int code)";
+ print pkg_namespace "msgidxof (int code)";
print "{";
print " return (0 ? 0";

--
2.21.0

2 comments on commit d1e09e2

@MrChromebox
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused -- why are you both updating to libgpg-error 1.37 and also applying a patch for 1.32 which is included in 1.37? should be one or the other in order to resolve linuxboot#668, no?

@tlaurion
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MrChromebox : will make it clean, but all latest versions of gpg toolset built correctly on debian bullseye here and 1.32 patch here where 1.32 patch was removed. (didn't expect there would be enough CBFS space for that. Consistently fails locally on fedora-30)

Please sign in to comment.