diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-07-27 02:36:23 -0600 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2006-07-27 02:36:23 -0600 |
commit | 283261998a9846019d898bc454b363e4aaf3d181 (patch) | |
tree | a4af6da4c5a2c6f7669d918c1f07dc68d6aa0ab2 /util |
kexec-tools-1.101
- Initial import into git
- initial nbi image formage support
- ppc32 initial register setting fixes.
- gzipped multiboot file support
Diffstat (limited to 'util')
-rw-r--r-- | util/Makefile | 4 | ||||
-rw-r--r-- | util/bin-to-hex.c | 25 |
2 files changed, 29 insertions, 0 deletions
diff --git a/util/Makefile b/util/Makefile new file mode 100644 index 0000000..d6e8e79 --- /dev/null +++ b/util/Makefile @@ -0,0 +1,4 @@ +BIN_TO_HEX:= $(OBJDIR)/bin/bin-to-hex +$(BIN_TO_HEX): util/bin-to-hex.c + mkdir -p $(@D) + $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@ diff --git a/util/bin-to-hex.c b/util/bin-to-hex.c new file mode 100644 index 0000000..5906f93 --- /dev/null +++ b/util/bin-to-hex.c @@ -0,0 +1,25 @@ +#include <stdio.h> + +int main(int argc, char **argv) +{ + int c; + int i; + const char *name = argv[1]; + printf("#include <stddef.h>\n"); + printf("const unsigned char %s[] = {\n", name); + i = 0; + while((c = getchar()) != EOF) { + if ((i % 16) != 0) { + putchar(' '); + } + printf("0x%02x,", c); + i++; + if ((i %16) == 0) { + putchar('\n'); + } + } + putchar('\n'); + printf("};\n"); + printf("size_t %s_size = sizeof(%s);\n", name, name); + return 0; +} |