diff options
author | hubertf <hubertf@pkgsrc.org> | 2005-02-28 00:48:52 +0000 |
---|---|---|
committer | hubertf <hubertf@pkgsrc.org> | 2005-02-28 00:48:52 +0000 |
commit | afea1931b68db36f4761ac3db7114bf7bcf4bb84 (patch) | |
tree | 8ef02f601eecc611b35cf3a23627b5e0dc95486e /sysutils | |
parent | 4e7bffac60a17525f3015f14ecd225058d2df761 (diff) | |
download | pkgsrc-afea1931b68db36f4761ac3db7114bf7bcf4bb84.tar.gz |
Update adjustkernel to 1.7. Changes:
* Update copyright year
* Change syntax to not require mandatory options (think about the word!)
* Document short options
* Mention /var/run/dmesg.boot
* Expand examples section a bit
* Xref dmesg(8)
* Document a known bug
OK'd by mjl@
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/adjustkernel/Makefile | 4 | ||||
-rw-r--r-- | sysutils/adjustkernel/files/adjustkernel | 21 | ||||
-rw-r--r-- | sysutils/adjustkernel/files/adjustkernel.1 | 64 |
3 files changed, 54 insertions, 35 deletions
diff --git a/sysutils/adjustkernel/Makefile b/sysutils/adjustkernel/Makefile index 2593fa3776c..39bfb2a6f09 100644 --- a/sysutils/adjustkernel/Makefile +++ b/sysutils/adjustkernel/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.8 2004/11/03 10:49:58 hubertf Exp $ +# $NetBSD: Makefile,v 1.9 2005/02/28 00:48:52 hubertf Exp $ -DISTNAME= adjustkernel-1.6 +DISTNAME= adjustkernel-1.7 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty diff --git a/sysutils/adjustkernel/files/adjustkernel b/sysutils/adjustkernel/files/adjustkernel index ff95e78bf12..3cdafb0b6fd 100644 --- a/sysutils/adjustkernel/files/adjustkernel +++ b/sysutils/adjustkernel/files/adjustkernel @@ -1,7 +1,8 @@ #!/usr/pkg/bin/perl +# $Id: adjustkernel,v 1.4 2005/02/28 00:48:52 hubertf Exp $ # -# Copyright (c) 2004 Hubert Feyrer <hubertf@NetBSD.org>, -# Martin Laubach <mjl@NetBSD.org> +# Copyright (c) 2004,2005 Hubert Feyrer <hubertf@NetBSD.org>, +# Martin Laubach <mjl@NetBSD.org> # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -35,16 +36,6 @@ # -#-------------------------------------------------------------------------- -# %Id: adjustkernel,v 1.1 1999/10/15 01:21:30 feyrer Exp feyrer % -# $Emsi: adjustkernel,v 1.4 2001/10/04 22:26:26 mjl Exp $ -# -# Usage: adjustkernel -f GENERIC [-o outfile] [-d] -# -# commends out any lines that aren't found in the current kernel (dmesg) -# -#-------------------------------------------------------------------------- - use strict; use Getopt::Long; @@ -66,9 +57,13 @@ die "Invalid command line" unless GetOptions( 'mesg=s' => \$mesg ); +$kernel = shift(@ARGV) + unless $kernel; + ########################################################################### -die "Usage: $0 [-debug] [-mesg dmesg-file] [-outfile new-config]\n\t\t[-remove] -file kernel-config\n" unless $kernel; +die "Usage: $0 [-dmor] [--debug] [--mesg dmesg-file]\n". + "\t\t [--outfile new-config][--remove] kernel-config\n" unless $kernel; $| = 1 if $debug; diff --git a/sysutils/adjustkernel/files/adjustkernel.1 b/sysutils/adjustkernel/files/adjustkernel.1 index e57462eb505..0f6cad5cf13 100644 --- a/sysutils/adjustkernel/files/adjustkernel.1 +++ b/sysutils/adjustkernel/files/adjustkernel.1 @@ -1,5 +1,5 @@ .\" $Emsi: adjustkernel.1,v 1.1 2002/03/01 01:25:37 mjl Exp $ -.\" $NetBSD: adjustkernel.1,v 1.4 2004/11/03 10:49:58 hubertf Exp $ +.\" $NetBSD: adjustkernel.1,v 1.5 2005/02/28 00:48:52 hubertf Exp $ .\" .\" Copyright (c) 2004 Hubert Feyrer <hubertf@NetBSD.org>, .\" Martin Laubach <mjl@NetBSD.org> @@ -34,41 +34,45 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 3, 2004 +.Dd February 27, 2005 .Dt ADJUSTKERNEL 1 .Sh NAME .Nm adjustkernel .Nd generate kernel config from dmesg .Sh SYNOPSIS .Nm adjustkernel -.Op Fl debug -.Op Fl mesg Ar dmesg-file -.Op Fl outfile Ar new-config -.Op Fl remove -.Fl file Ar source-config +.Op Fl dmor +.Op Fl -debug +.Op Fl -mesg Ar dmesg-file +.Op Fl -outfile Ar new-config +.Op Fl -remove +.Ar kernel-config .Sh DESCRIPTION .Nm generates a new kernel configuration file from the -current dmesg output and the current kernel config file. +current dmesg output and the current kernel config file, +.Ar kernel-config . .Pp The generation can be customized by using the following options: .Bl -tag -width 22n -compact -.It Fl debug +.It Fl d , Fl -debug be verbose and generate noise (mainly useful for debugging). -.It Fl file Ar source-config -read the currently booted kernel from source-config. -This option is mandatory. -.It Fl outfile Ar new-config +.It Fl o Ar new-config , Fl -outfile Ar new-config saves the newly generated config file to .Ar new-config ; otherwise the new config will be written to stdout. -.It Fl mesg Ar dmesg-file +.It Fl m Ar dmesg-file , Fl -mesg Ar dmesg-file read the dmesg data from .Ar dmesg-file , defaults to calling .Pa /sbin/dmesg and using its output. -.It Fl remove +See +.Pa /var/run/dmesg.boot +for an alternative snapshot from +right after the system booted, but which may not include +any removable components added later. +.It Fl r , Fl -remove causes the tool to remove entries in the config file instead of commenting them out. .El @@ -76,15 +80,35 @@ of commenting them out. Note that options can be shortened, as long as they can be unambigously distinguished. .Sh EXAMPLES -To generate a new kernel config after having booted a -GENERIC kernel, +To generate a new kernel config +.Pa MYCONFIG +after having booted a +GENERIC kernel, run: .Bd -literal -adjustkernel -f GENERIC -o MYKERNEL +$ cd /usr/src/sys/arch/`uname -m`/conf +$ adjustkernel GENERIC >MYCONFIG +.Ed +.Pp +To see what could be stripped off the currently-running kernel, +assuming it was built with the +.Dq INCLUDE_CONFIG_FILE +option, use something like: +.Bd -literal +$ config -x >MYKERNEL +$ adjustkernel -r MYKERNEL | diff -u MYKERNEL - | more .Ed .Sh SEE ALSO -.Xr options 4 +.Xr options 4 , +.Xr dmesg 8 .Sh AUTHORS Originally created by Hubert Feyrer <hubert@feyrer.de>, later hacked in shape and packetized by Martin J. Laubach <mjl@netbsd.org>. .Sh BUGS -On thursdays. +Essential lines +.Dq atabus* at ata? , +.Dq atabus* at atapi? +and +.Dq scsibus* at scsi? +are removed as they aren't listed in +.Xr dmesg 8 +output. |