From dce6fbc06ac0598c4f273b384e81ab1508619d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Sat, 20 Feb 2021 02:39:02 -0300 Subject: [PATCH] vboot-utils: update to 89.13729. Also clean up template. Related #28507. --- .../vboot-utils/patches/fix-glibc-2.28.patch | 13 ----- srcpkgs/vboot-utils/patches/fix-musl.patch | 49 ----------------- .../vboot-utils/patches/format-glibc.patch | 0 .../vboot-utils/patches/tpm_lite_stub.patch | 10 ---- srcpkgs/vboot-utils/template | 52 +++++++++---------- 5 files changed, 24 insertions(+), 100 deletions(-) delete mode 100644 srcpkgs/vboot-utils/patches/fix-glibc-2.28.patch delete mode 100644 srcpkgs/vboot-utils/patches/fix-musl.patch create mode 100644 srcpkgs/vboot-utils/patches/format-glibc.patch delete mode 100644 srcpkgs/vboot-utils/patches/tpm_lite_stub.patch diff --git a/srcpkgs/vboot-utils/patches/fix-glibc-2.28.patch b/srcpkgs/vboot-utils/patches/fix-glibc-2.28.patch deleted file mode 100644 index 4f091aaf2ce..00000000000 --- a/srcpkgs/vboot-utils/patches/fix-glibc-2.28.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cgpt/cgpt_wrapper.c b/cgpt/cgpt_wrapper.c -index 62635f3f..b27a3eef 100644 ---- cgpt/cgpt_wrapper.c -+++ cgpt/cgpt_wrapper.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - #include "cgpt.h" - #include "cgpt_nor.h" - diff --git a/srcpkgs/vboot-utils/patches/fix-musl.patch b/srcpkgs/vboot-utils/patches/fix-musl.patch deleted file mode 100644 index 1819bdc2a56..00000000000 --- a/srcpkgs/vboot-utils/patches/fix-musl.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- firmware/stub/vboot_api_stub_sf.c.orig -+++ firmware/stub/vboot_api_stub_sf.c -@@ -5,7 +5,9 @@ - * Stub implementations of firmware-provided API functions. - */ - -+#if defined(__GLIBC__) - #include -+#endif - #include - - #define _STUB_IMPLEMENTATION_ -@@ -34,11 +36,13 @@ static struct alloc_node *alloc_head; - - static void print_stacktrace(void) - { -+#if defined(__GLIBC__) - void *buffer[MAX_STACK_LEVELS]; - int levels = backtrace(buffer, MAX_STACK_LEVELS); - - // print to stderr (fd = 2), and remove this function from the trace - backtrace_symbols_fd(buffer + 1, levels - 1, 2); -+#endif - } - - void *VbExMalloc(size_t size) -@@ -57,7 +61,11 @@ void *VbExMalloc(size_t size) - node->next = alloc_head; - node->ptr = p; - node->size = size; -+#if defined(__GLIBC__) - node->bt_levels = backtrace(node->bt_buffer, MAX_STACK_LEVELS); -+#else -+ node->bt_levels = 0; -+#endif - alloc_head = node; - - return p; -@@ -118,8 +126,10 @@ int vboot_api_stub_check_memory(void) - next = node->next; - fprintf(stderr, "\nptr=%p, size=%zd\n", node->ptr, node->size); - fflush(stderr); -+#if defined(__GLIBC__) - backtrace_symbols_fd(node->bt_buffer + 1, node->bt_levels - 1, - 2); -+#endif - free(node); - } - diff --git a/srcpkgs/vboot-utils/patches/format-glibc.patch b/srcpkgs/vboot-utils/patches/format-glibc.patch new file mode 100644 index 00000000000..e69de29bb2d diff --git a/srcpkgs/vboot-utils/patches/tpm_lite_stub.patch b/srcpkgs/vboot-utils/patches/tpm_lite_stub.patch deleted file mode 100644 index a736beb856a..00000000000 --- a/srcpkgs/vboot-utils/patches/tpm_lite_stub.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ./firmware/stub/tpm_lite_stub.c.orig 2015-06-16 12:29:51.609619681 +0200 -+++ ./firmware/stub/tpm_lite_stub.c 2015-06-16 12:30:01.216620121 +0200 -@@ -14,6 +14,7 @@ - #include "utility.h" - #include "vboot_api.h" - -+#include - #include - #include - #include diff --git a/srcpkgs/vboot-utils/template b/srcpkgs/vboot-utils/template index 61068975964..dd93cb9151a 100644 --- a/srcpkgs/vboot-utils/template +++ b/srcpkgs/vboot-utils/template @@ -1,42 +1,38 @@ # Template file for 'vboot-utils' pkgname=vboot-utils -version=45.7262 -revision=13 +version=89.13729 +revision=1 +_version=${version/./-} archs="x86_64* i686* aarch64* arm*" -_githash=0e8c964915fffb58032bb59bdb31949de718ca90 -hostmakedepends="pkg-config git" -makedepends="libressl-devel libuuid-devel liblzma-devel libyaml-devel" +create_wrksrc=yes +build_style=gnu-makefile +make_use_env=yes +hostmakedepends="pkg-config" +makedepends="libressl-devel libuuid-devel zlib-devel" short_desc="Verified boot kernel utilities" maintainer="Enno Boland " license="BSD-3-Clause" homepage="https://chromium.googlesource.com/chromiumos/platform/vboot_reference.git" -CFLAGS='-D_GNU_SOURCE -Wno-error -fcommon' +distfiles="https://chromium.googlesource.com/chromiumos/platform/vboot_reference.git/+archive/refs/heads/release-R${_version}.B.tar.gz" +checksum=@3d8edd7e3a1672b29f02d93c4cf89f19ad7477694968b0653aa968783c8ba3e6 +# 2crypto specifies a section for some variables, which lead to text relocations in the binary +# let's play it safe and disable PIE +nopie=yes -case "$XBPS_TARGET_MACHINE" in - aarch64*) broken="https://build.voidlinux.org/builders/aarch64-musl_builder/builds/8508/steps/shell_3/logs/stdio" ;; +case $XBPS_TARGET_MACHINE in + x86_64*) _arch=x86_64 ;; + i686*) _arch=x86 ;; + arm*|aarch64*) _arch=arm ;; + *) broken="This package doesn't have a configuration for this target" ;; esac +make_build_args="ARCH=${_arch} WERROR=" -do_fetch() { - git clone https://chromium.googlesource.com/chromiumos/platform/vboot_reference.git $pkgname-$version || true - cd $pkgname-$version - git checkout $_githash -} - -do_build() { - local _arch= - sed -i "s/MTD_CHAR_MAJOR/90/" cgpt/cgpt_wrapper.c - case $XBPS_TARGET_MACHINE in - x86_64*) _arch=x86_64 ;; - i686*) _arch=x86 ;; - arm*) _arch=arm ;; - esac - make CC="$CC" LD="$CC" AR="$AR" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \ - MINIMAL=1 ARCH=$_arch ${makejobs} \ - cgpt utils futil -} +if [ "$XBPS_TARGET_LIBC" = musl ]; then + makedepends+=" musl-fts-devel" + export LDLIBS="-lfts" +fi -do_install() { - make STRIP=true DESTDIR=${DESTDIR} MINIMAL=1 install +post_install() { vmkdir usr/share/vboot vcopy tests/devkeys usr/share/vboot/devkeys vlicense LICENSE