HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Kernel Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=6)
-   -   Compile Kernel 2.6 under Debian Sarge (http://www.howtoforge.com/forums/showthread.php?t=21)

falko 21st April 2005 17:27

Compile Kernel 2.6 under Debian Sarge
 
This is a little bit different from compiling a kernel 2.6 on Debian Woody because Sarge uses grub as the boot loader (instead of lilo) and because module-init-tools, initrd-tools, procps are already installed. After all it's similar to http://www.howtoforge.com/howto_linu...compile_debian. This is how you do it:

Code:

apt-get install kernel-package libncurses5-dev fakeroot wget bzip2
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.11.7.tar.bz2
tar xjf linux-2.6.11.7.tar.bz2
cd linux-2.6.11.7/
make menuconfig

It is normally a good idea to take the configuration of your existing (working!) kernel 2.6 as a starting point for the configuration of your new kernel. Usually the current kernel configuration is saved in a file under /boot, e.g. /boot/config-2.6.3. I will load this configuration and then do the changes I desire. If you do not have the config file of a working kernel 2.6 this one might help you: http://www.falkotimme.com/howtos/deb...config-2.6.8.1

Code:

make-kpkg clean
fakeroot make-kpkg --initrd --revision=custom.1.0 kernel_image

If the compilation stops with an error, run

Code:

make clean
and then re-run the previous commands starting with

Code:

make menuconfig
Go ahead with
Code:

cd ../
dpkg -i kernel-image-2.6.11.7_custom.1.0_i386.deb

This will install your new kernel (including a ramdisk) and also update grub. You can now reboot your system, and you should then have a new kernel. You can check that by running:
Code:

uname -a

tylerdurden 28th April 2005 14:47

Nice walkthrough, thanks! :)

tyler

floobit 3rd October 2005 21:20

some errors
 
after running the apt-get update with these sources:
deb http://security.debian.org/ stable/updates main contrib non-free
deb http://secure-testing.debian.net/debian-secure-testing testing/security-updates main contrib non-free
deb http://http.us.debian.org/debian/ stable main contrib non-free
deb http://http.us.debian.org/debian/ testing main contrib non-free
deb http://http.us.debian.org/debian/ unstable main contrib non-free
deb http://debian.kcore.org/ ./


I started following the instructions. On the first line

apt-get install kernel-package ncurses-dev fakeroot wget bzip2
I encountered 2 errors. First, it informed me that:
Reading Package Lists...
Building Dependency Tree...
Package ncurses-dev is a virtual package provided by:
libncurses5-dev 5.4-9
You should explicitly select one to install.

and it installed none of the packages

so, I removed the ncurses-dev from the install list and tried again. this time, all packages were installed, but it prompted me for if I wanted to stop gdm before I installed glibc. This was slightly weird, because I logged in as "repair" from grub. also, I don't believe gdm was running, because ps -A yielded:

PID TTY TIME CMD
1 ? 00:00:00 init
2 ? 00:00:00 ksoftirqd/0
3 ? 00:00:00 events/0
4 ? 00:00:00 khelper
5 ? 00:00:00 kacpid
35 ? 00:00:00 kblockd/0
45 ? 00:00:00 pdflush
46 ? 00:00:00 pdflush
48 ? 00:00:00 aio/0
47 ? 00:00:00 kswapd0
184 ? 00:00:00 kseriod
293 ? 00:00:00 kjournald
346 ? 00:00:00 udevd
1452 ? 00:00:00 khubd
2731 ? 00:00:00 dhclient
2736 ? 00:00:00 portmap
3083 tty1 00:00:00 init
3101 tty1 00:00:00 bash
3497 tty1 00:00:00 ps


I chose to install glibc anyway, but can easily start over if I need to.

Thanks,
Dylan Evans

falko 3rd October 2005 22:04

Quote:

