diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2018-01-17 20:16:09 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2018-01-22 23:09:12 +0100 |
commit | ac020196166b48371433772db645eab7de8c2ede (patch) | |
tree | 6a77a6b1969e7e6e85bdb7c0ce06fa308d7429b9 /tools/Makefile | |
parent | 727a1afb341b00cdb30c473a0edcb464fea75577 (diff) | |
download | u-boot-ac020196166b48371433772db645eab7de8c2ede.zip u-boot-ac020196166b48371433772db645eab7de8c2ede.tar.gz u-boot-ac020196166b48371433772db645eab7de8c2ede.tar.bz2 |
tools: provide a tool to convert a binary file to an include
For testing EFI disk management we need an in-memory image of
a disk.
The tool file2include converts a file to a C include. The file
is separated into strings of 8 bytes. Only the non-zero strings
are written to the include. The output format has been designed
to maintain readability.
#define EFI_ST_DISK_IMG { 0x00010000, { \
{0x000001b8, "\x94\x37\x69\xfc\x00\x00\x00\x00"}, /* .7i..... */ \
{0x000001c0, "\x02\x00\x83\x02\x02\x00\x01\x00"}, /* ........ */ \
{0x000001c8, "\x00\x00\x7f\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x000001f8, "\x00\x00\x00\x00\x00\x00\x55\xaa"}, /* ......U. */ \
...
{0x00006000, "\x48\x65\x6c\x6c\x6f\x20\x77\x6f"}, /* Hello wo */ \
{0x00006008, "\x72\x6c\x64\x21\x0a\x00\x00\x00"}, /* rld!.... */ \
{0, NULL} } }
As the disk image needed for testing contains mostly zeroes a high
compression ratio can be attained.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'tools/Makefile')
-rw-r--r-- | tools/Makefile | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/Makefile b/tools/Makefile index 571f571..b7d7d41 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -57,6 +57,8 @@ mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o hostprogs-y += dumpimage mkimage hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign +hostprogs-$(CONFIG_CMD_BOOTEFI_SELFTEST) += file2include + FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o # The following files are synced with upstream DTC. @@ -118,6 +120,7 @@ dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o mkimage-objs := $(dumpimage-mkimage-objs) mkimage.o fit_info-objs := $(dumpimage-mkimage-objs) fit_info.o fit_check_sign-objs := $(dumpimage-mkimage-objs) fit_check_sign.o +file2include-objs := file2include.o ifneq ($(CONFIG_MX23)$(CONFIG_MX28),) # Add CONFIG_MXS into host CFLAGS, so we can check whether or not register |