VectorLinux

The nuts and bolts => Kernel => Topic started by: gijii on June 19, 2007, 01:48:30 pm

Title: Problem compiling a new kernel
Post by: gijii on June 19, 2007, 01:48:30 pm
Hi all,

I am trying to compile a new custom kernel on my SOHO 5.8. I am using the vanilla sources 2.6.21.5.
I just want to tailor it on my machine and get rid of unneeded stuff.
I used as a configuration file the .config in the source folder of the standard kernel provided with Soho 5.8.
As a test I changed just the processor type and I compiled using make, make modules_install and copying the bzImage and system.map files in the /boot directory.
Then lilo -t and lilo -v after modifying the /etc/lilo.conf.
I have always used this procedure on Slackware without any problems. On my Soho 5.8 the kernel does not boot.
It appears the message "unconmpressing linux" and then, in the lower part of the screen two lines of numbers I do not understand (not similar to any message from the system) appear.
Does Vectorlinux have some setting or tuning that needs a different procedure to compile a kernel from vanilla sources?

Thanks for any suggestion.

gijii
Title: Re: Problem compiling a new kernel
Post by: newt on June 19, 2007, 09:09:43 pm
The problem itself seems like something that may be more related to lilo, but the timing (i.e. after you've selected which system to boot) is a bit odd. ???
Title: Re: Problem compiling a new kernel
Post by: incognu on June 19, 2007, 10:17:16 pm
I don't know of anything extra you need to do ... I've been compiling kernels using the source from the kernel.org and patches from Kolivas, doing it about the same way: copying over my last config, doing make oldconfig, make menuconfig, make bzImage, etc ...

Is it possible that the old config had some things relative to vl kernel patches (aufs, squashfs and lzma) that resulted in borkage when compiling a kernel without those patches?   ???

Just took a peek in the kernel build file for the VL 2.6.21.1 kernel ... saw that squashfs is built outside the kernel, and the script removes it from .config before configuring

There was a how-to on compiling kernels here, but I think it's one of the topics which disappeared.
Title: Re: Problem compiling a new kernel
Post by: gijii on June 20, 2007, 12:35:26 am
Thanks for your replies.
I was checking this morning and I came to the same conclusion: may be the patches can broke the kernel compilation?
I looked over the forum and I did not find any how to for kernel compiling for Vectorlinux.
I was willing to do the same: get rid of unnecessary modules, a little tuning of the kernel for my hardware and to apply the Con Kolivas patch. But I would want to keep all the patches already in the standard kernel.
Title: Re: Problem compiling a new kernel
Post by: incognu on June 20, 2007, 04:20:00 am
Yeah ... I think at one time I had some problems possibly related to that, but my memory is really vague about it.  It could be that the .config is setting up the kernel to use some of the vl patches at boottime, hence the panic in a kernel compiled without them.  (I'm just guessing at this. ??? )

You might want to download the vl kernel source (http://vectorlinux.osuosl.org/veclinux-5.8/kernels/) and hack the buildscript to apply Con Kolivas' patches too ... you'll have to hack it to let you do some extra configuration, too.

Title: Re: Problem compiling a new kernel
Post by: gijii on June 20, 2007, 07:18:33 am
Ok, let's face this the hard way.
Since I do want to compile the latest kernel 2.6.21.5 is there a how to explaining what patches I have to apply to a vanilla kernel to have a vectorlinux kernel (bootsplash, squashfs, lzma, and realtime?). Where do I find these patches? I guess these patches can be applied in the usual way to patch a kernel.
Then I would apply also the Con Kolivas patch.

Thanks for any suggestion
Title: Re: Problem compiling a new kernel
Post by: The Headacher on June 20, 2007, 09:47:08 am
is there a how to explaining what patches I have to apply to a vanilla kernel to have a vectorlinux kernel (bootsplash, squashfs, lzma, and realtime?).
There used to be one, but it's been lost when the forum was "cleaned up".

Quote
Where do I find these patches? I guess these patches can be applied in the usual way to patch a kernel.
Then I would apply also the Con Kolivas patch.

Thanks for any suggestion

I think all the patches are in /usr/src/linux if you have the kernelsources for 5.8 SOHO installed  (lzma doesn't need a kernel patch AFAIK) :

bootsplash-3.1.6-2.6.15-jtm.diff
rt-lsm-0.8.7-kernel.patch
ksize.patch
lhash.patch
squashfs3.2-patch

I think patching is done normally (I always do it the wrong way the first 2 times and my kernel is already patched, so I won't advice how to do it :D).

If I had to guess I'd say the problem you encountered first had to do with missing bootsplash support.
Title: Re: Problem compiling a new kernel
Post by: uelsk8s on June 20, 2007, 11:00:07 am
You shouldnt have any problem compiling a vanilla kernel on VL.
If you have the default kernel sources for SOHO installed you should have a dir /usr/src/build-kernel-XX.X/ that has all the patches and a kernel build script inside it.

the last kernel I have built with this script was 2.6.21.3 you can find it here http://vectorlinux.osuosl.org/veclinux-current/packages/kernel/kernel-src-2.6.21.3-i586-1vl58.tlz
it was built with a newer GCC so you will have problems with Nvidia drivers if you used it as is on SOHO 5.8

HTH,
Uelsk8s
Title: Re: Problem compiling a new kernel
Post by: gijii on June 29, 2007, 03:10:32 am
Hi all

I made a step back and I was able to recompile the standard kernel.
As a test I just modified the processor type to fit it to my hardware.
Everything works.
I was not able to apply the Con Kolivas patch.
I got some exception.
Did anybody be able to apply this patch to the 2.6.20.3 kernel? I picked the patch for 2.6.20 kernel series, so I should have done everything ok.
I will try to post the output message of the patching procedure.

gijii
Title: Re: Problem compiling a new kernel
Post by: incognu on June 29, 2007, 04:18:21 am
I'd guess that the problems arose from applying the 2.6.20 ck patch to the 2.6.20.3 source, instead of the 2.6.20 source.  In my experience, sometimes there's enough change to cause parts of the patch not to take.  (If it's just the Makefile, you can check and make sure it's nothing more than the kernel extraversion.)

Post the output, just to make sure.

Title: Re: Problem compiling a new kernel
Post by: easuter on June 29, 2007, 09:34:34 am
I've nearly got all the kernel packages ready that are patched with Con Kolivas' patchset. Expect them in the repo by tomorrow at the latest.
Title: Re: Problem compiling a new kernel
Post by: gijii on July 06, 2007, 12:55:03 am
Good! What are the names of the packages?
A link would help ;)
Title: Re: Problem compiling a new kernel
Post by: exeterdad on July 06, 2007, 07:27:43 am
Good! What are the names of the packages?
A link would help ;)

And the sources too!  ;D  I want to produce a patched kernel that actually works this time!

Title: Re: Problem compiling a new kernel
Post by: easuter on July 07, 2007, 02:12:14 am
I'm uploading the packages today, with the source and build instructions ;)
Title: Re: Problem compiling a new kernel
Post by: exeterdad on July 07, 2007, 03:14:58 pm
Wish we had more smilies to choose from.....   Could use a thumbs up one or something!

Anyhow...  You rock!
Title: Re: Problem compiling a new kernel
Post by: gijii on July 09, 2007, 01:09:34 am
Where can these packages be downloaded from?
Title: Re: Problem compiling a new kernel
Post by: exeterdad on July 09, 2007, 10:22:17 am
He annouced it over at the " VL package news and Updates" section. http://www.vectorlinux.com/forum2/index.php?topic=3584.0

The sources are already patched and ready to go.  Although I'd love to see a build script, or a list of the commands used to build the bugger. 

Ahem!  LOL!

I imagine it's a matter of:

installing the two patches
configuring
make modules
make bzimage
make modules_install

I wanna know!!  LOL
Title: Re: Problem compiling a new kernel
Post by: easuter on July 11, 2007, 04:33:55 pm
He annouced it over at the " VL package news and Updates" section. http://www.vectorlinux.com/forum2/index.php?topic=3584.0

The sources are already patched and ready to go.  Although I'd love to see a build script, or a list of the commands used to build the bugger. 

Ahem!  LOL!

I imagine it's a matter of:

installing the two patches
configuring
make modules
make bzimage
make modules_install

I wanna know!!  LOL

Yeah, the configure info is in the README file. I don't think the kernel build process can be scripted as simply as other apps, what with needing to run one of the configure options (make oldconfig, make menuconfig, make gconfig or make xconfig) in order to make the new configurations "stick".
Title: Re: Problem compiling a new kernel
Post by: gijii on July 12, 2007, 07:09:39 am
Thanks a lot!
I downloaded and installed the new patched kernel without any problem.
It would be nice to have a how to about patching the kernel from vanilla to vectorlinux/con kolivas patched kernel.
Anyway, thanks again.
Title: Re: Problem compiling a new kernel
Post by: Freeman on July 12, 2007, 09:24:21 am
I have to agree on this, a HOW TO on upgrading the kernel (for newbies that is) would be nice...
Title: Re: Problem compiling a new kernel
Post by: The Headacher on July 12, 2007, 09:27:23 am
Yes, we really should encourage newbies to mess with their kernels and b0rk their systems.
Title: Re: Problem compiling a new kernel
Post by: apock627 on July 15, 2007, 06:01:13 am
As a relative newbie I respectfully disagree (sort of. I guess it depends on what you mean by newbie). There should be plenty of warnings about consequences, and yes there will be more posts (like mine) arising from silly mistakes. But
a. Sometimes there is no choice, even for relative newbies. There was no way I could have got my wireless working in 5.8 without being able to do it. I was originally forced into it in the 2.2 kernel days to get my winmodem working, and back then it took a lot of research to get the gospel truth on how to recompile. There's a lot of misinformation out there in other forums, of bigger distros especially. The TLDP stuff is admirable and thank heavens for the people who can be bothered to do it, but it is usually pretty out of date.

b. Being comfortable with recompiling is really not that hard, and requires surprisingly little other background knowledge if you follow some basic safeguards. I am proof. Sure I'm mucking around with things I don't really understand, but in the end I have always solved the problem and learnt something along the way. My whole experience with linux is mucking around with things I don't understand.

c. IMHO without being able to do it you miss out on two of the greatest strengths of linux, being able to adapt the kernel to your machine, and staying up to date, unlike Windows users (like me) who wait about 5 years each time and then have to pay again for the privilege. And it's a great way to learn about the system.

Admittedly I fiddle with things more than I should. And linux is just a hobby for me, so if I b0rk my linux system it's just another pleasantly futile task to get it working again, in my own time. There are plenty of others like me here I am sure.

I have only learnt to re-compile from kernel tarballs, and don't really understand how to do things from the Vector package, or what extras/Vector-specific things are available, (like, what is bootsplash) so I for one would welcome a Vector kernel howto. I'm not sure what I could do to help but could provide some newbie feedback and support for newer newbies than me.

Cheers
Title: Re: Problem compiling a new kernel
Post by: Triarius Fidelis on July 15, 2007, 01:07:08 pm
Yes, we really should encourage newbies to mess with their kernels and b0rk their systems.

It's useful because you learn a lot about Linux and computers in general when you do so.

Sometimes the labor is the reward...
Title: Re: Problem compiling a new kernel
Post by: incognu on July 15, 2007, 05:39:45 pm
Yes, we really should encourage newbies to mess with their kernels and b0rk their systems.

It's useful because you learn a lot about Linux and computers in general when you do so.

Sometimes the labor is the reward...

Yes.  Just a couple of thoughts from another relative noob ... I think the main caveat would be to not replace/delete the stock VL kernel; it works, and a custom compile may not.

While I think compiling your own kernel is definitely worth it if you want to, VL already has great performance with the standard kernels; with Easuter's latest ck-patched kernel package, it's bound to be even better.

But, for those who want to get their hands dirty, "rolling your own" is very rewarding, and worth the time spent configuring and researching. Sometimes it's the journey as much as the destination.

My VL 5.8 standard install has this: /usr/doc/VLHelpCenter/vlfaq/kernel2.6.x.htm (compiling from kernel.org sources, not with VL patches)
Title: Re: Problem compiling a new kernel
Post by: exeterdad on July 16, 2007, 05:20:52 am
I'm comfortable compiling my own kernel, but when compiling a kernel that is compatible with VL it's kind of a crap shoot as I don't know all the options that are required for VL to run properly.  Also some of the patches that add functuality  are a bit of a mystery for me as well.  To further add to my confusion.  I've studied the various kernel sources in the repo and find that no two are built alike.  In fact some don't even work with this box.

Installing the sources of a known working kernel and adjusting the configure for my processor or my limited hardware is a simple matter.  But I've had to use the badram patch not long ago.  The patch wouldn't work for this kernel.  So I thought I'd grab a vanilla kernel and apply all the VL patches and the badram patch as well.  I got it running finally, but with much confusion and a few terrifying boot ups.  lol

I do miss our missing forum posts.  There is a lot of info's that I know I saw before, but can't access when I need it.  This topic was covered very well in those missing posts.
Title: Re: Problem compiling a new kernel
Post by: rbistolfi on July 16, 2007, 06:05:15 am
Quote
I got it running finally, but with much confusion and a few terrifying boot ups.  lol

Good! How the badram patch is working?, no more segmentation faults? I used it once in a friend box, I have an old pentium I to fix and probably I will be using badram too.
Title: Re: Problem compiling a new kernel
Post by: exeterdad on July 16, 2007, 07:23:01 am
Quote
I got it running finally, but with much confusion and a few terrifying boot ups.  lol

Good! How the badram patch is working?, no more segmentation faults? I used it once in a friend box, I have an old pentium I to fix and probably I will be using badram too.

It worked like a charm!!  Figuring out the code to enter into lilo was overwhelming for me, Thankfully memtest86 has a handy feature that will figure it out and give you the exact lilo entry.

I meant to thank you my friend, but I got sidetracked.  Not unusual for me.  Your hint saved me a lot of money that I don't have.
Title: Re: Problem compiling a new kernel
Post by: rbistolfi on July 16, 2007, 10:03:45 am
No problem exeter, I am glad it works for you. That info will be useful. We could write a howto about this.
Title: Re: Problem compiling a new kernel
Post by: easuter on July 16, 2007, 10:58:04 am
Quote
I do miss our missing forum posts.  There is a lot of info's that I know I saw before, but can't access when I need it.  This topic was covered very well in those missing posts.

Hopefully that should be fixed soon (yeah, its been said a lot  ::))
But we've been working on fixing the corrupted database, and that has been accomplished, so it *shouldn't* be long now.
Title: Re: Problem compiling a new kernel
Post by: exeterdad on July 16, 2007, 12:23:46 pm
No problem exeter, I am glad it works for you. That info will be useful. We could write a howto about this.

It would be a bonus the VL kernel was already patched with the badram patch.  It just simply builds one extra module.  And doesn't affect the performance of the kernel if it's not invoked by the user.  Since many of us don't have a lot of money, or come from countries were computer parts are so expensive, I think it would be a asset to have the kernel badram ready.  After all, there is a reason why so many of us are running older hardware.

Quote
Hopefully that should be fixed soon (yeah, its been said a lot  Roll Eyes)
But we've been working on fixing the corrupted database, and that has been accomplished, so it *shouldn't* be long now.

This is great news easuter!  I've been fighting with myself not to post about it in the other thread.  I know people are on it, and they probably are up to their ears in other projects as well.  It's just a bummer when I know something has been covered and I need to reread that info.
Title: Re: Problem compiling a new kernel
Post by: incognu on July 16, 2007, 07:28:19 pm
Glad to hear progress is being made on the missing posts!

Re the ones about compiling a kernel, I saved some of the posts some time ago, but a quick look didn't reveal anything specific to some of the questions raised here. 

Just to point out again, VL 5.8 comes with some excellent documentation, located in /usr/doc/VLHelpCenter ... just point your browser to /usr/doc/VLHelpCenter/index.html and browse down to "Documentation / Help" -- which includes information on lots of stuff, not just kernel compiling.