LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-15-2004, 06:26 AM   #1
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Rep: Reputation: 15
Compiling my own kernel


I have been messing about for a couple of months now trying to compile my own kernel. I have read a couple of howtos. This is what I did:

apt-get install kernel-source-2.6.7
cd /usr/src
tar -jxvf kernel-source-2.6.7.tar.bz2
apt-get remove kernel-source-2.6.7
cd kernel-source-2.6.7
make xconfig
make-kpkg kernel-image
cd ..
dpkg -i kernel-image-2.6.7_10.00.Custom_i386.deb

When I try and boot using this kernel I get:

VFS: Cannot open root device "hda2" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount fs on unknown-block(0,0)

I have pretty much left evrything as the default in make xconfig as I don't understand most of the options anbd there are so many.

Any ideas?
 
Old 08-15-2004, 06:44 AM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
is /dev/hda2 your root device?

than you may have forgotten to compile your kernel with support for the filesysten you are using on /dev/hda2 (compiled into the kernel -not as a module!)

You did rerun lilo right - after you installed the new kernel and updated /etc/lilo.conf ?
 
Old 08-15-2004, 07:55 AM   #3
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Original Poster
Rep: Reputation: 15
I boot using grub not lilo, this is the new kernels entry from my menu.lst:

title Debian GNU/Linux, kernel 2.6.7
root (hd0,1)
kernel /boot/vmlinuz-2.6.7 root=/dev/hda2 ro
savedefault
boot

This is an entry for another kernel that works fine:

title Debian GNU/Linux, kernel 2.6.7-1-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.7-1-386 root=/dev/hda2 ro
initrd /boot/initrd.img-2.6.7-1-386
savedefault
boot

What is the initrd line for?
 
Old 08-15-2004, 08:07 AM   #4
Dialore
Member
 
Registered: Aug 2004
Location: Toronto, Canada
Distribution: Debian, Mandrake, Fedora
Posts: 38

