From 215b405ae638b5d71345d9eba2ef41e7a81fdc90 Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Mon, 8 Nov 2021 17:33:02 +0000 Subject: Interceptor: initial version This adds the interceptor and its runtime library in a first draft version. The interceptor is typically called like $ interceptor [interceptor_args] [--] program [program_args] It will locate the corresponding libinterceptor runtime library, set some environment variables (mostly based on passed arguments) and spawn the original process with the runtime library LD_PRELOAD'ed. The runtime library will intercept `execve` libc calls but nothing is happening with them for now. A sample command that builds the Android common kernel: $ interceptor -- BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh Note, setting environment variables after -- is supported (and encouraged). Bug: 205577427 Signed-off-by: Matthias Maennich Change-Id: Ia258a585078dd8bdda2799734cc0796e4d4cec82 --- build-prebuilts.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'build-prebuilts.sh') diff --git a/build-prebuilts.sh b/build-prebuilts.sh index f300e3e..ec50dc6 100755 --- a/build-prebuilts.sh +++ b/build-prebuilts.sh @@ -35,6 +35,7 @@ EOF e2fsck e2fsdroid img2simg + interceptor lpmake lz4 mkbootfs @@ -52,6 +53,7 @@ EOF SOONG_LIBRARIES=( libcrypto-host.so libelf.so + libinterceptor.so ) binaries="${SOONG_BINARIES[@]/#/${SOONG_HOST_OUT}/bin/}" -- cgit v1.2.3