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

Re: step by step kernel recompile



There are 2 ways that I know to do it, the debian method and the
conventional method. (Replace all references to a specific kernel with a
kernel of your choice)

Disclaimer: I am NOT a kernel guru, but I do compile kernels frequently and
I know that my preferred method in each step works (assuming I have not made
any typos) In addition, if anyone else has more to add or corrections to
make, I am highly interested.

STEP 1: Get the kernel source (I prefer the conventional method)

Debian method: 
  apt-get install kernel-source-2.2.19 (or whatever)
  cd /usr/src 
  tar -xpvjf kernel-source-2.4.2.tar.bz2
  rm /usr/src/linux (assuming it exists as a symlink)
  ln -s kernel-source-2.4.2 linux

Conventional method:
  cd /usr/src wget 
  http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.2.bz2
  tar -xpvjf linux-2.4.2.bz2
  mv linux linux-2.4.2
  ln -s linux-2.4.2 linux
  (Note: as you will notice I prefer linux as a link)
Get and apply ac patch (optional):
  wget http://www.kernel/org/pub/linux/kernel/people/alan/2.4/
       patch-2.4.2-ac28.gz
  gzip -d patch-2.4.2-ac28.gz
  cd /usr/src/linux
  patch -l -p1 < ../patch-2.4.2-ac28 (Note: dash el dash pee one)

STEP2 2: Customize/configure kernel
  cd /usr/src/linux
  make menuconfig
  (Each config item is pretty well documented. At any rate, I will not
   attempt to address configure options here)

STEP 3: Compile the kernel (I prefer the debian method)

Debian method: 
  (Make sure and read man pages on make-kpkg. I'm not sure I have all
   of it's fine points down, but the following is simple and works for me)
  make-kpkg clean
  make-kpkg --revision custom.1.0 kernel_image
  dpkg -i ../kernel-image-2.4.2_custom.1.0_i386.deb

Traditional method:
  (its been an while since I've done it this way, so I hope I haven't
   forgotten anything)
  make dep
  make clean
  make bzImage
  make modules
  make modules install
  cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.4.2
  cp /usr/src/linux/System.map /boot/System.map-2.4.2
  mv /vmlinuz /vmlinuz.old
  ln -s /boot/vmlinuz-2.4.2 /vmlinuz

Hope this helps

-- 
Charles Lewis
lewisc@delta.swau.edu
817-556-4720


> 
> Does anyone know a good link to some straight forward step-by-step
> instructions on how to recompile the linux kernel? I need to up the max
> processes per user (by altering /usr/include/linux/tasks.h) and in order for
> it to stick, I need to recompile the kernel. Ulimit doesn't work so don't
> pass me off to that. From everything I hear, I must do it this way. Thanks.
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
> 



Reply to: