From 7aa24eec62cddb81db2f595ef7c1fdc6d468feab Mon Sep 17 00:00:00 2001 From: bde Date: Tue, 30 Jul 1996 20:30:49 +0000 Subject: Fixed longstanding bug of not checking `dumpdev' or setting `dumplo' early enough when the dump device is specified in the config file. Removed stale comment about configuration root and swap devices. Don't bother clearing dumplo when dumpdev is set to NODEV. Everything is controlled by dumpdev. Fixed the kern.dumpdev sysctl. Writes were handle bogusly. --- sys/amd64/amd64/autoconf.c | 17 +++++++---------- sys/i386/i386/autoconf.c | 17 +++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) (limited to 'sys') diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index b91fd8b..3905ec3 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.54 1996/06/02 18:58:39 joerg Exp $ + * $Id: autoconf.c,v 1.55 1996/06/08 09:37:35 bde Exp $ */ /* @@ -191,6 +191,9 @@ configure(dummy) isa_configure(); #endif + if (setdumpdev(dumpdev) != 0) + dumpdev = NODEV; + configure_finish(); cninit_finish(); @@ -268,15 +271,11 @@ configure(dummy) setroot(); } #endif + if (!mountroot) { panic("Nobody wants to mount my root for me"); } - /* - * Configure swap area and related system - * parameter based on device(s) used. - */ - if (bootverbose) - printf("Configuring root and swap devs.\n"); + setconf(); cold = 0; if (bootverbose) @@ -292,7 +291,6 @@ setdumpdev(dev) if (dev == NODEV) { dumpdev = dev; - dumplo = 0; return (0); } maj = major(dev); @@ -379,9 +377,8 @@ sysctl_kern_dumpdev SYSCTL_HANDLER_ARGS ndumpdev = dumpdev; error = sysctl_handle_opaque(oidp, &ndumpdev, sizeof ndumpdev, req); - if (!error && ndumpdev != dumpdev) { + if (error == 0 && req->newptr != NULL) error = setdumpdev(ndumpdev); - } return (error); } diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index b91fd8b..3905ec3 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.54 1996/06/02 18:58:39 joerg Exp $ + * $Id: autoconf.c,v 1.55 1996/06/08 09:37:35 bde Exp $ */ /* @@ -191,6 +191,9 @@ configure(dummy) isa_configure(); #endif + if (setdumpdev(dumpdev) != 0) + dumpdev = NODEV; + configure_finish(); cninit_finish(); @@ -268,15 +271,11 @@ configure(dummy) setroot(); } #endif + if (!mountroot) { panic("Nobody wants to mount my root for me"); } - /* - * Configure swap area and related system - * parameter based on device(s) used. - */ - if (bootverbose) - printf("Configuring root and swap devs.\n"); + setconf(); cold = 0; if (bootverbose) @@ -292,7 +291,6 @@ setdumpdev(dev) if (dev == NODEV) { dumpdev = dev; - dumplo = 0; return (0); } maj = major(dev); @@ -379,9 +377,8 @@ sysctl_kern_dumpdev SYSCTL_HANDLER_ARGS ndumpdev = dumpdev; error = sysctl_handle_opaque(oidp, &ndumpdev, sizeof ndumpdev, req); - if (!error && ndumpdev != dumpdev) { + if (error == 0 && req->newptr != NULL) error = setdumpdev(ndumpdev); - } return (error); } -- cgit v1.1