Made booting with -a work for all configurations. Previously it
only worked for configurations with "swap on generic". usr.sbin/config/config.y: - ignore all "swap [on] device ...' specifications except for warning about them. They haven't done anything related to swap for almost 4 years, and were previously silently ignored, except for "swap on generic" which stopped swap${KERNEL}.c from being generated. Code to support swapping is now deader than before. usr.sbin/config/mkswapconf.c: - don't generate a dummy setconf() function in swap${KERNEL}.c. sys/i386/conf/files.i386: - swapgeneric.c is now standard. It should be merged into autoconf.c so that it doesn't conflict with swap${KERNEL}.c for kernels named "generic". sys/i386/i386/autoconf.c: - don't call setroot() for mfs roots. Since setroot() doesn't do anything harmful, this was just a waste of time, except possibly for booting with -a it may have helped prevent an undesireable call to setconf() by finding a bogus rootdev. - honor -a for ffs roots. -a now overrides all other ways of specifying the root device. Previously, -r had precedence over -a, and the -a handling was usually a no-op. - don't honor -a for non-ffs roots, since it would currently just get in the way of a clean panic. sys/i386/i386/swapgeneric.c: - don't declare things that are now always declared in swap${KERNEL}.c. Don't decide things that are now decided in autoconf.c. Code to support the "generic" case is now dead instead of useless.
This commit is contained in:
parent
a76ec619d7
commit
e05da2e941
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
|
||||
* $Id: autoconf.c,v 1.110 1998/10/26 07:05:34 bde Exp $
|
||||
* $Id: autoconf.c,v 1.111 1999/01/19 00:10:59 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -333,19 +333,9 @@ cpu_rootconf()
|
||||
if (!mountrootfsname) {
|
||||
if (bootverbose)
|
||||
printf("Considering MFS root f/s.\n");
|
||||
if (mfs_getimage()) {
|
||||
if (mfs_getimage())
|
||||
mountrootfsname = "mfs";
|
||||
/*
|
||||
* Ignore the -a flag if this kernel isn't compiled
|
||||
* with a generic root/swap configuration: if we skip
|
||||
* setroot() and we aren't a generic kernel, chaos
|
||||
* will ensue because setconf() will be a no-op.
|
||||
* (rootdev is always initialized to NODEV in a
|
||||
* generic configuration, so we test for that.)
|
||||
*/
|
||||
if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV)
|
||||
setroot();
|
||||
} else if (bootverbose)
|
||||
else if (bootverbose)
|
||||
printf("No MFS image available as root f/s.\n");
|
||||
}
|
||||
#endif
|
||||
@ -370,15 +360,9 @@ cpu_rootconf()
|
||||
mountrootfsname = "ufs";
|
||||
if (bootverbose)
|
||||
printf("Considering FFS root f/s.\n");
|
||||
/*
|
||||
* Ignore the -a flag if this kernel isn't compiled
|
||||
* with a generic root/swap configuration: if we skip
|
||||
* setroot() and we aren't a generic kernel, chaos
|
||||
* will ensue because setconf() will be a no-op.
|
||||
* (rootdev is always initialized to NODEV in a
|
||||
* generic configuration, so we test for that.)
|
||||
*/
|
||||
if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV)
|
||||
if (boothowto & RB_ASKNAME)
|
||||
setconf();
|
||||
else
|
||||
setroot();
|
||||
}
|
||||
#endif
|
||||
@ -386,8 +370,6 @@ cpu_rootconf()
|
||||
if (!mountrootfsname) {
|
||||
panic("Nobody wants to mount my root for me");
|
||||
}
|
||||
|
||||
setconf();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.i386,v 1.143 1999/04/11 03:40:10 grog Exp $
|
||||
# $Id: Makefile.i386,v 1.144 1999/04/13 18:25:08 peter Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -17,7 +17,7 @@
|
||||
#
|
||||
|
||||
# Which version of config(8) is required.
|
||||
%VERSREQ= 300011
|
||||
%VERSREQ= 300012
|
||||
|
||||
KERNFORMAT?= elf
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.i386,v 1.143 1999/04/11 03:40:10 grog Exp $
|
||||
# $Id: Makefile.i386,v 1.144 1999/04/13 18:25:08 peter Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -17,7 +17,7 @@
|
||||
#
|
||||
|
||||
# Which version of config(8) is required.
|
||||
%VERSREQ= 300011
|
||||
%VERSREQ= 300012
|
||||
|
||||
KERNFORMAT?= elf
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# This file tells config what files go into building a kernel,
|
||||
# files marked standard are always included.
|
||||
#
|
||||
# $Id: files.i386,v 1.233 1999/04/07 03:55:36 msmith Exp $
|
||||
# $Id: files.i386,v 1.234 1999/04/13 19:38:10 peter Exp $
|
||||
#
|
||||
# The long compile-with and dependency lines are required because of
|
||||
# limitations in config: backslash-newline doesn't work in strings, and
|
||||
@ -96,6 +96,7 @@ i386/i386/pmap.c standard
|
||||
i386/i386/procfs_machdep.c standard
|
||||
i386/i386/simplelock.s optional smp
|
||||
i386/i386/support.s standard
|
||||
i386/i386/swapgeneric.c standard
|
||||
i386/i386/swtch.s standard
|
||||
i386/i386/sys_machdep.c standard
|
||||
i386/i386/trap.c standard
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.i386,v 1.143 1999/04/11 03:40:10 grog Exp $
|
||||
# $Id: Makefile.i386,v 1.144 1999/04/13 18:25:08 peter Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -17,7 +17,7 @@
|
||||
#
|
||||
|
||||
# Which version of config(8) is required.
|
||||
%VERSREQ= 300011
|
||||
%VERSREQ= 300012
|
||||
|
||||
KERNFORMAT?= elf
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# This file tells config what files go into building a kernel,
|
||||
# files marked standard are always included.
|
||||
#
|
||||
# $Id: files.i386,v 1.233 1999/04/07 03:55:36 msmith Exp $
|
||||
# $Id: files.i386,v 1.234 1999/04/13 19:38:10 peter Exp $
|
||||
#
|
||||
# The long compile-with and dependency lines are required because of
|
||||
# limitations in config: backslash-newline doesn't work in strings, and
|
||||
@ -96,6 +96,7 @@ i386/i386/pmap.c standard
|
||||
i386/i386/procfs_machdep.c standard
|
||||
i386/i386/simplelock.s optional smp
|
||||
i386/i386/support.s standard
|
||||
i386/i386/swapgeneric.c standard
|
||||
i386/i386/swtch.s standard
|
||||
i386/i386/sys_machdep.c standard
|
||||
i386/i386/trap.c standard
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
|
||||
* $Id: autoconf.c,v 1.110 1998/10/26 07:05:34 bde Exp $
|
||||
* $Id: autoconf.c,v 1.111 1999/01/19 00:10:59 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -333,19 +333,9 @@ cpu_rootconf()
|
||||
if (!mountrootfsname) {
|
||||
if (bootverbose)
|
||||
printf("Considering MFS root f/s.\n");
|
||||
if (mfs_getimage()) {
|
||||
if (mfs_getimage())
|
||||
mountrootfsname = "mfs";
|
||||
/*
|
||||
* Ignore the -a flag if this kernel isn't compiled
|
||||
* with a generic root/swap configuration: if we skip
|
||||
* setroot() and we aren't a generic kernel, chaos
|
||||
* will ensue because setconf() will be a no-op.
|
||||
* (rootdev is always initialized to NODEV in a
|
||||
* generic configuration, so we test for that.)
|
||||
*/
|
||||
if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV)
|
||||
setroot();
|
||||
} else if (bootverbose)
|
||||
else if (bootverbose)
|
||||
printf("No MFS image available as root f/s.\n");
|
||||
}
|
||||
#endif
|
||||
@ -370,15 +360,9 @@ cpu_rootconf()
|
||||
mountrootfsname = "ufs";
|
||||
if (bootverbose)
|
||||
printf("Considering FFS root f/s.\n");
|
||||
/*
|
||||
* Ignore the -a flag if this kernel isn't compiled
|
||||
* with a generic root/swap configuration: if we skip
|
||||
* setroot() and we aren't a generic kernel, chaos
|
||||
* will ensue because setconf() will be a no-op.
|
||||
* (rootdev is always initialized to NODEV in a
|
||||
* generic configuration, so we test for that.)
|
||||
*/
|
||||
if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV)
|
||||
if (boothowto & RB_ASKNAME)
|
||||
setconf();
|
||||
else
|
||||
setroot();
|
||||
}
|
||||
#endif
|
||||
@ -386,8 +370,6 @@ cpu_rootconf()
|
||||
if (!mountrootfsname) {
|
||||
panic("Nobody wants to mount my root for me");
|
||||
}
|
||||
|
||||
setconf();
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)swapgeneric.c 5.5 (Berkeley) 5/9/91
|
||||
* $Id: swapgeneric.c,v 1.25 1998/10/25 19:26:18 bde Exp $
|
||||
* $Id: swapgeneric.c,v 1.26 1999/04/14 15:20:03 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -60,8 +60,6 @@
|
||||
/*
|
||||
* Generic configuration; all in one
|
||||
*/
|
||||
dev_t rootdev = NODEV;
|
||||
dev_t dumpdev = NODEV;
|
||||
|
||||
void gets __P((char *));
|
||||
|
||||
@ -99,8 +97,6 @@ void setconf(void)
|
||||
char *cp;
|
||||
int bd, unit;
|
||||
|
||||
if (rootdev != NODEV)
|
||||
return;
|
||||
if (boothowto & RB_ASKNAME) {
|
||||
char name[128];
|
||||
retry:
|
||||
|
@ -248,6 +248,7 @@ addr_spec:
|
||||
|
||||
swap_spec:
|
||||
SWAP optional_on swap_device_list
|
||||
= { yyerror("swap specification obsolete, ignored"); }
|
||||
;
|
||||
|
||||
swap_device_list:
|
||||
@ -257,7 +258,6 @@ swap_device_list:
|
||||
|
||||
swap_device:
|
||||
swap_device_spec optional_size optional_sflag
|
||||
= { mkswap(*confp, $1, $2, $3); }
|
||||
;
|
||||
|
||||
swap_device_spec:
|
||||
|
@ -6,6 +6,6 @@
|
||||
* The numbering scheme is inspired by the sys/conf/newvers.sh RELDATE
|
||||
* and <osreldate.h> system.
|
||||
*
|
||||
* $Id: configvers.h,v 1.9 1999/04/07 09:42:29 grog Exp $
|
||||
* $Id: configvers.h,v 1.10 1999/04/13 18:22:57 peter Exp $
|
||||
*/
|
||||
#define CONFIGVERS 300011
|
||||
#define CONFIGVERS 300012
|
||||
|
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)mkswapconf.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: mkswapconf.c,v 1.14 1997/09/17 06:20:45 charnier Exp $";
|
||||
"$Id: mkswapconf.c,v 1.15 1998/06/09 14:02:08 dfr Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -118,8 +118,6 @@ do_swap(fl)
|
||||
} else {
|
||||
fprintf(fp, "dev_t\tdumpdev = NODEV;\t\t\t/* unconfigured */\n");
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
fprintf(fp, "void\nsetconf()\n{\n}\n");
|
||||
fclose(fp);
|
||||
moveifchanged(path(newswapname), path(swapname));
|
||||
return (swap);
|
||||
|
Loading…
Reference in New Issue
Block a user