summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-02-18 18:05:35 +0000
committerwpaul <wpaul@FreeBSD.org>1995-02-18 18:05:35 +0000
commit09b7a3d45cb2dd1bbeb8a665103556cea70c2479 (patch)
tree7e95a91f826e1c35e56c1f046dde5ba004f58c80 /usr.sbin/config
parent6d90dafba0521c20d50aa39901214fe623892ff1 (diff)
downloadFreeBSD-src-09b7a3d45cb2dd1bbeb8a665103556cea70c2479.zip
FreeBSD-src-09b7a3d45cb2dd1bbeb8a665103556cea70c2479.tar.gz
Do away with 'options SWAP_GENERIC' once and for all: I get ill
just thinking about it. Two changes need to be made to allow 'config kernel swap generic' to work properly without requiring any compile-time flags: /usr/src/usr.sbin/config/mkswapconf.c: we need to define a dummy stub for the setconf() function to replace the one in swapgeneric.c that isn't available in non-generic configurations. /usr/src/sys/i386/i386/autoconf.c: the -a boot flag causes setroot() to be skipped and lets setconf() prompt the user for a root device. If you skip setroot() in a non-generic kernel, you could get severely hosed. To avoid this, we silently ignore the -a flag if rootdev != NODEV. (rootdev is always initialized to NODEV in swapgeneric.c, so if we find that rootdev is something other than NODEV, we know we're not using a generic configuration.)
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/mkswapconf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/config/mkswapconf.c b/usr.sbin/config/mkswapconf.c
index 1ffb708..4b883a4 100644
--- a/usr.sbin/config/mkswapconf.c
+++ b/usr.sbin/config/mkswapconf.c
@@ -111,7 +111,9 @@ do_swap(fl)
} while (swap && swap->f_type == SWAPSPEC);
fprintf(fp, "\t{ NODEV, 0, 0 },\t/* for NFS diskless */\n");
fprintf(fp, "\t{ NODEV, 0, 0 }\n");
- fprintf(fp, "};\n");
+ fprintf(fp, "};\n\n");
+ fprintf(fp, "/* Stub for when generic swap config is not used. */\n");
+ fprintf(fp, "void setconf(void) {};\n");
fclose(fp);
return (swap);
}
OpenPOWER on IntegriCloud