Clean up some obsolete stuff. config -r has not been needed since around
FreeBSD 3.x or so when the 'make depend' picked up the opt_foo.h files. Convert warnings into actual errors in the hope that buildkernel users will pay more attention. :-(
This commit is contained in:
parent
e78411656b
commit
b8e39fd14a
@ -40,7 +40,7 @@
|
||||
.Nd build system configuration files
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl gpr
|
||||
.Op Fl gp
|
||||
.Op Fl d Ar destdir
|
||||
.Ar SYSTEM_NAME
|
||||
.Sh DESCRIPTION
|
||||
@ -93,8 +93,6 @@ If two or more
|
||||
options are supplied,
|
||||
.Nm
|
||||
configures a system for high resolution profiling.
|
||||
.It Fl r
|
||||
Remove the old compile directory (see below).
|
||||
.It Ar SYSTEM_NAME
|
||||
Specify the name of the system configuration file
|
||||
containing device specifications, configuration options
|
||||
@ -117,9 +115,6 @@ or the one given with the
|
||||
.Fl d
|
||||
option
|
||||
as necessary and places all output files there.
|
||||
If the output directory already exists and the
|
||||
.Fl r
|
||||
flag was specified, it will be removed first.
|
||||
The output of
|
||||
.Nm
|
||||
consists of a number of files; for the
|
||||
|
@ -165,7 +165,7 @@ Config_spec:
|
||||
|
||||
System_spec:
|
||||
CONFIG System_id System_parameter_list
|
||||
= { warnx("line %d: root/dump/swap specifications obsolete", yyline);}
|
||||
= { errx(1, "line %d: root/dump/swap specifications obsolete", yyline);}
|
||||
|
|
||||
CONFIG System_id
|
||||
;
|
||||
@ -209,11 +209,8 @@ Option:
|
||||
*/
|
||||
op->op_line = yyline;
|
||||
opt = op;
|
||||
if ((s = strchr(op->op_name, '='))) {
|
||||
warnx("line %d: The `=' in options should not be quoted", yyline);
|
||||
*s = '\0';
|
||||
op->op_value = ns(s + 1);
|
||||
}
|
||||
if ((s = strchr(op->op_name, '=')))
|
||||
errx(1, "line %d: The `=' in options should not be quoted", yyline);
|
||||
} |
|
||||
Save_id EQUALS Opt_value
|
||||
= {
|
||||
@ -295,7 +292,7 @@ Device_spec:
|
||||
cur.d_name = $2;
|
||||
cur.d_count = $3;
|
||||
if (cur.d_count == 0)
|
||||
warnx("line %d: devices with zero units are not likely to be correct", yyline);
|
||||
errx(1, "line %d: devices with zero units are not likely to be correct", yyline);
|
||||
} ;
|
||||
|
||||
%%
|
||||
@ -304,7 +301,7 @@ static void
|
||||
yyerror(char *s)
|
||||
{
|
||||
|
||||
warnx("line %d: %s", yyline + 1, s);
|
||||
errx(1, "line %d: %s", yyline + 1, s);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -72,7 +72,6 @@ char * PREFIX;
|
||||
char destdir[MAXPATHLEN];
|
||||
char srcdir[MAXPATHLEN];
|
||||
|
||||
static int no_config_clobber = TRUE;
|
||||
int debugging;
|
||||
int profiling;
|
||||
|
||||
@ -92,7 +91,7 @@ main(int argc, char **argv)
|
||||
int ch, len;
|
||||
char *p;
|
||||
|
||||
while ((ch = getopt(argc, argv, "d:gprn")) != -1)
|
||||
while ((ch = getopt(argc, argv, "d:gp")) != -1)
|
||||
switch (ch) {
|
||||
case 'd':
|
||||
if (*destdir == '\0')
|
||||
@ -106,14 +105,6 @@ main(int argc, char **argv)
|
||||
case 'p':
|
||||
profiling++;
|
||||
break;
|
||||
case 'n':
|
||||
/* no_config_clobber is now true by default, no-op */
|
||||
fprintf(stderr,
|
||||
"*** Using obsolete config option '-n' ***\n");
|
||||
break;
|
||||
case 'r':
|
||||
no_config_clobber = FALSE;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
@ -142,23 +133,8 @@ main(int argc, char **argv)
|
||||
if (mkdir(p, 0777))
|
||||
err(2, "%s", p);
|
||||
}
|
||||
else if ((buf.st_mode & S_IFMT) != S_IFDIR) {
|
||||
else if ((buf.st_mode & S_IFMT) != S_IFDIR)
|
||||
errx(2, "%s isn't a directory", p);
|
||||
}
|
||||
else if (!no_config_clobber) {
|
||||
char tmp[strlen(p) + 8];
|
||||
|
||||
fprintf(stderr, "Removing old directory %s: ", p);
|
||||
fflush(stderr);
|
||||
snprintf(tmp, sizeof(tmp), "rm -rf %s", p);
|
||||
if (system(tmp)) {
|
||||
fprintf(stderr, "Failed!\n");
|
||||
err(2, "%s", tmp);
|
||||
}
|
||||
fprintf(stderr, "Done.\n");
|
||||
if (mkdir(p, 0777))
|
||||
err(2, "%s", p);
|
||||
}
|
||||
|
||||
dtab = NULL;
|
||||
if (yyparse())
|
||||
@ -214,7 +190,7 @@ get_srcdir(void)
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: config [-gpr] [-d destdir] sysname\n");
|
||||
fprintf(stderr, "usage: config [-gp] [-d destdir] sysname\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ headers(void)
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
if ((dp->d_type & TYPEMASK) == DEVICE) {
|
||||
if (!(dp->d_type & DEVDONE))
|
||||
printf("Warning: device \"%s\" is unknown\n",
|
||||
errx(1, "Error: device \"%s\" is unknown",
|
||||
dp->d_name);
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ makefile(void)
|
||||
else if (strncmp(line, "%VERSREQ=", sizeof("%VERSREQ=") - 1) == 0) {
|
||||
versreq = atoi(line + sizeof("%VERSREQ=") - 1);
|
||||
if (versreq != CONFIGVERS) {
|
||||
fprintf(stderr, "WARNING: version of config(8) does not match kernel!\n");
|
||||
fprintf(stderr, "ERROR: version of config(8) does not match kernel!\n");
|
||||
fprintf(stderr, "config version = %d, ", CONFIGVERS);
|
||||
fprintf(stderr, "version required = %d\n\n", versreq);
|
||||
fprintf(stderr, "Make sure that /usr/src/usr.sbin/config is in sync\n");
|
||||
@ -200,6 +200,7 @@ makefile(void)
|
||||
fprintf(stderr, "file against the GENERIC or LINT config files for\n");
|
||||
fprintf(stderr, "changes in config syntax, or option/device naming\n");
|
||||
fprintf(stderr, "conventions\n\n");
|
||||
exit(1);
|
||||
}
|
||||
} else
|
||||
fprintf(stderr,
|
||||
|
Loading…
Reference in New Issue
Block a user