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

RE: Kernel compile the old way




I went to compile a vanilla kernel from kernel.org, and so read the
directions at the Debian site.  They seem to me to be needlessly
complicated.  Is there something in Debian which would prevent me from
compiling a kernel the good old fashioned way --

make menuconfig
make && make modules_install
cp bzImage and System.map to /boot
edit the grub menu

-- and skip the initrd whatever?  And, if so, where does Debian load the
modules from, so I can edit that too?  It's not /etc/modules - only a
few there.

Any advice appreciated.  Thanks.

I'm currently in the unstable tree and I build my own kernels all the time.
I have not found any compelling reason to get the plain vanilla kernel
source, nor going the "make-kpkg --revision 1 kernel_image" route.  Once I
had a working .conf file I reuse that for every kernel rebuild.  I use the
linux-source-{version} from debian for my rebuilds.  And I don't have to
name my kernels, of mess with grub, once it's set up.

The steps are:
make menuconfig
make bzImage
make modules
make modules_install

and the one step that everyone leaves out, which handles grub:

make install

In point of fact, that last step does nothing specifically with grub.  What
it does do is change the symbolic links.  That is, it changes /boot/vmlinuz
to link to the latest built kernel, and /boot/vmlinuz.old to the previously
built kernel.  Grub always points to /boot/vmlinuz and /boot/vmlinuz.old.
The downside of this is that your previous build always becomes vnlinuz.old,
even if it's the same version.  The upside is that all previously built
kernels remain in /boot untill you remove them.

My problem, is that I can never remember which version I'm using.  What I
mean is, I can't remenber if linux-sourse-2.6.18-4 or 2.6.18-5 is my working
kernel.  The .config file has a variable under '# General setup' called
CONFIG_LOCALVERSION which I set to the version I'm currently building.  In
my current case, it's set as:

CONFIG_LOCALVERSION="-5"

So when I do a uname -a, I see the the Linux version as 2.6.18-5, instead of
2.6.18.  It comes in handy.

When you build a particular kernel source for the first time, you don't have
to run 'make clean'.  This is only needed if you have to rebuild the
specific kernel a second or third time.

You can always see the versions available by simply doing:

apt-get install linux-source

If you're currently using linux-source-2.6.16, don't do an "apt-get remove
linux-source-2.6.16" until you have had a successful build on
linux-source-2.6.18.

Good luck.  -mike



Reply to: