|
List Info
Thread: Kernel config file
|
|
| Kernel config file |
  Canada |
2007-06-17 09:47:53 |
Heyas folks --
I've whipped up a proof of concept kernel config file loader
for
i386. I'm sure it could be extended to do pretty much
anything, but
for now all that is implemented is scripting of USERCONF.
This lets
you do things like disable ACPI without having to 'boot -c'
every time.
The plist file loaded is kernelname.plist, and looks like
this:
$ cat /netbsd.plist
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD
PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>userconf</key>
<array>
<string>disable acpi</string>
<string>disable
isapnp</string>
<string>disable mca</string>
<string>disable eisa</string>
<string>disable
pcmcia</string>
</array>
</dict>
</plist>
This results in the following output at boot:
userconf: loading settings from boot plist
[488] acpi0 disabled
[368] isapnp0 disabled
[397] mca0 disabled
[393] eisa0 disabled
[394] eisa0 disabled
[412] pcmcia* disabled
[413] pcmcia* disabled
[414] pcmcia* disabled
Thoughts? Comments? A patch is available here:
http://www.invisible.ca/~jmcneill/netbsd/bootplist.patch
Cheers,
Jared
|
|
| Re: Kernel config file |
  Canada |
2007-06-17 12:12:53 |
On 17-Jun-07, at 1:04 PM, Thor Lancelot Simon wrote:
> On Sun, Jun 17, 2007 at 10:47:53AM -0400, Jared
D.McNeill wrote:
>> Heyas folks --
>>
>> I've whipped up a proof of concept kernel config
file loader for
>> i386. I'm sure it could be extended to do pretty
much anything, but
>> for now all that is implemented is scripting of
USERCONF. This lets
>> you do things like disable ACPI without having to
'boot -c' every
>> time.
>>
>> The plist file loaded is kernelname.plist, and
looks like this:
>
> Please, no plists in the tree in applications where
users have to
> edit them by hand (on the other hand if there were a
_generator_ for
> this plist, it would be wonderful).
I've been thinking about this, we could have a command to
generate
the plist file based on the currently selected userconf
options. So
eg. you boot GENERIC, do a 'boot -c', change a bunch of
crap, then
boot. If you like what you see, you could simply do
'/usr/sbin/
bootprops -x >/netbsd.plist' to dump the current
configuration.
Cheers,
Jared
|
|
| Re: Kernel config file |
  Canada |
2007-06-17 13:17:39 |
On 17-Jun-07, at 1:36 PM, Thor Lancelot Simon wrote:
> On Sun, Jun 17, 2007 at 01:12:53PM -0400, Jared D.
McNeill wrote:
>>
>> I've been thinking about this, we could have a
command to generate
>> the plist file based on the currently selected
userconf options. So
>> eg. you boot GENERIC, do a 'boot -c', change a
bunch of crap, then
>> boot. If you like what you see, you could simply do
'/usr/sbin/
>> bootprops -x >/netbsd.plist' to dump the current
configuration.
>
> I was just looking at making the userconf code run in
userspace. But
> your idea is better!
I wrote the userspace userconf interface; adding the ability
to dump
the current config shouldn't be too difficult.
http://www.invisible.ca/~jmcneill/netbsd/bootprops.c
Here's a "screenshot":
$ ./bootprops userconf netbsd.plist -l
disable isapnp
disable acpi
$ ./bootprops userconf netbsd.plist -d "disable
isapnp"
$ ./bootprops userconf netbsd.plist -a "disable
ehci"
$ ./bootprops userconf netbsd.plist -l
disable acpi
disable ehci
Cheers,
Jared
|
|
| Re: Kernel config file |

|
2007-06-17 14:48:47 |
On Sun, Jun 17, 2007 at 01:04:52PM -0400, Thor Lancelot
Simon wrote:
> On Sun, Jun 17, 2007 at 10:47:53AM -0400, Jared
D.McNeill wrote:
> > Heyas folks --
> >
> > I've whipped up a proof of concept kernel config
file loader for
> > i386. I'm sure it could be extended to do pretty
much anything, but
> > for now all that is implemented is scripting of
USERCONF. This lets
> > you do things like disable ACPI without having to
'boot -c' every time.
> >
> > The plist file loaded is kernelname.plist, and
looks like this:
>
> Please, no plists in the tree in applications where
users have to
> edit them by hand (on the other hand if there were a
_generator_ for
> this plist, it would be wonderful).
Even with the new 'scn' fromat?
Pavel
|
|
| Re: Kernel config file |
  Canada |
