diff options
| author | Andrew Morton <akpm@osdl.org> | 2003-09-09 10:19:11 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-09-09 10:19:11 -0700 |
| commit | f261ecb2f4e62a0d02925a4e549a2fe5dad503d8 (patch) | |
| tree | 43292be369289f9ade3c935b7e60493ebdca0ca8 /scripts | |
| parent | f5347e3042812699f550b30e81f0e3f96b401925 (diff) | |
[PATCH] Move ikconfig to /proc/config.gz
From: "Randy.Dunlap" <randy.dunlap@verizon.net>
The SuSE kernels place their ikconfig info at /proc/config.gz: in a
different place, and compressed. We thought it was a good idea to do it
that way in 2.6 as well.
- gzip the /proc config file, put it in /proc/config.gz;
- Based on a SuSE patch by Oliver Xymoron <oxymoron@waste.org>, which was
derived from a patch by Nicholas Leon <nicholas@binary9.net>
- change /proc/ikconfig/built_with to /proc/config_build_info;
- cleanup ikconfig init/exit entry points (static, __init, __exit);
- Makefile help from Sam Ravnborg;
DESC
ikconfig cleanup
EDESC
From: Stephen Hemminger <shemminger@osdl.org>
Simplify and cleanup the code:
- use single interface to seq_file where possible
- don't need to do as much of the /proc interface, only read
- use copy_to_user to avoid char at a time copy
- remove unneccesary globals
- use const char[] rather than const char * where possible.
Didn't change the version since interface doesn't change.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile | 2 | ||||
| -rw-r--r-- | scripts/bin2c.c | 27 | ||||
| -rwxr-xr-x | scripts/mkconfigs | 10 |
3 files changed, 32 insertions, 7 deletions
diff --git a/scripts/Makefile b/scripts/Makefile index 007f3b10b659..c03384ce37ae 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -9,7 +9,7 @@ # conmakehash: Create arrays for initializing the kernel console tables host-progs := fixdep split-include conmakehash docproc kallsyms modpost \ - mk_elfconfig pnmtologo + mk_elfconfig pnmtologo bin2c always := $(host-progs) empty.o modpost-objs := modpost.o file2alias.o diff --git a/scripts/bin2c.c b/scripts/bin2c.c new file mode 100644 index 000000000000..3f900a1657a5 --- /dev/null +++ b/scripts/bin2c.c @@ -0,0 +1,27 @@ +#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\nconst int %s_size = %d;\n", argv[1], total); + + return 0; +} diff --git a/scripts/mkconfigs b/scripts/mkconfigs index 7d5a6c214f1e..fc9c3dd978bc 100755 --- a/scripts/mkconfigs +++ b/scripts/mkconfigs @@ -66,15 +66,13 @@ echo \ * */" -echo "static char *ikconfig_built_with =" +echo "#ifdef CONFIG_IKCONFIG_PROC" +echo "static char const ikconfig_build_info[] =" echo " \"`uname -s` `uname -r` `uname -v` `uname -m`\";" +echo "#endif" echo kernel_version $makefile -echo "#ifdef CONFIG_IKCONFIG_PROC" -echo "static char *ikconfig_config = " -echo "#else" -echo "static char *ikconfig_config __initdata __attribute__((unused)) = " -echo "#endif" +echo "static char const ikconfig_config[] __attribute__((unused)) = " echo "\"CONFIG_BEGIN=n\\n\\" echo "`cat $config | sed 's/\"/\\\\\"/g' | grep "^#\? \?CONFIG_" | awk '{ print $0 "\\\\n\\\\" }' `" echo "CONFIG_END=n\\n\";" |
