diff --git a/vboot-utils-00-disable-static-linking.patch b/vboot-utils-00-disable-static-linking.patch new file mode 100644 index 0000000..4d02711 --- /dev/null +++ b/vboot-utils-00-disable-static-linking.patch @@ -0,0 +1,42 @@ +--- 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-2cc35b0.tar.xz b/vboot-utils-2cc35b0.tar.xz new file mode 100644 index 0000000..85b334b Binary files /dev/null and b/vboot-utils-2cc35b0.tar.xz differ diff --git a/vboot-utils-cflags.patch b/vboot-utils-cflags.patch new file mode 100644 index 0000000..32794e2 --- /dev/null +++ b/vboot-utils-cflags.patch @@ -0,0 +1,11 @@ +--- 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 new file mode 100644 index 0000000..4b034bc --- /dev/null +++ b/vboot-utils.spec @@ -0,0 +1,49 @@ +%define _default_patch_fuzz 2 + +Name: vboot-utils +Version: 20180531 +Release: 3 +Summary: Chromium OS verified boot utility +License: BSD +URL: https://chromium.googlesource.com/chromiumos/platform/vboot_reference +ExclusiveArch: aarch64 x86_64 +# https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/2cc35b0f31fe1cf69ce6781e7d502f07c64c93c9.tar.gz +Source0: %{name}-2cc35b0.tar.xz +Patch0001: vboot-utils-00-disable-static-linking.patch +Patch0002: vboot-utils-cflags.patch + +BuildRequires: gcc-c++ openssl-devel trousers-devel libyaml-devel xz-devel libuuid-devel python2 + +%description +Verify boot is a collection of utilities for chromebook computers. Package and sign the kernel and +manage gpt partitions. + +%prep +%autosetup -n vboot-utils-2cc35b0 -p1 + +%build +%ifarch aarch64 +%global ARCH arm +%endif + +%ifarch x86_64 +%global ARCH x86_64 +%endif + +%make_build V=1 ARCH=%{ARCH} COMMON_FLAGS="$RPM_OPT_FLAGS" + +%install +%make_install V=1 DESTDIR=%{buildroot}/usr ARCH=%{ARCH} COMMON_FLAGS="$RPM_OPT_FLAGS" + +%check +make runtests || true + +%files +%doc README LICENSE +%{_bindir}/* +/usr/default/ +/usr/lib/pkgconfig/ + +%changelog +* Wed Jan 8 2020 fengbing - 20180531-3 +- Package init