PDA

View Full Version : Kernel compile 2.6.6 - only once?



davros4269
07-12-2004, 04:50 AM
I have a strange issue - I installed the most recent knoppix today, choosing the knoppix-install-from-web-newest script (or something similar). I chose the Debian way. Knoppix was booted in knoppix26 mode.

It booted fine, but this is a Toshiba Laptop and it seems that kernel support for the fan utilityis missing in the kernel :(

I did apt-get update;apt-get install kernel-2.6.6
I then went through the process of compiling the kernel, it worked fine, i started from scratch, not using the config file for 2.6.6 in /boot. It wouldn't boot my kernel, the screen went black when it tried. So I rebooted into default 2.6.6 and tried again, but got this error during make xconfig:

make xconfig
CLEAN .config
HOSTCC scripts/basic/fixdep
In file included from /usr/include/sys/socket.h:35,
from /usr/include/netinet/in.h:24,
from scripts/basic/fixdep.c:107:
/usr/include/bits/socket.h:305:24: asm/socket.h: No such file or directory
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

make menuconfig does the same. I finally ended up reinstalling knoppix from the cd and trying again, but I am not able to get past this point - I must be losing my mind? ;)

Even from a completely fresh start, I cannot get the kernel to compile - any ideas? Google gave a few suggestions, I updated binutils and some other packages - same deal.

I can't fathom why it would work once, but not again? Is the install script forgiving of errors? Maybe something didn't install right?

Markus
07-12-2004, 09:16 AM
It booted fine, but this is a Toshiba Laptop and it seems that kernel support for the fan utilityis missing in the kernel
You can check it with: grep -i toshiba /boot/config-2.6.x....... (check the filename)

I did apt-get update;apt-get install kernel-2.6.6
I then went through the process of compiling the kernel, it worked fine, i started from scratch, not using the config file for 2.6.6 in /boot. It wouldn't boot my kernel, the screen went black when it tried.
Did you get the full kernel source and do first: rm /usr/src/linux, then link the new source with: ln -s /usr/src/kernel-source2.6.xxx /usr/src/linux?
It's also a bit easier to start with:

cp /boot/config-2.6.6-xxx /usr/src/linux/.config
cd /usr/src/linux
make oldconfig

/usr/include/bits/socket.h:305:24: asm/socket.h: No such file or directory

cd /usr/src/linux/include
ln -s asm-i386 asm

davros4269
07-12-2004, 04:20 PM
Thanks, I'll give your tips a try. I wasn't aware of "make oldconfig". I did delete and make the "linux" soft link. I also copied the config file in the second time, having read that the new make xconfig loads it automatically if it detects it.

I'm still boggled why I was able to compile it the first time?? My only guess is that the install script must have worked a bit differently the second time through...

Markus
07-12-2004, 04:29 PM
the new make xconfig loads it automatically if it detects it.
Wouldn't know as I've always used menuconfig.


I'm still boggled why I was able to compile it the first time?? My only guess is that the install script must have worked a bit differently the second time through...
Ah, not a clue on this one either, sorry.

davros4269
07-12-2004, 05:41 PM
Thanks for the fast response. I tried those and got the same error.
"make oldconfig" also gave those errors. I can only assume it's a botched install - perhaps I'll try using the install script that comes on the disk instead of the "new-web..." version.

I've never had any problem before - if you can think of anything else, I'd appreciate it, if not, thanks for your time.

I hope in the next knoppix update, they include Toshiba Utilities support in the kernel - these laptops run extremely hot otherwise.

Markus
07-12-2004, 06:10 PM
You could always start afresh with a compile. Here's some links for the debian way:
http://www.desktop-linux.net/debkernel.htm
http://newbiedoc.sourceforge.net/tutorials/kernel-pkg/index-kernel-pkg.html

Basically it boils down to:
- apt-cache search kernel-headers-2.6 (pick your flavor)
- apt-cache search kernel-source-2.6
- apt-get install kernel-source-2.6.x kernel-headers-2.6.x (it might install default headers as well)
- cd /usr/src
- rm linux
- tar xvjf kernel-source-version.tar.bz2
- ln -s /usr/src/kernel-source-2.6.x /usr/src/linux
- cp /boot/config-2.6.x-16.04.04 /usr/src/linux/.config (check the /boot/config_filename)
- make oldconfig (to read in the Knoppix config, you can also start with defconfig to get a default conf)
- make menuconfig
- make-kpkg clean
- fakeroot make-kpkg --append-to-version=.120704 kernel_image (use any date)
If you use third party modules it would be:
- fakeroot make-kpkg --append-to-version=.120704 kernel_image modules_image
- cd..
- dpkg -i kernel-image-your_version_name.deb possible_modules_package_you_built.deb
- lilo -v (to make sure it updated)

davros4269
07-14-2004, 07:25 PM
Thanks for the info.

If I do exactly that, I get the same error. That's what I've always done, btw, up to the Debian package part (the last time I tried the Debian way, it was unable to work with lilo.conf and I found it less confusing to do it myself instead of answering the post-isntall script's questions). Well, that and I used xconfig instead of menuconfig, but both produce the same error.

I've reinstalled knoppix again, this time with the install script included on the cd instead of the new-web-version script.

What gets me is that I was able to do it the first time - but not since...it makes no sense to me, except that maybe that my cd went bad and the install script is forgiving of errors...

I even swapped cd-rom drives and reinstalled!

Btw, I thought that the kernel headers were only needed if you grabbed a binary kernel, in case some app wants to compile and use them? I thought compiling made your own kernel headers - in any case, I tried it both ways, same error.

Markus
07-14-2004, 08:15 PM
I'm mystified while it works for me, but then again I'm using kanotix instead of knoppix. Kanotix is a bit stabler for a hd install and kano even has scripts for kernels although I haven't used them in a while.
You could of course boot the cd with the cheatcode testcd to see if it's ok.
And why not grab the source from kernel.org.

mzilikazi
07-14-2004, 11:41 PM
Problems I see with installing Knoppix to hdd.

No knoppix kernel source easily available and missing too many devel pkgs to compile one anyway.

dist-upgrade immediately hoses the install.

Knoppix is a fantastic LIVE CD but it was never meant to be installed to hdd. Don't believe me? Ask Klaus. ;)

davros4269
07-15-2004, 12:04 AM
Markus: Thanks again - still no luck. testcd passed ok. Completely clueless at this point.

mzilikazi: Maybe it was never meant for this, but it works great in every other respect in my experience, and of course, there are 2 install scripts included on the disk ;) I'm writing this on another machine with a 3.2 install.

I've never had any issue compiling it before. According to the how-to's out there, it has everything that's required for the compile, version-wise as well. I've never used "dist-upgrade", never had a reason; I always upgrade app-by-app.

mzilikazi
07-15-2004, 12:29 AM
Markus: Thanks again - still no luck. testcd passed ok. Completely clueless at this point.

mzilikazi: Maybe it was never meant for this, but it works great in every other respect in my experience, and of course, there are 2 install scripts included on the disk ;) I'm writing this on another machine with a 3.2 install.

I too have installed Knoppix and it worked fine but that is not the point here. The point is that you and alot of other people cannot do something as simple as build a new kernel. That's more than enough of a problem for me to know that Knoppix was not meant to be installed. The fact that there are install scripts means nothing.


I've never had any issue compiling it before. According to the how-to's out there, it has everything that's required for the compile, version-wise as well. I've never used "dist-upgrade", never had a reason; I always upgrade app-by-app.

Well a Debian install has no problems w/ dist-upgrade ;) and yes that does include Kanotix. Why not just give it a try and you'll see what I mean.

davros4269
07-15-2004, 02:42 AM
I too have installed Knoppix and it worked fine but that is not the point here. The point is that you and alot of other people cannot do something as simple as build a new kernel. That's more than enough of a problem for me to know that Knoppix was not meant to be installed. The fact that there are install scripts means nothing.

Lol, is that an insult? I'm not one of those guys that has used linux since the 386 days, but I have been using it since Red Hat 5.2 - it's been my primary platform every since. I'm not what you'd call a newbie ;)

I've compiled many a' kernel, and have made plenty of custom Knoppix disks. Knoppix is currently my preferred distro.

In this case, it's either some weird fluke, or I'm losing my mind. I start with pre-partitioned hard drive (in other words, I don't use the script for this), swap as the first partition (for speed), hda2 as the knoppix partition. I run the script, choose hda2, choose Debian style, no boot disk and away it goes.

Once done, I reboot, log in as myself, open a shell, update the sources, apt-get install kernel-2.6.6, remove the linux symlink, untar, edit the Makefile to give it the kernel a unique name, make the new symlink, make mrproper, and then make xxxconfig and it FAILS!

These are precisely the steps that I do and in that order. It's either something really odd, or really stupid - it's not a "noob" issue. This is my first attempt at compiling 2.6.6, so I guess in that sense, it's "new"...

As for Katonix, I'll look into it.

mzilikazi
07-15-2004, 03:07 AM
Lol, is that an insult? I'm not one of those guys that has used linux since the 386 days, but I have been using it since Red Hat 5.2 - it's been my primary platform every since. I'm not what you'd call a newbie ;)

Not at all an insult. My point is that it should NOT be so difficult to build a new kernel but it is apparently very difficult on Knoppix. It has nothing to do with your level of noobishness (if that makes any sense).

davros4269
07-15-2004, 05:34 AM
Katonix looks interesting, I see you sell it ;)

I'll download it tomorrow and give it a try.

Well, it always HAS been THAT easy in Knoppix and like I said, I was able to do it once with 3.4 - I cannot explain what went wrong. It makes no sense to work only once...

Maybe I'll even get lucky, and find kernel support for the Toshiba utilities built in...

shah
07-23-2004, 08:49 AM
My advice will be....
never use kernel source from apt.
Get the source from kernel.org.