The DEFAULTS file

I have recently installed FreeBSD 8.2, cvsup'd everything and rebuilt the world. Now I'm moving on to the kernel. I've read about the "include" method and want to try it out, but I'm a little confused by the new DEFAULTS file and "include" method.

Normally, I would copy GENERIC, and then go through it ripping stuff out or commenting things out. From what I gather, you no longer do this with the "include" method. Instead, you sort of comment things out through the include via 'nooption' and 'nodevice', etc. ok.

So, basically I create a new, empty, kernel configuration file. Include GENERIC. And then use this file as a sort of overlay for GENERIC, covering things up, or adding new things.

My question is, do you create nooption and nodevice lines for every line in GENERIC you would normally take out? For instance, I have no need for all the various NIC lines in GENERIC. I have one NIC on this workstation and that won't change. So usually I just rip out all of the other NIC lines.

Using the include method, do I create a nooption/nodevice for each and every NIC line? And then for everything else? i.e. all the RAID devices, SCSI device etc. etc.?

I see how the "include" method can really pay off in the long run. Any/all updates are automatically included when they are released. I make changes to my file, leaving GENERIC alone. Great. But it seems like a lot of work initially. Unless I am missing something here.

I don't mind going through and creating the file. I'm just curious whether or not this is appropriate?

Also, there is a DEFAULTS file now. Does /usr/src/sys/i386/conf/DEFAULTS work the same as an include? There is no manpage for DEFAULTS, and the file is rather empty on explanations. All of the entries in DEFAULTS used to be in GENERIC. It's been a while since I've created my own kernel configuration so I am not sure when the DEFAULTS file started showing up. Or its proper usage. It seems selfexplanatory, but..

Is the DEFAULTS file a sort of mandatory 'don't remove these' additional configuration file for the kernel now? Normally I would pull out some of the things that are now included in DEFAULTS. I'm not sure what the purpose of DEFAULTS is if I'm leaving GENERIC as it is and creating my own kernel via the "include" method?. How should DEFAULTS be treated? Mandatory and should not be altered? Will the DEFAULTS file be pulled into the kernel config when I make buildkernel?
 
rhish said:
My question is, do you create nooption and nodevice lines for every line in GENERIC you would normally take out? For instance, I have no need for all the various NIC lines in GENERIC. I have one NIC on this workstation and that wont change. So usually I just rip out all of the other NIC lines.

Using the include method, do I create a nooption/nodevice for each and every NIC line? And then for everything else? i.e. all the raid devices, SCSI device etc etc?

Yes. Of course, you don't have to do all that by hand:
% sed -e 's/^device/nodevice/' GENERIC > GENERIC.nodevice

Then delete the lines for devices you want to keep. Being really aggressive about removing things can trim a couple of meg of kernel size. It usually isn't worthwhile for desktop systems.

Also, there is a DEFAULTS file now. Does /usr/src/sys/i386/conf/DEFAULTS work the same as an include? There is no manpage for DEFAULTS, and the file is rather empty on explanations.

No idea what DEFAULTS really is, I've never looked at it before. And the CVS history doesn't really help. Ultra bare-minimum requirements, maybe.
 
wblock said:
Yes. Of course, you don't have to do all that by hand:
% sed -e 's/^device/nodevice/' GENERIC > GENERIC.nodevice

Then delete the lines for devices you want to keep. Being really aggressive about removing things can trim a couple of meg of kernel size. It usually isn't worthwhile for desktop systems.

Ok, yeah, it's really redundant at first, but once I get everything set up it should really make things easy/efficient. Thanks for the sed suggestion. It's enough to get me pointed in the right direction to solve the situation.

No idea what DEFAULTS really is, I've never looked at it before. And the CVS history doesn't really help. Ultra bare-minimum requirements, maybe.

It would seem, the DEFAULTS was initially started to ensure ISA and NPX remain in every kernel. They are both listed as requisite. But then, immediately after that first entry, they preserve i386 and pc98. pc98 shouldn't be mandatory or even necessary for many systems. It has since been removed. So I'm still kind of confused about the proper usage of DEFAULTS.

It kind of feels like the same thing the "include method" accomplishes. By having a DEFAULTS, you sort of have a "all of this across all systems" and then GENERIC for things particular to that system itself.

It's not clear whether or not the things included in DEFAULTS are mandatory? I don't see anything in DEFAULTS that I 'must' remove. Just curious what its proper use is. And if it's appropriate to alter the file?

Several cvs history annotations indicate allowances were made for duplicates. i.e. machine i386 being in DEFAULTS and GENERIC.
 
The DEFAULTS file is a "hands-off" file. Do not modify it. Do not even worry about it. In fact, just ignore it, and everything will work perfectly. :)

This file lists devices that absolutely must be present in order for the kernel to work on that/those architecture(s). Modifying this file will cause bad things to happen when you boot a kernel compiled using the modified DEFAULTS file.
 
Back
Top