skimpydog.com Forum Index No Distro Specific Kernel Building |
Browsing this Thread:
1 Anonymous Users
Bottom Previous Topic Next Topic |
|
|
|
---|
Poster | Thread |
---|
|
Kernel Building | #1 |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Webmaster
Joined: 2007/6/10
From Dallas, TX
Posts: 79
Level : 7 HP : 0 / 170 Group:
Webmasters Registered Users |
Building the Linux Kernel is really quite simple - IF you have a decent auto-generated configuration to start with.
What I mean by that, is simply this: You can build your kernel by hand, and often things will fail until you have your kernel 100% how you want it - that is working with your hardware, how you want it 100%. Keep in mind you will have to configure things for iptables/ipfw, network, video performance, audio, hard disks (RAID, SCSI) etc... until you have what you want in a working manner. Stable.. A few key pointers I have learned are like this, If you have a .config, or anything like that in /usr/src/kernel(linux)-{whatever}.x.x-x, you can use for your new kernel builds. This can become a bit more difficult than this, but for that you MUST read up on the specific hardware you are attempting to configure, and from there you may need to stay on top of drivers after you rebuild your kernel. This is very common for video cards whereas you will have to reinstall your video drivers after rebuilding your kernel. ______________________________ So, if you cd to /etc/src/kernel-XXX you can see your source files for your kernel. If you do not have these crucial files, you will need to install the kernel source. ################## A note about kernel building: You ultimately build the kernel you are wanting to run - a kernel that works stably with your hardware, and preferably boots quickly (that's if you can help it - some drivers take a moment to load, or fail to load). With that in mind, if the source of the kernel you have available to you is all you have available, then that is your new kernel version until you decide to upgrade {or downgrade}. You should be able to port your kernel between operating systems (Linux variants if you use the Linux kernel) if you build things properly, and actually use your .config that you ultimately build with any of the kernel releases from kernel.org when you build your kernel. _____________________________________ The configuration I will advise to build your kernel starting off with a newer kernel that has been auto-generated. If you run gentoo, you can actually use the "genkernel all" command to generate a kernel for you, then you can customize things. You can load your kernel configuration into "make menuconfig" once you locate the initial .config file which is normally located at /usr/src/kernel(linux|symlink)/.config. If this is the same directory for the source you are building from, it should automatically load, if you do not trust this, or wish to change the location for the build you want to configure, scroll all of the way down, and choose, "Load an Alternate Configuration File", such as:
As I previously stated, you will want to configure your kernel to meet your specific needs. If you want ntfs support (if you have a dual boot, or if you have a NTFS drive (partition)), add this as a module, not built into the kernel; such as: while in make menuconfig Choose:
Scroll Down until you see:
Build in NTFS support as a module:
Setup anything else you may need, Video Card, network cards, wifi cards, HAM Radio if you are licensed for it and have the equipment, or make yourself a vending machine out of a Linux box - and save your configuration.
Then build the kernel. The Build Building is really quite simple, but it can take a lot of time. -- You must be in the kernel source directory first
or you can run this as one string:
Check to make sure your grub is up to date (pointing to the correct kernel, and you have the proper arguments to boot):
The following will be customized for your specific layout! This is what I use on a machine:
After you have verified things are going to work (drive locations, and grub (or lilo) is configured to boot the new kernel), you should be good to go. |
||||||||||
Posted on: 2009/1/28 22:29
|
|
Re: Kernel Building | #2 |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Webmaster
Joined: 2007/6/10
From Dallas, TX
Posts: 79
Level : 7 HP : 0 / 170 Group:
Webmasters Registered Users |
So, if you are updating your kernel, and you would like to build with the same configuration that you currently have running; try something like the following example:
Copy the config into the newly installed kernel, and recreate the symlink in the /usr/src directory:
Now build off of the config:
|
||||||||||
Posted on: 2010/1/19 19:41
|
|
Re: Kernel Building | #3 |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Webmaster
Joined: 2007/6/10
From Dallas, TX
Posts: 79
Level : 7 HP : 0 / 170 Group:
Webmasters Registered Users |
So I just spent the last few weeks figuring out why Gentoo on my laptop wasn't working properly.
This started by I wanted to update Firefox for the Clippings plugin.
Without me paying attention, firefox required a newer version of perl and was pulled in. The emerge completes - no big deal. I go on about my way, and I notice "vi" has an error complaining about perl. So I go about attempting to rebuild packages, and end up with a lot of errors and break my box ultimately trying to perform a revdep-rebuild. My last backup of this machine, my laptop, was in 2008 - It's now 2011. Everything is running well on it with the backup, however it is old, and I can't emerge --sync as it complains it requires python-2.5, and it only had 2.4. Then complains stating it can't install because..... We all know the moral of the story. BackUp! Now to recover:
scp over the /etc/make.conf from another box that I like, and built well, edit the file to meet my requirements... Edit fstab, grub.conf yada yada-ya All builds well. Kernel issues with Video. Go Figure. Hrmmm, that's odd. I got the config to build gentoo-sources-2.6.36-r5 by booting to a pmagick Live CD as it is running a 2.6.36-r2 kernel. It discovered everything quite well once I went into menuconfig. Now I'm running an Intel 945GM on a FIC MB02 Whitebook. It's old at this point, however it works quite well. I start by attempting to use the xorg.conf, just failing out. That's odd. I keep screwing with it, googling the output when necessary because this is all quite odd. Modify the kernel a bit, and I go ahead and put in framebuffer support built into the kernel. Reboot and I just get a black screen. Try even to startx from a remote console, and it just dies on the spot. ssh session lost. I shut the lid to my laptop and it, and it freezes up. Hard crashes, can't ping it, NUMBERLOCK wont light up; then I discover it's trying to sleep it. This is at the console. So I disable all that, modifying HAL, and ACPI settings. Verifying events in /proc are correct - Which they Were!! For example, when the lid is closed, laptop-mode shows closed. Open shows open. However editing the kernel making all drivers etc built as external modules gave me the ability to startx. Then it would crash shortly thereafter. Nothing that I could tell would trigger it. Kernel after Kernel, patching, updating, and downgrading drivers - creating overlays to build in old drivers from my old backup in 2008 (I couldn't resurrect the old kernel though, and I was not able to find it either) and trying again, keeps crashing. Setup syslog-ng to accept remote logging on another host, and got minimal output which lead me nowhere, use different kernels, and crash after crash after crash.... Weeks go by. Today I figured out what I need for stability NOW with Intel Video i815 and i915 - I just rsync'ed it to another workstation with Intel Video, and it's working:
No xorg.conf! - It's not necessary Be sure to set your mouse for HAL: at minimum::
Drivers for Mouse and KeyBoard support:
Don't build in framebuffer support for intel as it will blank out your screen once the built in intelfb kicks in. This is done with no additional kernel arguments. |
||||||||||
Posted on: 2011/2/10 20:10
|
Top Previous Topic Next Topic |
|