FreeBSD Bugzilla – Attachment 140992 Details for
Bug 187712
config(8) does not respect KERNCONFDIR
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
187712.patch
187712.patch (text/plain; charset=US-ASCII), 3.19 KB, created by
Alan Somers
on 2014-03-19 22:04:40 UTC
(
hide
)
Description:
187712.patch
Filename:
MIME Type:
Creator:
Alan Somers
Created:
2014-03-19 22:04:40 UTC
Size:
3.19 KB
patch
obsolete
>Index: Makefile.inc1 >=================================================================== >--- Makefile.inc1 (revision 263378) >+++ Makefile.inc1 (working copy) >@@ -1015,7 +1015,7 @@ > cd ${KRNLCONFDIR}; \ > PATH=${TMPPATH} \ > config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ >- ${KERNCONFDIR}/${_kernel} >+ -I ${KERNCONFDIR} ${KERNCONFDIR}/${_kernel} > .endif > .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) > @echo >Index: usr.sbin/config/config.8 >=================================================================== >--- usr.sbin/config/config.8 (revision 263378) >+++ usr.sbin/config/config.8 (working copy) >@@ -37,6 +37,7 @@ > .Sh SYNOPSIS > .Nm > .Op Fl CVgp >+.Op Fl I Ar path > .Op Fl d Ar destdir > .Ar SYSTEM_NAME > .Nm >@@ -69,6 +70,12 @@ > kernel image will contain full configuration files included > literally (preserving comments). > This flag is kept for backward compatibility. >+.It Fl I Ar path >+Search in >+.Ar path >+for any file included by the >+.Ic include >+directive. This option may be specified more than once. > .It Fl d Ar destdir > Use > .Ar destdir >Index: usr.sbin/config/config.h >=================================================================== >--- usr.sbin/config/config.h (revision 263378) >+++ usr.sbin/config/config.h (working copy) >@@ -144,6 +144,13 @@ > > STAILQ_HEAD(hint_head, hint) hints; > >+struct includepath { >+ char *path; >+ SLIST_ENTRY(includepath) path_next; >+}; >+ >+SLIST_HEAD(, includepath) includepath; >+ > /* > * Tag present in the kernelconf.tmlp template file. It's mandatory for those > * two strings to be the same. Otherwise you'll get into trouble. >Index: usr.sbin/config/lang.l >=================================================================== >--- usr.sbin/config/lang.l (revision 263378) >+++ usr.sbin/config/lang.l (working copy) >@@ -34,6 +34,7 @@ > #include <assert.h> > #include <ctype.h> > #include <err.h> >+#include <stdlib.h> > #include <string.h> > #include "y.tab.h" > #include "config.h" >@@ -257,6 +258,7 @@ > { > FILE *fp; > struct incl *in; >+ struct includepath* ipath; > char *fnamebuf; > > fnamebuf = NULL; >@@ -269,6 +271,17 @@ > } > } > if (fp == NULL) { >+ SLIST_FOREACH(ipath, &includepath, path_next) { >+ asprintf(&fnamebuf, "%s/%s", ipath->path, fname); >+ if (fnamebuf != NULL) { >+ fp = fopen(fnamebuf, "r"); >+ free(fnamebuf); >+ } >+ if (fp != NULL) >+ break; >+ } >+ } >+ if (fp == NULL) { > yyerror("cannot open included file"); > return (-1); > } >Index: usr.sbin/config/main.c >=================================================================== >--- usr.sbin/config/main.c (revision 263378) >+++ usr.sbin/config/main.c (working copy) >@@ -110,15 +110,25 @@ > int ch, len; > char *p; > char *kernfile; >+ struct includepath* ipath; > int printmachine; > > printmachine = 0; > kernfile = NULL; >- while ((ch = getopt(argc, argv, "Cd:gmpVx:")) != -1) >+ SLIST_INIT(&includepath); >+ while ((ch = getopt(argc, argv, "CI:d:gmpVx:")) != -1) > switch (ch) { > case 'C': > filebased = 1; > break; >+ case 'I': >+ ipath = (struct includepath *) \ >+ calloc(1, sizeof (struct includepath)); >+ if (ipath == NULL) >+ err(EXIT_FAILURE, "calloc"); >+ ipath->path = optarg; >+ SLIST_INSERT_HEAD(&includepath, ipath, path_next); >+ break; > case 'm': > printmachine = 1; > break;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 187712
:
140991
| 140992