utility: add a simple tool for dumping the kernel config
Adds dump_kernel_config.c which takes in a file, reads it
all in to memory, then walks the blob until it can determine
the location of the kernel command line.
This is needed to allow the kernel config to inform legacy bootloader
configuration during autoupdates without packaging up dm-verity specific
options in some additional update metadata.
TEST=manual run over build_kernel_image.sh output
BUG=chromium-os:327
Review URL: http://codereview.chromium.org/2811029
diff --git a/utility/Makefile b/utility/Makefile
index 2f68649..cc3f551 100644
--- a/utility/Makefile
+++ b/utility/Makefile
@@ -16,6 +16,7 @@
DESTDIR ?= /usr/bin
TARGET_NAMES = dumpRSAPublicKey \
+ dump_kernel_config \
gbb_utility \
load_kernel_test \
signature_digest_utility \
@@ -33,6 +34,9 @@
${BUILD_ROOT}/dumpRSAPublicKey: dumpRSAPublicKey.c
$(CC) $(CFLAGS) $(INCLUDES) $< -o $@ -lcrypto
+${BUILD_ROOT}/dump_kernel_config: dump_kernel_config.c $(LIBS)
+ $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto
+
${BUILD_ROOT}/gbb_utility: gbb_utility.cc
$(CXX) -DWITH_UTIL_MAIN $(CFLAGS) $< -o $@