Originally Posted by floobit
after running the apt-get update with these sources:
deb http://security.debian.org/ stable/updates main contrib non-free
deb http://secure-testing.debian.net/debian-secure-testing testing/security-updates main contrib non-free
deb http://http.us.debian.org/debian/ stable main contrib non-free
deb http://http.us.debian.org/debian/ testing main contrib non-free
deb http://http.us.debian.org/debian/ unstable main contrib non-free
deb http://debian.kcore.org/ ./


I started following the instructions. On the first line

apt-get install kernel-package ncurses-dev fakeroot wget bzip2
I encountered 2 errors. First, it informed me that:
Reading Package Lists...
Building Dependency Tree...
Package ncurses-dev is a virtual package provided by:
libncurses5-dev 5.4-9
You should explicitly select one to install.

and it installed none of the packages

so, I removed the ncurses-dev from the install list and tried again. this time, all packages were installed, but it prompted me for if I wanted to stop gdm before I installed glibc. This was slightly weird, because I logged in as "repair" from grub. also, I don't believe gdm was running, because ps -A yielded:

PID TTY TIME CMD
1 ? 00:00:00 init
2 ? 00:00:00 ksoftirqd/0
3 ? 00:00:00 events/0
4 ? 00:00:00 khelper
5 ? 00:00:00 kacpid
35 ? 00:00:00 kblockd/0
45 ? 00:00:00 pdflush
46 ? 00:00:00 pdflush
48 ? 00:00:00 aio/0
47 ? 00:00:00 kswapd0
184 ? 00:00:00 kseriod
293 ? 00:00:00 kjournald
346 ? 00:00:00 udevd
1452 ? 00:00:00 khubd
2731 ? 00:00:00 dhclient
2736 ? 00:00:00 portmap
3083 tty1 00:00:00 init
3101 tty1 00:00:00 bash
3497 tty1 00:00:00 ps


I chose to install glibc anyway, but can easily start over if I need to.

Thanks,
Dylan Evans

Have you been successful in installing your new kernel, or did you encounter problems?

floobit 3rd November 2005 00:32

sorta...
 
My kernel compiled completely with some warnings. When I rebooted, it gave me a
Code:

VFS: Cannot open root device "hdb1" or unknown block (0,0)
kernel panic: not syncing: unable to mount root fs on unknown-block(0,0)

I have two physical HDs, one 6.4 gig (primary slave) with / and a swap on it, and a 80 gig with windows and /home and a swap. I believe the ramdrive installed correctly (at least no errors popped up) and I used my earlier kernel as a start point, and it boots fine. Any ideas?

Dylan

falko 3rd November 2005 02:49

What's in /boot/grub/menu.1st?

floobit 3rd November 2005 05:01

Code:

title                Debian GNU/Linux, kernel 2.6.13.4
root                (hd1,0)
kernel                /boot/vmlinuz-2.6.13.4 root=/dev/hdb1 ro
savedefault
boot

+ an identical (recovery mode)

and my vanilla kernel

Dylan

falko 3rd November 2005 11:09

I need to see the whole file, not just an excerpt.

floobit 3rd November 2005 16:05

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hdb1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## ## End Default Options ##

title Debian GNU/Linux, kernel 2.6.13.4
root (hd1,0)
kernel /boot/vmlinuz-2.6.13.4 root=/dev/hdb1 ro
savedefault
boot

title Debian GNU/Linux, kernel 2.6.13.4 (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.13.4 root=/dev/hdb1 ro single
savedefault
boot

title Debian GNU/Linux, kernel 2.6.8-2-k7
root (hd1,0)
kernel /boot/vmlinuz-2.6.8-2-k7 root=/dev/hdb1 ro
initrd /boot/initrd.img-2.6.8-2-k7
savedefault
boot

title Debian GNU/Linux, kernel 2.6.8-2-k7 (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.8-2-k7 root=/dev/hdb1 ro single
initrd /boot/initrd.img-2.6.8-2-k7
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

falko 3rd November 2005 16:32

You have no initrd line for your new kernel. Maybe that causes the error.


All times are GMT +2. The time now is 08:40.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.