Rep: Reputation: 15
I once had a similar error (I don't remember exact output, but the symptoms were the same) when the boot/root partition had ReiserFS and the new kernel had ReiserFS driver compiled (by default) as a module. The most straightforward workaround - to recompile the kernel with the FS driver built-in.

Initrd means initial ram disk, by default Sarge uses it during its boot sequence.
 
Old 08-15-2004, 01:40 PM   #5
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
same thing for 2.6.7-2 and 2.6.7-3 with debian's SID.
My configuration worked from 2.6.2 --> 2.6.7-2 with hiccups along the way with 2.6.5 that left with 2.6.6-X

Please visit my post...same exact symptoms...think it is in kernel and not in debian patches as I believe the debian 2.6.7-3 and -4 were like crossover kernels to 2.6.8. Well mine hiccups with a pristine kernel from kernel.org without any patching at the same place with exact same error.

Lets issue some kinda error report or something to do our duty.
 
Old 08-16-2004, 04:52 AM   #6
cryptwizard
Member
 
Registered: Aug 2004
Location: Sydney, Australia
Distribution: Debian Squeeze
Posts: 49

Rep: Reputation: 15
try:

rdev /dev/hdxXX

replace x and XX with whatevers appropiate.
that will cahnge the root device.
if that doesnt work try when booting add:

root=/dev/hdxXX

once again replace all stuff
 
Old 08-16-2004, 06:15 AM   #7
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
Check out my url of lilo.conf and .config ==> http://www.linuxquestions.org/questi...12#post1109912


I'll try rdev=/dev/hda5

If that doesnt work, and if its not something new placed in between releases (since it began with 2.6.7-3 and extended to -4 and a pristine kernel.org 's 2.6.8-1) then its a bug--maybe even with lilo.

Dunno. Will give it a go and thank.

Remember before posting--my lilo works for 2.6.2, .3, .4, .5 *, .6, and the first an dsecond releases of 2.6.7.

Thanks again.

Will I be frozen at 2.6.7-2?

Last edited by Outabux; 08-16-2004 at 06:18 AM.
 
Old 08-16-2004, 07:15 AM   #8
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,249

Rep: Reputation: 101Reputation: 101
As one of the previous posts says, the problem is that your kernel needs an initrd to boot. The steps you took:
Quote:
apt-get install kernel-source-2.6.7
cd /usr/src
tar -jxvf kernel-source-2.6.7.tar.bz2
apt-get remove kernel-source-2.6.7
cd kernel-source-2.6.7
make xconfig
make-kpkg kernel-image
cd ..
dpkg -i kernel-image-2.6.7_10.00.Custom_i386.deb
Are fine except you should make and initrd kernel when you run "make-kpkg":
Code:
make-kpkg --initrd kernel_image
Also be sure to run "make-kpkg clean" before starting to compile a new kernel. You should also probably add an append to name so that your custom kernel isn't confused with another one. The append to name can be a date, your own version number, your name, etc. So the steps to take would be:
Code:
apt-get install kernel-source-2.6.7
cd /usr/src
tar -jxvf kernel-source-2.6.7.tar.bz2
ln -s kernel-source-2.6.7 linux
cd /usr/src/linux
make xconfig
make-kpkg clean
make-kpkg --initrd --append-to-version=name kernel-image
cd ..
dpkg -i kernel-image-2.6.7name_10.00.Custom_i386.deb
Now when you install your custom kernel with dpkg, it will create an initrd image as well as a kernel image for it in /boot. Make an entry for grub similar to the working one you posted.
 
Old 08-16-2004, 10:36 AM   #9
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
rdev=/dev/hda5 wasn't recognized by lilo, tried it as an append = "rdev=/dev/hda5"-->no errors at lilo, but same thing at boot up.


I'll try the make-clean and the initrd stuff, but what gets me is that 2.6.8, a new boy doesn't work. I can go right back into 2.6.7-2 or -1 without problems. Whats great about 2.6.7-2, i dont have to recompile ndiswrapper for wireless stuff or nvidia driver for card...

oh well will try those things suggested.

The initrd thing is screwy, someone else gave me that one, i tried it and it said nothing to do for "all"

but will try in those steps
 
Old 08-16-2004, 11:40 AM   #10
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
I.
Beast_Boy:/usr/src# apt-get remove kernel-image-2.6.8.1_10.00.Custom_i386.deb
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package kernel-image-2.6.8.1_10.00.Custom_i386.deb
Beast_Boy:/usr/src# apt-get remove kernel-image-2.6.8.1
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
kernel-image-2.6.8.1
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 6758kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 65381 files and directories currently installed.)
Removing kernel-image-2.6.8.1 ...
Beast_Boy:/usr/src#

II.
Beast_Boy:/usr/src/linux# make-kpkg clean
/usr/bin/make -f /usr/share/kernel-package/rules real_stamp_clean
make[1]: Entering directory `/usr/src/linux-2.6.8.1'
test ! -f .config || cp -pf .config config.precious
test -f Makefile && \
/usr/bin/make ARCH=i386 distclean
make[2]: Entering directory `/usr/src/linux-2.6.8.1'
CLEAN arch/i386/boot/compressed
CLEAN arch/i386/boot
CLEAN arch/i386/kernel
CLEAN drivers/char
CLEAN drivers/ieee1394
CLEAN drivers/pci
CLEAN drivers/scsi/aic7xxx
CLEAN drivers/video/logo
CLEAN init
CLEAN kernel
CLEAN lib
CLEAN usr
CLEAN .tmp_versions
CLEAN include/asm-i386/asm_offsets.h vmlinux System.map .tmp_kallsyms1.S .tmp_kallsyms1.o .tmp_kallsyms2.S .tmp_kallsyms2.o .tmp_vmlinux1 .tmp_vmlinux2 .tmp_System.map
CLEAN scripts/basic
CLEAN scripts/kconfig
CLEAN scripts/lxdialog
CLEAN scripts/mod
CLEAN scripts/package
CLEAN scripts
CLEAN include/config
CLEAN .config .config.old include/asm .version include/linux/autoconf.h include/linux/version.h Module.symvers
make[2]: Leaving directory `/usr/src/linux-2.6.8.1'
test ! -f config.precious || mv -f config.precious .config
test ! -f stamp-patch || /usr/bin/make -f /usr/share/kernel-package/rules unpatch_now
test -f stamp-building || test -f debian/official || rm -rf debian
rm -f modules/modversions.h modules/ksyms.ver debian/files conf.vars scripts/cramfs/cramfsck scripts/cramfs/mkcramfs applied_patches debian/buildinfo stamp-build stamp-configure stamp-source stamp-image stamp-headers stamp-src stamp-diff stamp-doc stamp-buildpackage stamp-libc-kheaders stamp-debian stamp-patch stamp-kernel-configure
rm -rf debian/tmp-source debian/tmp-headers debian/tmp-image debian/tmp-doc
make[1]: Leaving directory `/usr/src/linux-2.6.8.1'

III. Ruh Roh! Got this:
Beast_Boy:/usr/src/linux# make-kpkg --initrd --append-to-version=pristine1 kernel-image
Warning: You are using the initrd option, that may not
work unless you have applied the initrd cramfs patch to
the kernel, or modified mkinitrd not to use cramfs by
default. The cramfs initrd patch, is included in the
Debian supplied kernel sources, but is not present in
pristine kernel sources.
By default, I assume you know what you are doing, and I
apologize for being so annoying. Should I abort[Ny]?
y
Aborting.

So I will try with 2.6.7-4 (Debian Kernel) here goes ...

Same stuff, and heres my image:

Beast_Boy:/usr/src# ls -al
total 36864
drwxrwsr-x 8 root src 4096 Aug 16 11:39 .
drwxr-xr-x 12 root root 4096 Jul 19 12:28 ..
-rw-r--r-- 1 root src 3325462 Aug 16 11:22 kernel-image-2.6.7four_10.00.Custom_i386.deb
drwxr-xr-x 4 root root 4096 Jul 19 06:25 kernel-patches
drwxr-xr-x 20 root root 4096 Jul 19 06:25 kernel-source-2.6.6
drwxr-xr-x 20 root root 4096 Aug 16 11:22 kernel-source-2.6.7
drwxr-xr-x 20 root root 4096 Jul 19 06:25 kernel-source-2.6.7-works
-rw-r--r-- 1 root root 34343606 Aug 5 11:49 kernel-source-2.6.7.tar.bz2
lrwxr-xr-x 1 root src 19 Aug 16 11:03 linux -> kernel-source-2.6.7
drwxr-sr-x 3 root src 4096 Jul 19 06:25 modules
drwxr-xr-x 7 root root 4096 Jul 19 06:25 rpm


Seeyall in a minute,

Last edited by Outabux; 08-16-2004 at 11:41 AM.
 
Old 08-16-2004, 11:46 AM   #11
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
Beast_Boy:/usr/src# dpkg -i kernel-image-2.6.7four_10.00.Custom_i386.deb
Selecting previously deselected package kernel-image-2.6.7four.
(Reading database ... 65165 files and directories currently installed.)
Unpacking kernel-image-2.6.7four (from kernel-image-2.6.7four_10.00.Custom_i386.deb) ...

You are attempting to install an initrd kernel image (version
2.6.7four) but you do not seem to have a mkinitrd command in the
path. This will break the installation, unless initrd-tools are also
being installed right now.

Could not find mkinitrd in path. at /var/lib/dpkg/tmp.ci/preinst line 186.

You are attempting to install an initrd kernel image (version 2.6.7four)
This will not work unless you have configured your boot loader to use
initrd. (An initrd image is a kernel image that expects to use an INITial
Ram Disk to mount a minimal root file system into RAM and use that for
booting).

As a reminder, in order to configure LILO, you need
to add an 'initrd=/initrd.img' to the image=/vmlinuz
stanza of your /etc/lilo.conf

I repeat, You need to configure your boot loader -- please read your
bootloader documentation for details on how to add initrd images.

If you have already done so, and you wish to get rid of this message,
please put
`do_initrd = Yes'
in /etc/kernel-img.conf. Note that this is optional, but if you do not,
you'll continue to see this message whenever you install a kernel
image using initrd.
Do you want to stop now? [Y/n]

I'll choose no. If it oops or something, I'll modifiy lilo: dunno how yet but will try to find out by reading man or something else googling or here. But if ya got it, give it, please : )
 
Old 08-16-2004, 11:50 AM   #12
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
Whew!

Do you want to stop now? [Y/n]n
dpkg: dependency problems prevent configuration of kernel-image-2.6.7four:
kernel-image-2.6.7four depends on initrd-tools (>= 0.1.48); however:
Package initrd-tools is not installed.
dpkg: error processing kernel-image-2.6.7four (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
kernel-image-2.6.7four
Beast_Boy:/usr/src# apt-get install initrd-tools
Reading Package Lists... Done
Building Dependency Tree... Done
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
initrd-tools: Depends: cramfsprogs (>= 1.1-4) but it is not going to be installed
Depends: dash but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Beast_Boy:/usr/src# apt-get install initrd-tools
Reading Package Lists... Done
Building Dependency Tree... Done
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
initrd-tools: Depends: cramfsprogs (>= 1.1-4) but it is not going to be installed
Depends: dash but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Beast_Boy:/usr/src# apt-get -f install
Reading Package Lists... Done
Building Dependency Tree... Done
Correcting dependencies... Done
The following extra packages will be installed:
cramfsprogs dash initrd-tools
The following NEW packages will be installed:
cramfsprogs dash initrd-tools
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 130kB of archives.
After unpacking 471kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 ftp://ftp.us.debian.org unstable/main cramfsprogs 1.1-6 [21.3kB]
Get:2 ftp://ftp.us.debian.org unstable/main dash 0.5.1-2 [81.9kB]
Get:3 ftp://ftp.us.debian.org unstable/main initrd-tools 0.1.73 [26.5kB]
Fetched 130kB in 7s (16.4kB/s)
Preconfiguring packages ...
Selecting previously deselected package cramfsprogs.
(Reading database ... 65383 files and directories currently installed.)
Unpacking cramfsprogs (from .../cramfsprogs_1.1-6_i386.deb) ...
Selecting previously deselected package dash.
Unpacking dash (from .../archives/dash_0.5.1-2_i386.deb) ...
Selecting previously deselected package initrd-tools.
Unpacking initrd-tools (from .../initrd-tools_0.1.73_all.deb) ...
Setting up cramfsprogs (1.1-6) ...
Setting up dash (0.5.1-2) ...

Setting up initrd-tools (0.1.73) ...

Setting up kernel-image-2.6.7four (10.00.Custom) ...
/initrd.img does not exist. Installing from scratch, eh?
Or maybe you don't want a symbolic link here. Hmm? Lets See.
I notice that you do not have initrd.img symbolic
link. I can create one for you, and it shall be
updated by newer kernel image packages. This is
useful if you use a boot loader like lilo.
Do you want me to create a link from /boot/initrd.img-2.6.7four to initrd.img?[Yn]
A new kernel image has been installed, and usually that means
that some action has to be taken to make sure that the new
kernel image is used next time the machine boots. Usually,
this entails running a ``bootloader'' like SILO, loadlin, LILO,
ELILO, QUIK, VMELILO, ZIPL, or booting from a floppy. (Some
boot loader, like grub, for example, do not need to be run on
each new image install, so please ignore this if you are using
such a boot loader).

A new kernel image has been installed at /boot/vmlinuz-2.6.7four
(Size: 1767kB)


Initial rootdisk image: /boot//initrd.img-2.6.7four (Size: 1276kB)

Symbolic links, unless otherwise specified, can be found in /

LILO sets up your system to boot Linux directly from your hard
disk, without the need for booting from a boot floppy.


WARNING
If you are keeping another operating system or another version
of Linux on a separate disk partition, you should not have LILO
install a boot block now. Wait until you read the LILO documentation.
That is because installing a boot block now might make the other
system un-bootable. If you only want to run this version of Linux,
go ahead and install the boot block here. If it does not work, you
can still boot this system from a boot floppy.

You already have a LILO configuration in /etc/lilo.conf
Install a boot block using the existing /etc/lilo.conf? [Yes]
Testing lilo.conf ...
Testing successful.
Installing the partition boot sector...
Installation successful.

Now lessee...?
Maybe, stuff still not quite right with packages (SID side, cause i've got unstable, testing, and stable as sources-->clears up a lotta junk when stuff just comes out and its not all on server yet for apt-get )

Oh well here goes!

Last edited by Outabux; 08-16-2004 at 04:35 PM.
 
Old 08-16-2004, 12:11 PM   #13
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
Voila,



Beast_Boy:~# uname -a
Linux Beast_Boy 2.6.7four #1 Mon Aug 16 11:17:04 CDT 2004 i686 GNU/Linux
Beast_Boy:~#



From KDE3.3! (nvidia, no prob...,ndiswrapper no prob after reboot)!

Thank You! Now I gotta go back and look at all this stuff. Makes a great way for me to go back and study it!

for 2yrs.

Last edited by Outabux; 08-16-2004 at 12:14 PM.
 
Old 08-16-2004, 04:40 PM   #14
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
Was this a problem with not having the initrd-tools and other packages installed as compared to actually having to need them to create an initrd image even when one isn't necesary (mostly monolithic kernel, filesystems, ...) I think?

Oh yeah this is the first *initrd.img i've ever seen in /boot !
Nothing in the directory /initrd .

What is it for? /initrd that is ...


Ill check to see if it is a packaging thing or if in fact i need to include this in my kernel building in another ext3 partition/debian os.

Cheers!
 
Old 08-17-2004, 01:26 AM   #15
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
Well I'm in my "working OS" partition (2.6.7-4) preparing for 2.6.8-1 after performing a custom kernel upgrade (2.6.8-1) in my "kernel develpment OS" partition without any use of the

--initrd

in make-kpkg --initrd kernel-image.

Only thing i did differently for that develpmental os partition and here was use the make-kpkg clean...did that make difference or gcc g++ versions? dunno,

but am going to install 2.6.8-1 in my working os partition

lessee and keep fingers crossed though I'm pretty confident...

n thanx again...
if it indeed works as advertised, without --initrd (higly monolithic kernel, filesystem os is compiled in) then hopefully no problems and i can remove 2.6.7 altogether

well here goes



It worked without an --initrd switch However, 2.6.8,bzflag,nvidia 6111 dont get along
with the F12 key


instead of ending game, it ends X-Server or resets it if kdm enabled

went bak to 5336 and ok mostly, quick end left a windowed bzflag that could not be refreshed, suddenly cpu went to 100%
killedX-Server, rebooted, everything is ok so far as I can tell

will be watching for more posts

HOW do u make an initrd if u dont use the make-kpkg stuff

like the regular make, make modules, make bzimage--> that stuff


Last edited by Outabux; 08-17-2004 at 02:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling kernel = kernel panic Tons of Fun Debian 5 07-02-2005 01:59 PM
Compiling kernel module for linux kernel 2.4 in 2.6 guam Linux - Software 0 01-13-2005 02:02 AM
Where Is Kernel Directory In Rh9(kernel 2.4.20-8), For Compiling HSP56 MR(pctel) Mode rudy3107 Linux - Software 1 07-25-2004 04:17 AM
Compiling new kernel joseph Linux - Software 2 10-14-2003 07:26 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration