diff options
author | Joel Kitching <kitching@google.com> | 2019-09-19 17:11:46 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-02 21:48:17 +0000 |
commit | 592d9ee007d982bf3b9b687b3589899702fc7b1d (patch) | |
tree | 695be22bb08c9c778132553c8af286eea9b88fa2 | |
parent | 873433516b3456222f10f726a000ae68c048b1ae (diff) | |
download | vboot-592d9ee007d982bf3b9b687b3589899702fc7b1d.tar.gz |
vboot: remove linktest files
Remove linktest files, which were previously used to ensure that
firmware lib doesn't rely on outside libraries.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: I694ca51007b05213d4b105f183bb34ad25e2ddbd
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1813123
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
-rw-r--r-- | Makefile | 30 | ||||
-rw-r--r-- | firmware/linktest/main.c | 72 | ||||
-rw-r--r-- | host/linktest/extern.c | 51 | ||||
-rw-r--r-- | host/linktest/main.c | 31 |
4 files changed, 4 insertions, 180 deletions
@@ -856,16 +856,8 @@ endif ${FWLIB21_OBJS}: INCLUDES += -Ifirmware/lib21/include -# Linktest ensures firmware lib doesn't rely on outside libraries -${BUILD}/firmware/linktest/main: ${FWLIB} -${BUILD}/firmware/linktest/main: LIBS = ${FWLIB} -TEST_OBJS += ${BUILD}/firmware/linktest/main.o - -.PHONY: fwlinktest -fwlinktest: ${BUILD}/firmware/linktest/main - .PHONY: fwlib -fwlib: $(if ${FIRMWARE_ARCH},${FWLIB},fwlinktest) +fwlib: $(if ${FIRMWARE_ARCH},${FWLIB},) ${FWLIB}: ${FWLIB_OBJS} ${FWLIB2X_OBJS} ${FWLIB20_OBJS} @${PRINTF} " RM $(subst ${BUILD}/,,$@)\n" @@ -903,14 +895,8 @@ ${FWLIB21}: ${FWLIB2X_OBJS} ${FWLIB21_OBJS} # ---------------------------------------------------------------------------- # Host library(s) -# Link tests for local utilities -${BUILD}/host/linktest/main: ${UTILLIB} -${BUILD}/host/linktest/main: LIBS = ${UTILLIB} -TEST_OBJS += ${BUILD}/host/linktest/main.o - .PHONY: utillib -utillib: ${UTILLIB} \ - ${BUILD}/host/linktest/main +utillib: ${UTILLIB} # TODO: better way to make .a than duplicating this recipe each time? ${UTILLIB}: ${UTILLIB_OBJS} ${FWLIB_OBJS} ${FWLIB2X_OBJS} ${FWLIB20_OBJS} \ @@ -920,15 +906,8 @@ ${UTILLIB}: ${UTILLIB_OBJS} ${FWLIB_OBJS} ${FWLIB2X_OBJS} ${FWLIB20_OBJS} \ @${PRINTF} " AR $(subst ${BUILD}/,,$@)\n" ${Q}ar qc $@ $^ -# 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 -hostlib: ${HOSTLIB} \ - $(if ${NO_BUILD_TOOLS},,${BUILD}/host/linktest/extern) +hostlib: ${HOSTLIB} # TODO: better way to make .a than duplicating this recipe each time? ${HOSTLIB}: ${HOSTLIB_OBJS} @@ -1138,7 +1117,6 @@ ${BUILD}/utility/pad_digest_utility: LDLIBS += ${CRYPTO_LIBS} ${BUILD}/utility/signature_digest_utility: LDLIBS += ${CRYPTO_LIBS} ${BUILD}/utility/verify_data: LDLIBS += ${CRYPTO_LIBS} -${BUILD}/host/linktest/main: LDLIBS += ${CRYPTO_LIBS} ${BUILD}/tests/vb20_common2_tests: LDLIBS += ${CRYPTO_LIBS} ${BUILD}/tests/vb20_common3_tests: LDLIBS += ${CRYPTO_LIBS} ${BUILD}/tests/verify_kernel: LDLIBS += ${CRYPTO_LIBS} @@ -1332,7 +1310,7 @@ coverage_init: test_setup coverage_html: lcov -c -d . -b . -o ${COV_INFO}.tests lcov -a ${COV_INFO}.initial -a ${COV_INFO}.tests -o ${COV_INFO}.total - lcov -r ${COV_INFO}.total '/usr/*' '*/linktest/*' -o ${COV_INFO}.local + lcov -r ${COV_INFO}.total '/usr/*' -o ${COV_INFO}.local genhtml ${COV_INFO}.local -o ${BUILD}/coverage # Generate addtional coverage stats just for firmware subdir, because the stats # for the whole project don't include subdirectory summaries. This will print diff --git a/firmware/linktest/main.c b/firmware/linktest/main.c deleted file mode 100644 index 0236b8d9..00000000 --- a/firmware/linktest/main.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "2sysincludes.h" -#include "cgptlib.h" -#include "load_kernel_fw.h" -#include "secdata_tpm.h" -#include "tlcl.h" -#include "vboot_common.h" -#include "vboot_kernel.h" - -int main(void) -{ - /* cgptlib.h */ - GptInit(0); - GptNextKernelEntry(0, 0, 0); - GptUpdateKernelEntry(0, 0); - - /* load_kernel_fw.h */ - LoadKernel(0, 0); - - /* secdata_tpm.h */ - RollbackKernelRead(0); - RollbackKernelWrite(0); - RollbackKernelLock(0); - - /* tlcl.h */ - TlclStartup(); - TlclResume(); - TlclSelfTestFull(); - TlclContinueSelfTest(); - TlclDefineSpace(0, 0, 0); - TlclUndefineSpace(0); - TlclWrite(0, 0, 0); - TlclRead(0, 0, 0); - TlclWriteLock(0); - TlclReadLock(0); - TlclIsOwned(); - TlclForceClear(); - TlclSetEnable(); - TlclSetDeactivated(0); - TlclGetFlags(0, 0, 0); - TlclSetGlobalLock(); - TlclExtend(0, 0, 0); - TlclGetPermissions(0, 0); -#ifndef TPM2_MODE - TlclAssertPhysicalPresence(); - TlclSetNvLocked(); - TlclClearEnable(); -#endif - - /* vboot_api.h - entry points INTO vboot_reference */ - VbSelectAndLoadKernel(0, 0, 0); - VbVerifyMemoryBootImage(0, 0, 0, 0, 0); - - /* vboot_common.h */ - GetPublicKeyData(0); - GetPublicKeyDataC(0); - GetSignatureData(0); - GetSignatureDataC(0); - VerifyPublicKeyInside(0, 0, 0); - VerifySignatureInside(0, 0, 0); - PublicKeyInit(0, 0, 0); - PublicKeyCopy(0, 0); - VbSharedDataInit(0, 0); - VbSharedDataReserve(0, 0); - VbSharedDataSetKernelKey(0, 0); - - return 0; -} diff --git a/host/linktest/extern.c b/host/linktest/extern.c deleted file mode 100644 index 85c55a1a..00000000 --- a/host/linktest/extern.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/* - * This tests for the presence of those functions actually used by userspace - * apps that are not part of firmware or vboot_reference. - */ - -#include "crossystem.h" -#include "tlcl.h" -#include "vboot_host.h" - -/* TODO(crbug.com/318536) */ -const char* progname = ""; -const char* command = ""; -void (*uuid_generator)(uint8_t* buffer) = NULL; - -int main(void) -{ - /* crossystem.h */ - VbGetSystemPropertyInt(0); - VbGetSystemPropertyString(0, 0, 0); - VbSetSystemPropertyInt(0, 0); - - /* tlcl.h */ - TlclGetOwnership(0); - TlclGetRandom(0, 0, 0); - TlclLibClose(); - TlclLibInit(); - TlclRead(0, 0, 0); - - /* vboot_host.h */ - CgptAdd(0); - CgptBoot(0); - CgptCreate(0); - CgptEdit(0); - CgptGetBootPartitionNumber(0); - CgptGetNumNonEmptyPartitions(0); - CgptGetPartitionDetails(0); - CgptPrioritize(0); - CgptSetAttributes(0); - FindKernelConfig(0, 0); - GuidEqual(0, 0); - GuidIsZero(0); - GuidToStr(0, 0, 0); - StrToGuid(0, 0); - - return 0; -} diff --git a/host/linktest/main.c b/host/linktest/main.c deleted file mode 100644 index aca2c745..00000000 --- a/host/linktest/main.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/* - * This tests for the presence of functions used by vboot_reference utilities. - */ - -#include <stdio.h> - -#include "host_common.h" -#include "file_keys.h" -#include "signature_digest.h" - -int main(void) -{ - /* host_misc.h */ - ReadFile(0, 0); - WriteFile(0, 0, 0); - - /* file_keys.h */ - DigestFile(0, 0, 0, 0); - - /* signature_digest.h */ - PrependDigestInfo(0, 0); - SignatureDigest(0, 0, 0); - SignatureBuf(0, 0, 0, 0); - - return 0; -} |