Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Kernel compile and install for newbies

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
Olaf
Posts: 1
Joined: 2009-03-06 19:44

#16 Post by Olaf »

Can someone tell me whats going wrong?

After the compiling I get this lines at the end.

Code: Select all

make[1]: Leaving directory `/home/danne/new/linux-source-2.6.26'
/usr/bin/make    ARCH=i386 \
			     -C Documentation/lguest
make[1]: Entering directory `/home/danne/new/linux-source-2.6.26/Documentation/lguest'
cc -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include    lguest.c  -lz -o lguest
lguest.c:34:18: error: zlib.h: Filen eller katalogen finns inte
make[1]: *** [lguest] Fel 1
make[1]: Leaving directory `/home/danne/new/linux-source-2.6.26/Documentation/lguest'
make: *** [debian/stamp/build/kernel] Fel 2
Filen eller katalogen finns inte = The file or directory doesnt exist
Fel = Wrong

User avatar
patrick
Posts: 35
Joined: 2007-06-10 14:57
Location: Holland Massachusetts U.S.A.
Contact:

#17 Post by patrick »

I just want to say thank you to all that have responded to my questions.

I did a system update and things went crazy on me. It is fine now. I also got real sick along with the rest of my house. :) I feel a little better now, but need to go and install a water heater for a customer $$ :)

Well anyways I will most likely do the kernel compile and the suggestions everybody has been so kind to offer tonight or tomorrow.

I did not want to be one of those people that asks for help and never gets back to say how things are going.

Thanks all for helping
Debian Lenny/Squeeze
Journeyman Plumber Massachusetts U.S.A.
If i can learn Linux any person can. I'm just a Plumber ya know.

infinitycircuit
Posts: 1137
Joined: 2007-07-24 03:31
Location: California

#18 Post by infinitycircuit »

Rolling Stone wrote:
infinitycircuit, to make that adjustment to the guide, I'd just have to replace the make-kpkg line with that one and add the fakeroot package to the things to install at the top of it, right? What are those kernel_headers and where are they used exactly? I don't need to use update-grub there do I since the initrd is now made by make-kpkg?

You can't have 2 kernels with the same name (as in uname -r), can you? (Despite them having separate revision number.) Perhaps I should point this out in the guide, if it indeed is so.

I'll now proceed to edit the guide to heed to this new-to-me knowledge, please do comment if I got it wrong.
Yeah, that's the way you would change it. kernel_headers include the C headers that are needed if you want to compile modules against the kernel (e.g., if you want to compile nvidia graphics drivers.) update-grub will be called as part of the postinst of dpkg when you install the .deb.

You can have 2 kernels with separate append-to-version's, but not with separate revision's, because make-kpkg's revision refers to the debian revision of the kernel.

User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

#19 Post by Rolling Stone »

Somebody really should write a proper graphical tool for configuring the kernel. To put it nicely, our current options are half arsed. :evil:

The search facilities range from quite lacking to non-existent... having such kludgey tools makes the simple excercise a PITA. Every hour spent writing a better tool would save years of collective Linux users' lives. Then again, I believe that (manual, guided or automagical) compiling of a custom kernel should be the last step of the debian-installer process.

/rant
infinitycircuit wrote:compile modules against the kernel (e.g., if you want to compile nvidia graphics drivers.)
I thought the nvidia driver was a binary blob? :x

Stian1979
Posts: 316
Joined: 2007-07-29 14:57

#20 Post by Stian1979 »

Telemachus wrote: [*] Download the vanilla kernel sources, or the Debianized kernel sources to this directory, untar it and cd into the new directory. Do all of this as a regular user with no special privileges.
Where do I find the vanilla kernel?

User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

#21 Post by Rolling Stone »

At kernel.org.

User avatar
Telemachus
Posts: 4574
Joined: 2006-12-25 15:53
Been thanked: 2 times

#22 Post by Telemachus »

Stian1979 wrote:
Telemachus wrote: [*] Download the vanilla kernel sources, or the Debianized kernel sources to this directory, untar it and cd into the new directory. Do all of this as a regular user with no special privileges.
Where do I find the vanilla kernel?
Here: http://www.kernel.org/
"We have not been faced with the need to satisfy someone else's requirements, and for this freedom we are grateful."
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System

n6yga
Posts: 80
Joined: 2008-04-29 18:05
Location: El Monte, CA
Contact:

#23 Post by n6yga »

Olaf wrote:Can someone tell me whats going wrong?

After the compiling I get this lines at the end.

Code: Select all

make[1]: Leaving directory `/home/danne/new/linux-source-2.6.26'
/usr/bin/make    ARCH=i386 \
			     -C Documentation/lguest
make[1]: Entering directory `/home/danne/new/linux-source-2.6.26/Documentation/lguest'
cc -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include    lguest.c  -lz -o lguest
lguest.c:34:18: error: zlib.h: Filen eller katalogen finns inte
make[1]: *** [lguest] Fel 1
make[1]: Leaving directory `/home/danne/new/linux-source-2.6.26/Documentation/lguest'
make: *** [debian/stamp/build/kernel] Fel 2
Filen eller katalogen finns inte = The file or directory doesnt exist
Fel = Wrong
I just got the same thing. Anyone have an idea? Where the hell is zlib.h???

Kernel 2.6.28.8. Current stable from kernel.org.

Mark.

User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

#24 Post by Rolling Stone »

Just a shot in the dark, I seem to have the following packages installed that have something to do with zlib:
------------------------------------------------------------------------------
Image
------------------------------------------------------------------------------

EDIT: It's that zlib1g-dev package you want.
Last edited by Rolling Stone on 2010-10-02 09:59, edited 1 time in total.

n6yga
Posts: 80
Joined: 2008-04-29 18:05
Location: El Monte, CA
Contact:

#25 Post by n6yga »

Ok. That's the problem. I have a base system, no X, and just needed to install the zlib parts. All is well.


Mark.

User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

#26 Post by Rolling Stone »

Oh, good! :)

Do the instructions seem to be working besides that?

n6yga
Posts: 80
Joined: 2008-04-29 18:05
Location: El Monte, CA
Contact:

#27 Post by n6yga »

yes, they work perfectly.

You might want to add the part about zlib. And also, when you do 'make-kpkg kernel_image kernel_headers', you actually get two debs. One for the image, and one for the headers. You may want to change the dpkg instuction to dpkg -i *.deb so the headers are installed as well. You will need these to compile any other modules like nvidia, etc...


Good job though!!!

M.

User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

#28 Post by Rolling Stone »

Thanks, I made those modifications.

User avatar
lucho
Posts: 41
Joined: 2006-05-07 16:00
Location: Rio de Janeiro

#29 Post by lucho »

Ok, just wanted to post two things, one good and one bad.

The good is that I followed this howto (which is very similar to how I compiled kernels in the past) and everything went smoothly. Debian kernels are very sweet once you recompile them 8)

But there's bad news too. I've tried various times, but the catalyst driver simply will not install :evil: :evil: :evil: :evil: :evil: :evil: I tried the catalyst driver from ATI, and I tried the debian way with module asistant. Three times each, three failures each :x . Error messages varied, but never gave a reason, only "failed to build."
In case anybody is curious, here's the line I used:

Code: Select all

make-kpkg --rootcmd fakeroot --initrd --revision=rob.64 kernel_image kernel_headers --append-to-version=.rob64 
For the moment I'm using my "emergency mode" of radeon hd and fluxbox; radeonhd works on my videocard, but not well (the R670 chip).
Can anybody tell me what happened? Or, at least what I'm doing wrong?
Procrastination is like masturbation: you're only screwing yourself

User avatar
lucho
Posts: 41
Joined: 2006-05-07 16:00
Location: Rio de Janeiro

#30 Post by lucho »

Soooo, nobody is having a bad day- I'm the only unlucky one? Anyway, I've never been able to use a custom kernel with an ATI card. On Nvidia cards it was a piece of cake, but ATI... never :( :evil:

At least this failure was productive: I finally got an error message that gives information.

Code: Select all

  Building modules, stage 2.
  MODPOST 1 modules
FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol '__rcu_read_lock'
make[3]: *** [__modpost] Error 1
make[2]: *** [modules] Error 2
make[2]: Leaving directory `/home/lucho/kernel_compiling/linux-source-2.6.28'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/usr/src/modules/fglrx'
make: *** [kdist_image] Error 2
BUILD FAILED!
See /var/cache/modass/fglrx-source.buildlog.2.6.28.rob64.1238186910 for details.
Build failed. Press Return to continue...
Why should there be a GPL-only be present? Just to clarify: this happened using module assistant and the fglrx driver from the SID repository.
Procrastination is like masturbation: you're only screwing yourself

User avatar
Troels
Posts: 119
Joined: 2008-10-20 14:15
Location: Denmark, Scandinavia

#31 Post by Troels »

This is a very good howto.

Just to help, you have a typo:
Make a directory to avoid having to compile as root
Code:
mkdir ~/kernel_compiling/


Copy the source to that folder
Code:
cp /usr/src/linux-source-2.6.26.tar.bz2 ~/kernel_compiling/


Goto the directory
Code:
cd ~/kernel_compilling/
;)

Guess it should be compiling
Which mindset is right? Mine, of course. People who disagree with me are by definition crazy. (Until I change my mind, when they can suddenly become upstanding citizens. I'm flexible, and not black-and-white.) - Linus Torvalds.

User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

#32 Post by Rolling Stone »

Thanks! Typo fixed.

I never expected anybody to read anything I write that carefully! ;)

bibimidi
Posts: 5
Joined: 2009-04-15 04:14

Kernel panic (new compile)

#33 Post by bibimidi »

Hello,

This is a nice current howto of kernel compile. I posted my kernel compile problem in this thread:
http://forums.debian.net/viewtopic.php?p=224464#224464

I hope you guys can lend a helping hand. I like to know if my problem is fixable or no. Otherwise i can start anew the same exercise. Thanks.

bibs

User avatar
dbbolton
Posts: 2129
Joined: 2007-06-20 08:17
Location: Iapetus

Re: Kernel compile and install on Debian 5.0 for newbies

#34 Post by dbbolton »

I followed this guide but my kernel panicked. I described the problem here: http://forums.debian.net/viewtopic.php?f=5&t=40081

Edit: I guess there is a bug concerning initramfs-tools and newer kernels (thanks to garrincha for pointing this out) - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523735
GitHub | zsh docs in Letter PDF
Telemachus wrote:Put down the CGI.

Stian1979
Posts: 316
Joined: 2007-07-29 14:57

Re: Kernel compile and install on Debian 5.0 for newbies

#35 Post by Stian1979 »

I just realized that my amd64 don't regulate the frequency on a standard kernel, but it dos on a custom kernel where I change prosesor type and build in the various governors.
Building a kernel from source is deficiently worth the effort if you run a laptop and want a longer battery life.

I have noticed that using the 2.6.30 liquorix kernel make it necessary to change grub and fstab to read /dev/sda instead of /dev/hda if I use the debian 2.6.30.
Why is the debian kernel still using hda? I think the vanilla kernel changed into using sda a year or two ago.

Is there any issues?
Image
Debian Bullseye

Post Reply