![]() |
Now serving 107 guides. |
|
Compile a Custom Kernel General Information There may be two main reasons as to why you would want a custom kernel on your system: 1) You want to add some functionality to your system such as audio support, or 2) you may want to remove some unused drivers to conserve memory.Either way, making a custom kernel will help your machine to be a faster box rather than using the GENERIC kernel. Requirements
Installation We will want to use sysinstall to get the src:
Configuration Once you have the source installed we can then start on the kernel customization:
Note: *NEVER* edit the GENERIC file.
1) Here is an example line from the kernel
2) Don't delete any lines. Comment them out with a # in the front. 3) Always change your ident line as follows Scroll down the line that reads:
/var/log/messages (provided it hasn't been forever since your last reboot).This is a great example. There are a ton of Network Card drivers in the kernel and you really only need one. Let's look in /var/log/messages for your Ethernet Card. I'll use my NIC as an example:
Once you are done, it's time to compile the kernel.
After the reboot you should see that you are on the new kernel.
Author: Bill 12 Comments Posted by jimd on November 28, 2006 at 11:56:31 pm EET
Can you copy a kernel to a new install from an existing install?
Thanks, jim Posted by w0ls0n on November 29, 2006 at 12:21:36 am EET
It depends. If you did a fresh install of the OS and it's on the same hardware, then the answer is yes. Just copy your /usr/src/sys/i386/conf/KERNEL file first before the fresh install.
If it's another PC you're installing to, its possible the kernel will still work but it's really based on the hardware. Generally what I like to do is start with a fresh kernel and just compare the hardware detected in /var/log messages or dmesg with the new kernel. Hope that helps. Let me know if you have any other questions. Bill http://freebsdrocks.net http://goodcleanemail.com Posted by jimd on November 29, 2006 at 12:26:14 am EET
It would be a fresh install on new hardware, but the hardware is exactly the same as the existing install. I have a production box and a test box, the production box is FreeBSD 6.1 and the test box is FreeBSD 5.4. I am looking for the best way to make the test box exactly the same as the production box, except for the id information. I figured I'd have to start with the kernel and then copy the rest of the partitions. Am I on the right track?
Thanks for your help, I'm a Windows admin with relatively little FreeBSD experience, but I'm not afraid of the command line. I have at least compiled my own kernel before. Thanks, jim Posted by w0ls0n on November 29, 2006 at 1:07:28 am EET
Why not use 6.1 on both? 5.4 is a bit outdated and 6.1 is much better in my opinion. I wouldn't suggest taking the 6.1 kernel and copying it to the 5.4 box. That just wouldn't be a good idea. Being a windows admin myself for about 10+ years I know how you feel there. :-) As far as copying the partitions, what exactly are you looking to copy? If you're just copying your files from your /home dir, vpopmail or maybe your www folder, you can use my backup vpopmail doc. You can basically use it to copy anything from a server to another server or backup server. It uses a combination of ssh and rsync. Take a look at
http://www.goodcleanemail.com/kb.php?ToDo=view&questId=56&catId=5 If you're ever on the freenode IRC server, join channel #qmr and I will most certainly be able to help. I am on there Mon - Fri 9-4. Again, let me know if you have any questions of problems. Bill http://freebsdrocks.net http://goodcleanemail.com Posted by jimd on November 29, 2006 at 3:49:56 pm EET
I want to have 6.1 on both, I actually want both servers to be exactly the same, aside from IP address and name. That's why I was hoping I could somehow get a shell up on the new test box and somehow copy the production box bit by bit on to the test box so that they will be identical. I am actually trying to do something similar to imaging a PC, but my copy of Ghost doesn't support FreeBSD.
Thank you for your help, jim Posted by w0ls0n on November 29, 2006 at 4:44:15 pm EET
Hi,
Is the hardware the same on both? If they're the same, you can use the same kernel but if they're not, I would start with a fresh kernel in m opinion. Posted by jimd on November 29, 2006 at 4:51:44 pm EET
Yes, the hardware is exactly the same. How would I copy the kernel to the new box before I build it? Maybe I'm on the wrong track here.
How would you go about building a test box that is exactly the same as an existing production box, without installing all of the software manually? I guess what I'm really trying to avoid is installing Apache, php, samba, and nfs on the new box, I was told I could "image" the old box on the new one just by copying the data. Is that correct? Thanks, jim Posted by w0ls0n on November 29, 2006 at 5:21:28 pm EET
I am not 100% sure how you can image the box over. Thats a new one for me.
To copy the kernel just scp it like so scp user@domain:/usr/src/sys/i386/conf/KERNELNAME /usr/src/sys/i386/conf You might actaully have to copy it to your home dir first and then copy it to where it needs to be. Posted by jimd on November 29, 2006 at 5:24:51 pm EET
w0ls0n,
I really appreciate your help! Can I copy the kernel while the server is in use? Posted by w0ls0n on November 29, 2006 at 5:49:24 pm EET
The file you're copying is file to copy over. You build it from that file.
Posted by jimd on November 29, 2006 at 10:49:19 pm EET
I just want to thank you for the excellent instructions that exist on this page. I was able to move my kernel over from the old computer very easily thanks to you.
I really appreciate the help! Many Thanks, jim Posted by w0ls0n on November 30, 2006 at 5:14:47 am EET
Anytime!
|
Copyright 2003 - 2010 BSD Guides. All rights reserved. |
About | Terms of Use | Privacy | Contact |

