diff options
-rw-r--r-- | sys/conf/Makefile.i386 | 7 | ||||
-rw-r--r-- | sys/conf/Makefile.powerpc | 7 | ||||
-rw-r--r-- | sys/i386/conf/Makefile.i386 | 7 | ||||
-rw-r--r-- | usr.sbin/config/config.8 | 7 | ||||
-rw-r--r-- | usr.sbin/config/main.c | 38 |
5 files changed, 57 insertions, 9 deletions
diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386 index c4aaf99..12eb799 100644 --- a/sys/conf/Makefile.i386 +++ b/sys/conf/Makefile.i386 @@ -1,6 +1,7 @@ +# Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.82 1996/05/07 23:19:46 wosch Exp $ +# $Id: Makefile.i386,v 1.83 1996/05/31 01:01:24 peter Exp $ # # Makefile for FreeBSD # @@ -57,9 +58,9 @@ DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< -SYSTEM_CFILES= ioconf.c param.c vnode_if.c +SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c SYSTEM_SFILES= ${I386}/i386/locore.s -SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o +SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc index c4aaf99..12eb799 100644 --- a/sys/conf/Makefile.powerpc +++ b/sys/conf/Makefile.powerpc @@ -1,6 +1,7 @@ +# Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.82 1996/05/07 23:19:46 wosch Exp $ +# $Id: Makefile.i386,v 1.83 1996/05/31 01:01:24 peter Exp $ # # Makefile for FreeBSD # @@ -57,9 +58,9 @@ DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< -SYSTEM_CFILES= ioconf.c param.c vnode_if.c +SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c SYSTEM_SFILES= ${I386}/i386/locore.s -SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o +SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o diff --git a/sys/i386/conf/Makefile.i386 b/sys/i386/conf/Makefile.i386 index c4aaf99..12eb799 100644 --- a/sys/i386/conf/Makefile.i386 +++ b/sys/i386/conf/Makefile.i386 @@ -1,6 +1,7 @@ +# Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.82 1996/05/07 23:19:46 wosch Exp $ +# $Id: Makefile.i386,v 1.83 1996/05/31 01:01:24 peter Exp $ # # Makefile for FreeBSD # @@ -57,9 +58,9 @@ DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< -SYSTEM_CFILES= ioconf.c param.c vnode_if.c +SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c SYSTEM_SFILES= ${I386}/i386/locore.s -SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o +SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o diff --git a/usr.sbin/config/config.8 b/usr.sbin/config/config.8 index 32cb360..35de364 100644 --- a/usr.sbin/config/config.8 +++ b/usr.sbin/config/config.8 @@ -159,6 +159,13 @@ the problems in the configuration file should be corrected and should be run again. Attempts to compile a system that had configuration errors are likely to fail. +.Pp +If the option "INCLUDE_CONFIG_FILE" is used in the configuration file the +entire input file is embedded in the new kernel. This means that +.Xr strings 1 +can be used to extract it from a kernel. +.Pp +strings | grep ___ will print just the configure information. .Sh FILES .Bl -tag -width /sys/i386/conf/Makefile.i386 -compact .It Pa /sys/conf/files diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c index a203769..76f9a55 100644 --- a/usr.sbin/config/main.c +++ b/usr.sbin/config/main.c @@ -199,6 +199,7 @@ usage: fputs("usage: config [-gpn] sysname\n", stderr); makefile(); /* build Makefile */ headers(); /* make a lot of .h files */ swapconf(); /* swap config files */ + configfile(); /* put config file into kernel*/ printf("Kernel build directory is %s\n", p); exit(0); } @@ -332,6 +333,43 @@ path(file) return (cp); } +configfile() +{ + FILE *fi, *fo; + char *p; + int i; + + fi = fopen(PREFIX,"r"); + if(!fi) { + perror(PREFIX); + exit(2); + } + fo = fopen(p=path("config.c"),"w"); + if(!fo) { + perror(p); + exit(2); + } + fprintf(fo,"#ifdef INCLUDE_CONFIG_FILE \n"); + fprintf(fo,"static char *config = \"\n"); + fprintf(fo,"START CONFIG FILE %s\n___",PREFIX); + while (EOF != (i=getc(fi))) { + if(i == '\n') { + fprintf(fo,"\n___"); + } else if(i == '\"') { + fprintf(fo,"\\\""); + } else if(i == '\\') { + fprintf(fo,"\\\\"); + } else { + putc(i,fo); + } + } + fprintf(fo,"\nEND CONFIG FILE %s\n",PREFIX); + fprintf(fo,"\";\n"); + fprintf(fo,"\n#endif INCLUDE_CONFIG_FILE"); + fclose(fi); + fclose(fo); +} + /* * moveifchanged -- * compare two files; rename if changed. |