2007-06-17 15:18:47 |
Here's an updated patch that removes the 2k size limit of
the plist
file. It should theoretically be able to grow as large as we
need now.
http://www.invisible.ca/~jmcneill/netbsd/bootplist2.pat
ch
Cheers,
Jared
|
|
| Re: Kernel config file |
  Germany |
2007-06-17 16:11:10 |
On Sun, Jun 17, 2007 at 10:47:53AM -0400, Jared D. McNeill
wrote:
> <key>userconf</key>
> <array>
> <string>disable
acpi</string>
> <string>disable
isapnp</string>
> <string>disable
mca</string>
> <string>disable
eisa</string>
> <string>disable
pcmcia</string>
> </array>
What is the point of encoding anything but instructions that
you could give
to userconf at the prompt in this file?
(Note: this is not about plist format, I would like to
understand why you
put three levels of wrappers [array,dict,xml] around a
linear list of
input data)
i.e: why is the above not a simple file like:
--8<--
disable acpi
disable isapnp
disable mca
disable eisa
disable pcmcia
-->8--
Please explain, I realy don't understand the idea behind
it.
Martin
|
|
| Re: Kernel config file |
  Canada |
2007-06-17 16:21:06 |
On 17-Jun-07, at 5:11 PM, Martin Husemann wrote:
> What is the point of encoding anything but instructions
that you
> could give
> to userconf at the prompt in this file?
>
> (Note: this is not about plist format, I would like to
understand
> why you
> put three levels of wrappers [array,dict,xml] around a
linear list of
> input data)
The intent is that the boot plist file can be extended in
the future.
userconf scripting is simply an example of what can be done.
I would
like to see things such as bootloader configuration
(console, serial
port speed) as well as allowing for kernel tunables. Turning
the
PCI_*_FIXUP compile-time options into runtime options comes
to mind.
Cheers,
Jared
|
|
| Re: Kernel config file |
  Germany |
2007-06-17 16:22:13 |
On Sun, Jun 17, 2007 at 05:21:06PM -0400, Jared D. McNeill
wrote:
> The intent is that the boot plist file can be extended
in the future.
> userconf scripting is simply an example of what can be
done. I would
> like to see things such as bootloader configuration
(console, serial
> port speed) as well as allowing for kernel tunables.
Turning the
> PCI_*_FIXUP compile-time options into runtime options
comes to mind.
Which of this would you not want to offer at the userconf
prompt?
Martin
|
|
| Re: Kernel config file |
  United Kingdom |
2007-06-17 16:34:02 |
On Sun, Jun 17, 2007 at 11:22:13PM +0200, Martin Husemann
wrote:
> On Sun, Jun 17, 2007 at 05:21:06PM -0400, Jared D.
McNeill wrote:
> > The intent is that the boot plist file can be
extended in the future.
> > userconf scripting is simply an example of what
can be done. I would
> > like to see things such as bootloader
configuration (console, serial
> > port speed) as well as allowing for kernel
tunables. Turning the
> > PCI_*_FIXUP compile-time options into runtime
options comes to mind.
>
> Which of this would you not want to offer at the
userconf prompt?
And also at the prompt in /boot itself ?
If you make /boot read a config file, it really ought to be
one
of commands to /boot itself.
David
--
David Laight: david l8s.co.uk
|
|
| Re: Kernel config file |
  Spain |
2007-06-17 16:27:51 |
On Sun, 17 Jun 2007 23:22:13 +0200
Martin Husemann <martin duskware.de> wrote:
> On Sun, Jun 17, 2007 at 05:21:06PM -0400, Jared D.
McNeill wrote:
> > The intent is that the boot plist file can be
extended in the
> > future. userconf scripting is simply an example of
what can be
> > done. I would like to see things such as
bootloader configuration
> > (console, serial port speed) as well as allowing
for kernel
> > tunables. Turning the PCI_*_FIXUP compile-time
options into runtime
> > options comes to mind.
>
> Which of this would you not want to offer at the
userconf prompt?
Martin, the same plist structure might be used by the
bootloader or
another part that is not related to userconf.
I think the structure is fine, IMO. Jared keep up the good
work.
--
Juan Romero Pardines - The NetBSD Project
http://plog.xtrarom.org/
- NetBSD/pkgsrc news in Spanish
|
|
|
|