[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kernel-compiling noob



Chuckk Hubbard wrote:
On 7/24/06, John O'Hagan <johnohagan@iprimus.com.au> wrote:

My suggestion would be to google for some recent and more Debian-specific
kernel-compile how-to's; for example, using make-kpkg makes it a lot simpler
by making a .deb kernel package you can then install just like a regular
package. You do have to move /lib/modules/$KERNEL_VERSION out of the way if you are re-compiling the same kernel version, but I think you get prompted
for that.

OMG, the README for kernel-package is murder.  I was hoping to take
the most recent stable kernel source from kernel.org, apply the Debian
and realtime and mm patches, and build the kernel.  I'm having trouble
finding any documentation on Debian or AGNULA for doing both; each has
different instructions, and the AGNULA doc actually says the process
won't include the Debian patches.
My reasons are that the latest AGNULA-distributed kernel is 2.6.14,
and udev requires 2.6.15, and the only 2.6.15 in any of my packages is
a transition.
I'm struggling to grasp all of this, but as I understand it, if I want
AGNULA and udev I'll have to compile it myself.  Also, as I said
before, Rosegarden requires finer timing res than the standard AGNULA
kernel.

Am I going about this right?  I d/l the kernel source from kernel.org,
find the Debian and multimedia patches, apply the patches, and then
follow one of the sets of instructions to get jiggy with it.

Thanks.
-Chuckk


I've done this recently in Sid (unstable) on a PII-266 with 256 MiB RAM, but the following details are from memory , not guaranteed to work and are probably more of a security hazard than many feel comfortable with, and may cause frustration hazardous to family members, your pets and your health.

You need to download the following Debian packages:

linux-source-2.6.17
realtime-lsm and
realtime-lsm-source (if your audio apps require it), and
kernel-package

linux-source-2.6.17 contains the kernel with Debian patches.

I also recommend the alsa-source package, both for up-to-date ALSA modules and the directions for compilation included in /usr/share/doc/alsa-source/README.Debian

and have

binutils, bzip2, libncurses-dev, gcc, libc6-dev, and make

installed. (Check under aptitude for requires, suggests and recommends lists of packages under linux-source-2.6.17, alsa-source, make-kpkg, and realtime-lsm-source, and install anything missing)

The -source packages each leave .bz2 files in the directory /usr/src

As root I did:

cd /usr/src

bzip2 -dc linux-source-2.6.17.tar.bz2|tar -xvf /dev/fd/0
bzip2 -dc alsa-driver.tar.bz2|tar -xvf /dev/fd/0
bzip2 -dc realtime-lsm.tar.bz2|tar -xvf /dev/fd/0

The packages alsa-driver and realtime-lsm archives unpack to /usr/usr/modules

To make a kernel optimised for realtime audio work, (based on the AGNULA hints), I started with the config provided with the Debian package "linux-image-2.6-686" (ie I installed linux-image-2.6-686 which installs the latest Debian unstable Linux kernel, then did):

cp /boot/config-2.6.17-1-686 /usr/src/linux-source-2.6.17/.config

then

cd /usr/src/linux-source-2.6.17

then

make menuconfig

which took a little while compiling the menu, then brings up a curses interface to picking kernel options.

Under "Processor family" I selected the CPU type I had, under "Preemption Model" I selected Preemptible Kernel (Low-Latency Desktop), and selected "Preempt The Big Kernel Lock", then escaped back to the top menu and further down under "Security options" typed M for "Default Linux Capabilities". Without that, realtime-lsm can't be used.

Then I compiled the kernel with

make-kpkg --initrd kernel-image

This took about 13 hours on my machine.

At the end, assuming that you had all the required disk space and packages, you have a package created:

/usr/src/linux-image-2.6.17_2.6.17-10.00.Custom_i386.deb

This can be installed using:

dpkg -i /usr/src/linux-image-2.6.17_2.6.17-10.00.Custom_i386.deb

This put the entry for the new kernel in grub so it could be selected at boot time.

I then shutdown and rebooted, selecting the kernel I had just installed, then as root did:

cd /usr/src/linux

dpkg-reconfigure alsa-source
(to only pick the sound card I had installed)

then looked at /usr/share/docs/alsa-source/README.Debian then ran

make-kpkg modules-image

this compiled the latest alsa-modules and realtime-lsm and built the packages:

/usr/src/alsa-modules-2.6.17_1.0.11-somethingorother.Custom_i386.deb
/usr/src/realtime-lsm-module-2.6.17_0.1.1-somethingelse.Custom_i386.deb

These were installed with dpkg -i then I shutdown and rebooted into the new kernel, saw that realtime-lsm loaded ok, and did

cat /proc/asound/version

to verify that the new ALSA modules had been installed.

That way, I obtained a kernel optimised for the CPU it was running on and for realtime support for audio, but otherwise the same as the Debian kernel.

I have had suggested to me that I use the package "module-assistant" but I found it more trouble than the directions in /usr/share/docs/alsa-source/README.Debian Also, the 2 reboots may not be necessary, but compiling modules seemed to go better if it was done under the customised kernel (no version number complaints).

If there are any other glaring omissions, suggestions, warnings, improvements I'd be glad to hear them.

The main problem I had was getting over the learning curve of building kernel modules.



Reply to: