mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
kbuild: move bin2c back to scripts/ from scripts/basic/
Commit8370edea81
("bin2c: move bin2c in scripts/basic") moved bin2c to the scripts/basic/ directory, incorrectly stating "Kexec wants to use bin2c and it wants to use it really early in the build process. See arch/x86/purgatory/ code in later patches." Commitbdab125c93
("Revert "kexec/purgatory: Add clean-up for purgatory directory"") and commitd6605b6bbe
("x86/build: Remove unnecessary preparation for purgatory") removed the redundant purgatory build magic entirely. That means that the move of bin2c was unnecessary in the first place. fixdep is the only host program that deserves to sit in the scripts/basic/ directory. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
b56e535509
commit
c417fbce98
10 changed files with 7 additions and 10 deletions
36
scripts/bin2c.c
Normal file
36
scripts/bin2c.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Unloved program to convert a binary on stdin to a C include on stdout
|
||||
*
|
||||
* Jan 1999 Matt Mackall <mpm@selenic.com>
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ch, total = 0;
|
||||
|
||||
if (argc > 1)
|
||||
printf("const char %s[] %s=\n",
|
||||
argv[1], argc > 2 ? argv[2] : "");
|
||||
|
||||
do {
|
||||
printf("\t\"");
|
||||
while ((ch = getchar()) != EOF) {
|
||||
total++;
|
||||
printf("\\x%02x", ch);
|
||||
if (total % 16 == 0)
|
||||
break;
|
||||
}
|
||||
printf("\"\n");
|
||||
} while (ch != EOF);
|
||||
|
||||
if (argc > 1)
|
||||
printf("\t;\n\n#include <linux/types.h>\n\nconst size_t %s_size = %d;\n",
|
||||
argv[1], total);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue