.\" $Emsi: adjustkernel.1,v 1.1 2002/03/01 01:25:37 mjl Exp $ .\" $NetBSD: adjustkernel.1,v 1.6 2005/03/01 13:26:24 wiz Exp $ .\" .\" Copyright (c) 2004 Hubert Feyrer , .\" Martin Laubach .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by .\" Hubert Feyrer and .\" Martin Laubach .\" 4. Neither the name of authors nor the names of any .\" contributors may be used to endorse or promote products derived .\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd February 27, 2005 .Dt ADJUSTKERNEL 1 .Sh NAME .Nm adjustkernel .Nd generate kernel config from dmesg .Sh SYNOPSIS .Nm adjustkernel .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, .Ar kernel-config . .Pp The generation can be customized by using the following options: .Bl -tag -width 22n -compact .It Fl d , Fl -debug be verbose and generate noise (mainly useful for debugging). .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 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. 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 .Pp Note that options can be shortened, as long as they can be unambigously distinguished. .Sh EXAMPLES To generate a new kernel config .Pa MYCONFIG after having booted a GENERIC kernel, run: .Bd -literal $ 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 dmesg 8 .Sh AUTHORS Originally created by Hubert Feyrer , later hacked in shape and packetized by Martin J. Laubach . .Sh BUGS Essential lines .Dq atabus* at ata? , .Dq atapibus* at atapi? , and .Dq scsibus* at scsi? are removed as they aren't listed in .Xr dmesg 8 output.