12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2If there is no /usr/src/sys/i386/conf directory on your machine, you are unlikelyto have the FreeBSD source tree on your hard disk. You may want to install thesource tree from your installation media (most likely the CD-ROM from which youinstall the FreeBSD) and then use CVSup to update the source tree to thelatest revision.The system's default kernel configuration file is called GENERIC, which is found in thesame directory.Reading the GENERIC file gives you a complete picture of what a kernel configurationfile would look like. However, the GENERIC file does not contain all the possibleoptions and modules.There are two files that contain almost all the possible kernel modules and optionsdefinitions. The file /usr/src/sys/i386/conf/NOTES contains machine-dependentconfiguration notes (for the i386 architecture in this example) while the /usr/src/sys/conf/NOTES file has machine-independent notes. It is recommended that youhave a thorough look at these two files before you create a new custom kernel file.To create a custom kernel file, you can copy the GENERIC file to a new name andmake the appropriate modifications to the new file. Do not modify the GENERICkernel. You will need the GENERIC kernel in case of an emergency.# cd /usr/src/sys/i386/conf# cp GENERIC MYSERVERThis will make a copy of the default GENERIC kernel for the i386 platform with a newname, so that you can create a new kernel based on the GENERIC configuration.After removing the unnecessary modules and adding the appropriate ones tosupport your hardware, and after tweaking the options according to your hardwareconfiguration, you should build and install the kernel.To build a custom made kernel, a few steps should be taken. First, change thedirectory to the sources directory:# cd /usr/srcThen build the new kernel as shown here:# make buildkernel KERNCONF=MYSERVERIt will take several minutes to compile a new kernel depending on your hardware.Sometimes, if it breaks here, you should re-check your kernel configuration file fora syntax error or missing module dependencies. Consult the appropriate NOTES filewhen needed.[ 39 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!