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

Building kernels the Debian way (was: DPT2044W SCSI adaptor with disk installed but no /dev/sd* devices created)



I feel the need to correct a few bad ideas here.

On 2008-12-08 21:53 +0100, subscriptions wrote:

> Download the source code and unpack

Note, none but one of the steps below require root privileges if you are
a member of the `src' group or perform them below your home directory
instead of /usr/src.

> root# cd /usr/src
> root# wget
> http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.1.tar.bz2
> root# bzip2 -d linux-2.6.22.1.tar.bz2
> root# tar -xvf linux-2.6.22.1.tar

Wasting time. Use "tar xjf linux-2.6.22.1.tar.bz2" instead of the last
two steps.

> Create new default link to new source code 

This is absolutely unnecessary and maybe even harmful.  Read the README
in the Linux kernel tree why you should not do it.

> root# cd /usr/src
> root# rm linux
> root# ln -s linux-2.6.22.1 

Omit these steps.

> Create a new config file based on the old one, this will prompt for new
> configuration settings. Read carefully every question. 
> root# make oldconfig

Finally, some good advice.  But before this step, you need to copy your
old config to linux-2.6.22.1/.config and cd to the kernel directory.

> Compile the kernel into .DEB package 
> root# fakeroot make-kpkg --append-to-version "-newkernel" \
>  --revision "20081208"  --us --uc --initrd kernel_image

Using fakeroot is redundant if you are root, but necessary if you follow
my advice and do this as normal user.

> Then install .deb packages created in parent directory

This is really the only step that requires root privileges.

> and link linux
> link to the new header directory in /usr/src. 

No, do not do that.

Sven


Reply to: