diff --git a/flashrom-ensure-flashrom-symbols-are-not-loaded-if-U.patch b/flashrom-ensure-flashrom-symbols-are-not-loaded-if-U.patch new file mode 100644 index 0000000..46f9cae --- /dev/null +++ b/flashrom-ensure-flashrom-symbols-are-not-loaded-if-U.patch @@ -0,0 +1,49 @@ +From f9ae6c12bd0b67ee336089ce15d5255d7d6d11b7 Mon Sep 17 00:00:00 2001 +From: Nobel Barakat +Date: Tue, 22 Nov 2022 00:40:20 +0000 +Subject: [PATCH] flashrom: ensure flashrom symbols are not loaded if + !USE_FLASHROM + +The linking process during the installation phase of this package +breaks if you compile with make USE_FLASHROM=0. A new conditional has +been added to the make file that prevents utility/crossystem from +compiling if USE_FLASHROM is either not set or set to the number 0. + +BUG=b:256682063 +TEST=cros_run_unit_tests --board amd64-generic --packages vboot_reference +TEST=env USE="test -flashrom" emerge-amd64-generic vboot_reference +TEST=env USE="-flashrom" emerge-amd64-generic vboot_reference +BRANCH=none + +Signed-off-by: Nobel Barakat nobelbarakat@google.com +Change-Id: Ia8cdd24653fdb74c9bb5f4de86b7711b138299cf +Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4045302 +Commit-Queue: Nobel Barakat +Reviewed-by: Yu-Ping Wu +Tested-by: Nobel Barakat +--- + Makefile | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 129ace99a424..cb504ff33a62 100644 +--- a/Makefile ++++ b/Makefile +@@ -593,10 +593,13 @@ UTIL_BIN_NAMES_SDK = \ + utility/signature_digest_utility \ + utility/verify_data + UTIL_BIN_NAMES_BOARD = \ +- utility/crossystem \ + utility/dumpRSAPublicKey \ + utility/tpmc + ++ifneq ($(filter-out 0,${USE_FLASHROM}),) ++UTIL_BIN_NAMES_BOARD += utility/crossystem ++endif ++ + UTIL_SCRIPTS_SDK = $(addprefix ${BUILD}/,${UTIL_SCRIPT_NAMES_SDK}) + UTIL_SCRIPTS_BOARD = $(addprefix ${BUILD}/,${UTIL_SCRIPT_NAMES_BOARD}) + UTIL_BINS_SDK = $(addprefix ${BUILD}/,${UTIL_BIN_NAMES_SDK}) +-- +2.39.1 + diff --git a/sources b/sources index 734ab31..3e17897 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (vboot-utils-a1c5f7c.tar.xz) = 0324e9ab7578073893a35b461f4f9ebd5e1700eb39d342398981855597e01ad085acea4ca3e05c4a68801f646ce68fb86ab665c0f05ab3a169158020c09551b9 +SHA512 (vboot-utils-9b08a3c4.tar.xz) = 0cf34f8a2b9a17781a7faf55974bdc9e88b1c09cb8efccd05ddba745f38a5ea803b12b2ffa31b847026d56b0672a9d97ab2f5d8e9ae7ca31a54d0d19d0895204 diff --git a/vboot-utils-00-disable-static-linking.patch b/vboot-utils-00-disable-static-linking.patch deleted file mode 100644 index 4d02711..0000000 --- a/vboot-utils-00-disable-static-linking.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- vboot-utils-a1c5f7c/Makefile.orig 2017-06-04 14:06:10.707762796 +0100 -+++ vboot-utils-a1c5f7c/Makefile 2017-06-04 14:07:04.347718848 +0100 -@@ -227,12 +227,6 @@ - CXX ?= g++ - PKG_CONFIG ?= pkg-config - --# Static? --ifneq (${STATIC},) --LDFLAGS += -static --PKG_CONFIG += --static --endif -- - # Determine QEMU architecture needed, if any - ifeq (${ARCH},${HOST_ARCH}) - # Same architecture; no need for QEMU -@@ -999,7 +993,6 @@ - # Link tests for external repos - ${BUILD}/host/linktest/extern: ${HOSTLIB} - ${BUILD}/host/linktest/extern: LIBS = ${HOSTLIB} --${BUILD}/host/linktest/extern: LDLIBS += -static - TEST_OBJS += ${BUILD}/host/linktest/extern.o - - .PHONY: hostlib -@@ -1090,9 +1083,6 @@ - ${UTIL_BINS} ${UTIL_BINS_STATIC}: ${UTILLIB} - ${UTIL_BINS} ${UTIL_BINS_STATIC}: LIBS = ${UTILLIB} - --# Utilities for auto-update toolkits must be statically linked. --${UTIL_BINS_STATIC}: LDFLAGS += -static -- - - .PHONY: utils - utils: ${UTIL_BINS} ${UTIL_SCRIPTS} -@@ -1124,7 +1114,7 @@ - - ${FUTIL_STATIC_BIN}: ${FUTIL_STATIC_OBJS} ${UTILLIB} - @${PRINTF} " LD $(subst ${BUILD}/,,$@)\n" -- ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} -static $^ ${LDLIBS} -+ ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} $^ ${LDLIBS} - - ${FUTIL_BIN}: LDLIBS += ${CRYPTO_LIBS} ${FWLIB20} - ${FUTIL_BIN}: ${FUTIL_OBJS} ${UTILLIB} ${FWLIB20} ${UTILBDB} diff --git a/vboot-utils-9b08a3c4.patch b/vboot-utils-9b08a3c4.patch new file mode 100644 index 0000000..233f389 --- /dev/null +++ b/vboot-utils-9b08a3c4.patch @@ -0,0 +1,12 @@ +diff -ru vboot-utils-61971455-orig/futility/updater_utils.c vboot-utils-61971455/futility/updater_utils.c +--- vboot-utils-61971455-orig/futility/updater_utils.c 2022-06-16 02:45:02.000000000 +0200 ++++ vboot-utils-61971455/futility/updater_utils.c 2022-06-20 15:06:24.192678422 +0200 +@@ -700,7 +700,7 @@ + if (!cmd) + return -1; + +- VB2_DEBUG(cmd); ++ VB2_DEBUG("flashrom cmd: %s\n", cmd); + r = system(cmd); + free(cmd); + if (r) diff --git a/vboot-utils-cflags.patch b/vboot-utils-cflags.patch deleted file mode 100644 index 32794e2..0000000 --- a/vboot-utils-cflags.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- vboot-utils-a1c5f7c/Makefile.orig 2017-06-04 13:24:39.666009720 +0100 -+++ vboot-utils-a1c5f7c/Makefile 2017-06-04 13:25:23.960977143 +0100 -@@ -158,7 +158,7 @@ - else - # FIRMWARE_ARCH not defined; assuming local compile. - CC ?= gcc --CFLAGS += -DCHROMEOS_ENVIRONMENT -Wall ${WERROR} ${DEBUG_FLAGS} -+CFLAGS += $(COMMON_FLAGS) -DCHROMEOS_ENVIRONMENT -Wall ${WERROR} ${DEBUG_FLAGS} - endif - - ifneq (${CUSTOM_MUSIC},) diff --git a/vboot-utils.spec b/vboot-utils.spec index 950caaa..d0792af 100644 --- a/vboot-utils.spec +++ b/vboot-utils.spec @@ -1,10 +1,11 @@ -%define gitshort a1c5f7c +%define gitshort 9b08a3c4 Name: vboot-utils -Version: 20170302 -Release: 1.git%{gitshort}%{?dist} +Version: 20230127 +Release: 10.git%{gitshort}%{?dist} Summary: Verified Boot Utility from Chromium OS -License: BSD +# Automatically converted from old format: BSD - review is highly recommended. +License: LicenseRef-Callaway-BSD URL: https://chromium.googlesource.com/chromiumos/platform/vboot_reference ExclusiveArch: %{arm} aarch64 %{ix86} x86_64 @@ -13,36 +14,31 @@ ExclusiveArch: %{arm} aarch64 %{ix86} x86_64 # following commands to generate the tarball: # git clone https://git.chromium.org/git/chromiumos/platform/vboot_reference.git # cd vboot_reference/ -# git archive --format=tar --prefix=vboot-utils-a1c5f7c/ a1c5f7c | xz > vboot-utils-a1c5f7c.tar.xz +# git archive --format=tar --prefix=vboot-utils-9b08a3c4/ 9b08a3c4 | xz > vboot-utils-9b08a3c4.tar.xz Source0: %{name}-%{gitshort}.tar.xz -## Patch0 disabled static building. -Patch0: vboot-utils-00-disable-static-linking.patch +# Fix VB2_DEBUG function usage +Patch0: vboot-utils-9b08a3c4.patch +# Fix linking error with USE_FLASHROM=0 +Patch1: flashrom-ensure-flashrom-symbols-are-not-loaded-if-U.patch -#make sure get the rpmbuild flags passed in -Patch1: vboot-utils-cflags.patch - - -BuildRequires: compat-openssl10-devel +BuildRequires: make +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: glibc-static +BuildRequires: openssl-devel BuildRequires: trousers-devel BuildRequires: libyaml-devel BuildRequires: xz-devel BuildRequires: libuuid-devel - -# for the test scripts -BuildRequires: python - %description Verified boot is a collection of utilities helpful for chromebook computer. Pack and sign the kernel, manage gpt partitions. %prep -%setup -q -n %{name}-%{gitshort} -%patch0 -p1 -b .nostatic -%patch1 -p1 -b .cflags - +%autosetup -p1 -n %{name}-%{gitshort} %build @@ -59,28 +55,137 @@ Pack and sign the kernel, manage gpt partitions. %endif -make V=1 ARCH=%{ARCH} COMMON_FLAGS="$RPM_OPT_FLAGS" +make V=1 ARCH=%{ARCH} COMMON_FLAGS="$RPM_OPT_FLAGS" USE_FLASHROM=0 %install -make install V=1 DESTDIR=%{buildroot}/usr ARCH=%{ARCH} COMMON_FLAGS="$RPM_OPT_FLAGS" +make install V=1 DESTDIR=%{buildroot} ARCH=%{ARCH} COMMON_FLAGS="$RPM_OPT_FLAGS" USE_FLASHROM=0 +mkdir -p %{buildroot}%{_datadir}/vboot/ +cp -rf tests/devkeys %{buildroot}%{_datadir}/vboot/ # Remove unneeded build artifacts rm -rf %{buildroot}/usr/lib/pkgconfig/ rm -rf %{buildroot}/usr/default/ - -## Tests are enabled but ignored (will not break the build). -## This is because tests fail in a chroot (mock) but work otherwise. -%check -make runtests || true - +rm -rf %{buildroot}/etc/default/ +rm -rf %{buildroot}/usr/share/vboot/bin/ +rm -f %{buildroot}/usr/bin/chromeos-tpm-recovery +rm -f %{buildroot}/usr/bin/crossystem +rm -f %{buildroot}/usr/bin/dev_debug_vboot +rm -f %{buildroot}/usr/bin/dumpRSAPublicKey +rm -f %{buildroot}/usr/bin/dump_fmap +rm -f %{buildroot}/usr/bin/dump_kernel_config +rm -f %{buildroot}/usr/bin/enable_dev_usb_boot +rm -f %{buildroot}/usr/bin/gbb_utility +rm -f %{buildroot}/usr/bin/tpm-nvsize +rm -f %{buildroot}/usr/bin/tpmc +rm -f %{buildroot}/usr/bin/vbutil_firmware +rm -f %{buildroot}/usr/bin/vbutil_key +rm -f %{buildroot}/usr/bin/vbutil_keyblock +rm -f %{buildroot}/usr/lib/libvboot_host.a %files %license LICENSE %doc README -%{_bindir}/* +%{_bindir}/futility +%{_bindir}/vbutil_kernel +%{_bindir}/cgpt +%{_datadir}/vboot/devkeys/ %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 20230127-10.git9b08a3c4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + +* Sat Jun 13 2026 Yaakov Selkowitz - 20230127-9.git9b08a3c4 +- Rebuilt for openssl 4.0 + +* Sat Jan 17 2026 Fedora Release Engineering - 20230127-8.git9b08a3c4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Fri Jul 25 2025 Fedora Release Engineering - 20230127-7.git9b08a3c4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Sun Jan 19 2025 Fedora Release Engineering - 20230127-6.git9b08a3c4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Wed Sep 04 2024 Miroslav Suchý - 20230127-5.git9b08a3c4 +- convert license to SPDX + +* Sat Jul 20 2024 Fedora Release Engineering - 20230127-4.git9b08a3c4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 20230127-3.git9b08a3c4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jul 22 2023 Fedora Release Engineering - 20230127-2.git9b08a3c4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jan 27 2023 Javier Martinez Canillas - 20230127-1.git9b08a3c4 +- Update to upstream snapshot 9b08a3c4 +- Drop `BuildRequires: flashrom-devel` since all tools depending on it are removed. + +* Sat Jan 21 2023 Fedora Release Engineering - 20220621-3.git61971455 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 20220621-2.git61971455 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Jun 21 2022 Dorinda Bassey - 20220621-1.git61971455 +- Fix VB2_DEBUG function usage +- New Upstream snapshot 61971455 +- Clean up spec file + +* Sat Jan 22 2022 Fedora Release Engineering - 20190823-9.git595108c0 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Sep 14 2021 Sahana Prasad - 20190823-8.git595108c0 +- Rebuilt with OpenSSL 3.0.0 + +* Fri Jul 23 2021 Fedora Release Engineering - 20190823-7.git595108c0 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 20190823-6.git595108c0 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 20190823-5.git595108c0 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sun Mar 01 2020 Peter Robinson - 20190823-4.git595108c0 +- Drop tests to drop python2 dep + +* Thu Feb 27 2020 Than Ngo - 20190823-3.git595108c +- Fix FTBFS + +* Fri Jan 31 2020 Fedora Release Engineering - 20190823-2.git595108c0 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Aug 26 2019 Peter Robinson 20190823.1.git595108c0 +- Rebase to upstream 595108c0 snapshot + +* Sat Jul 27 2019 Fedora Release Engineering - 20180531-4.git2cc35b0 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Feb 03 2019 Fedora Release Engineering - 20180531-3.git2cc35b0 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 20180531-2.git2cc35b0 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sun Jun 3 2018 Peter Robinson 20180531-1.2cc35b0 +- New upstream snapshot + +* Sun Mar 18 2018 Iryna Shcherbina - 20170302-5.gita1c5f7c +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Igor Gnatenko - 20170302-4.gita1c5f7c +- Escape macros in %%changelog + +* Thu Aug 03 2017 Fedora Release Engineering - 20170302-3.gita1c5f7c +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 20170302-2.gita1c5f7c +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Sun Jun 4 2017 Peter Robinson 20170302-1.gita1c5f7c - Move to newer upstream snapshot needed for some devices - Spec cleanups @@ -113,7 +218,7 @@ make runtests || true * Sat Feb 23 2013 Jon Disnard 20130222gite6cf2c2-2 - Put back wcohen's fixes for i686 builds. -- Put back the patch to fix bmpblk_utility.cc printf formating %ld -> %zu +- Put back the patch to fix bmpblk_utility.cc printf formating %%ld -> %%zu - Put back BR for gcc-c++ & libstdc++ * Fri Feb 22 2013 Jon Disnard 20130222gite6cf2c2-1