From 3d87a6008918018567d0a6c5d9c5ab28f034a59a Mon Sep 17 00:00:00 2001 From: jkh Date: Tue, 1 Oct 1996 14:42:36 +0000 Subject: Add support for dset'ing an arbitrary kernel (experimental). --- sbin/dset/dset.8 | 13 ++++++++----- sbin/dset/dset.c | 15 +++++++++++---- 2 files changed, 19 insertions(+), 9 deletions(-) (limited to 'sbin/dset') diff --git a/sbin/dset/dset.8 b/sbin/dset/dset.8 index c1aa5e9..998dcc1 100644 --- a/sbin/dset/dset.8 +++ b/sbin/dset/dset.8 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: dset.8,v 1.1 1996/05/02 21:47:45 joerg Exp $ +.\" $Id: dset.8,v 1.2 1996/05/02 22:34:19 mpp Exp $ .\" " .Dd May 2, 1996 .Dt DSET 8 @@ -34,16 +34,19 @@ .Sh SYNOPSIS .Nm dset .Op Fl vqt +.Op Fl k Ar kernel .Sh DESCRIPTION .Nm Dset records the configuration changes for ISA devices that have been made -from within +from .Em UserConfig after booting with the .Fl c -option. The changes (if any) are always attempted to be recorded into -the file as obtained by -.Xr getbootfile 3 . +option. The changes (if any) are recorded to the file name returned by +.Xr getbootfile 3 +unless overridden with the +.Fl k +flag. .Nm Dset is typically called from within .Pa /etc/rc . diff --git a/sbin/dset/dset.c b/sbin/dset/dset.c index 22145d8..3c70d1d 100644 --- a/sbin/dset/dset.c +++ b/sbin/dset/dset.c @@ -83,7 +83,7 @@ error(name, str) void usage(char *title) { - fprintf(stderr, "usage: %s [-qtv]\n", title); + fprintf(stderr, "usage: %s [-qtv] [-k kernel]\n", title); } main(ac, av) @@ -102,14 +102,14 @@ main(ac, av) struct exec es; kvm_t *kd; static char errb[_POSIX2_LINE_MAX]; - const char *kernel; + const char *kernel = NULL; extern char *optarg; char ch; int testonly = FALSE; int verbose = FALSE; - while ((ch = getopt(ac, av, "qtv")) != EOF) + while ((ch = getopt(ac, av, "qtvk:")) != EOF) switch (ch) { case 'q': quiet = TRUE; @@ -117,9 +117,15 @@ main(ac, av) case 't': testonly = TRUE; /* In test mode we want to be verbose */ + + case 'k': + kernel = optarg; + break; + case 'v': verbose = TRUE; break; + case '?': default: usage(av[0]); @@ -127,7 +133,8 @@ main(ac, av) } - kernel = getbootfile(); + if (!kernel) + kernel = getbootfile(); if (verbose) printf("Boot image: %s\n", kernel); -- cgit v1.1