summaryrefslogtreecommitdiff
path: root/sysutils/adjustkernel/files/adjustkernel.1
blob: 6cf9b2b86625e90966dba7a94820bf8037ee35d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
.\"     $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 <hubertf@NetBSD.org>,
.\"		     Martin Laubach <mjl@NetBSD.org>
.\" 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 <hubertf@NetBSD.org> and
.\"        Martin Laubach <mjl@NetBSD.org>
.\" 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 <hubert@feyrer.de>,
later hacked in shape and packetized by Martin J. Laubach <mjl@netbsd.org>.
.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.