Kernel build- WTF am I doing wrong

Probably missed something completely stupid here >:(
All I’m trying to do is build a customised copy of the current mainline kernel, nothing particularly interesting. I haven’t applied any patchsets, just done a complete slim of the config.
Trouble is, it’s building with everything in the default options. I’ve built plenty of kernels before, but never seen this one.
This is what I’ve done:

  1. Download current mainline source & extract to the /usr/src directory.
  2. Cloned config from the current kernel.
  3. Used menuconfig to slim things down considerably.
  4. Finally, I ran make rpm

This should have produced a nicely slimmed down kernel package. I’m not particularly bothered whether it actually boots at this stage or not, just that it’s built with the selected options. Trouble is, this produced a 156mb package with everything in the default options still there :frowning:

Is there a compaibility issue with the OpenSUSE default settings & the current mainline build, or have I done something monumentally stupid?

Cheers :slight_smile:

If you would like to compile your own kernel by downloading the version your want to use from The Linux Kernel Archives, here is what your do.

  1. To be able to compile a kernel for instance, I normally open up YaST / Software / Software Management and select the view button on the top left and select Patterns. Then, on the left column, I select Base Development, C++ Development and Kernel Development and allow these Packages to be installed and then see if you can do what you want.

  2. I use the bash script file called sakc in message # 17 you can get here:

S.A.K.C. - SUSE Automated Kernel Compiler - Version 2.00

I also have a script file called klist to automate and handle multiple kernel version is the same thread at message #22 so check it out.

So step one is to get the kernel development and support packages through YaST. Step two is to obtain the sakc bash script file to compile them for you. Optional step three might be to get the klist bash script file. By default we assume that sckc is in ~/bin, you download your kernel source files to ~/Downloads and if you use klist, you compile your kernels into the folder called ~/Kernel that you must create. In each case the ~ = /home/username.

Follow these simple instructions and you can compile any kernel into almost any openSUSE version presently supported. Anytime you load a new kernel and if you use the nVidia or AMD video drivers, loaded outside of YaST, they must be reloaded. Any kernels that you compile yourself will be added to your grub menu.lst file, but if you decide to remove them, you must do so manually as they will not show up in Software Management, which is OK. Finally, any kernels installed by YaST will still be there and will not be removed by doing your own kernel compile. Basically, YaST is simply unaware of what you are doing. This permits a backup kernel should you need it.

Thank You,

I’m well aware of how to compile a kernel. Having said that, I’m seeing exactly the same issue with your script and a clean config file :expressionless:

kernel 2.6.38-rc3 straight from mainline.

Something odd is going on…

leezer3 I’m well aware of how to compile a kernel. Having said that, I’m seeing exactly the same issue with your script and a clean config file :expressionless:

kernel 2.6.38-rc3 straight from mainline.

Something odd is going on…
When you said that you: 4. Finally, I ran make rpm, I guess I don’t use that command at all. Not sure what that would do. When you run your compile commands manually, can you copy and paste the terminal command and responces here? You can cut out anything text wise that is real long. Also, how are you determining that your options are not being used? What options are you setting that do not work? Why are you messing with a bunch of kernel options? What are you trying to do? You can surely compile your kernel in any way you want, but when it does not work, we need to know what you are trying to do so we can help.

Thank You,

Everything looks just like a normal kernel compile really :slight_smile:
Command sequence:
make clean
make menuconfig
Twilddle in menconfig and save, I’ve also tried xconfig. Copying the new config file elsewhere confirms the options have been set
make rpm

Will get you some command responses after work if you want them.

What I’m basically trying to do is build a stripped down server kernel with CPU specific optimisations for Athlon64 & generic x86 disabled. In doing this, I’ve ripped out all modules & drivers except those in use, the sound subsystem and a few other bits.
I can see my options aren’t being used because:

  1. Watching the compile still shows everything being built, disabled modules etc.
  2. It’s producing exactly the same 156mb RPM. (I’ve tried clearing the caches and temp)
  3. Installing this RPM and a quick bit of bashing shows it’s still been built with the generic i386 CPU target & that all the modules are still present.

Cheers :slight_smile:

leezer3 wrote:
> I’m well aware of how to compile a kernel. Having said that, I’m seeing
> exactly the same issue with your script and a clean config file :expressionless:
>
> kernel 2.6.38-rc3 straight from mainline.
>
> Something odd is going on…

Have you tried asking your question on the opensuse-kernel mailing list?
I think someone there might know the answer.

Here are the steps that I use in SAKC to compile a kernel.


1. tar -vxjf kernel_version.tar.bz2
2. cd kernel_version
3. make mrproper
4. zcat /proc/config.gz >.config 
5. make oldconfig
6. make menuconfig (optional)
7. make
8. sudo make modules_install install

I do not run the command make rpm.

Thank You,

Will try it the completely manual way in a minute turfing all scripting out of the window, although I can’t see why it’d make any difference unless there’s a bug in the RPM script or the kernel source itself somewhere.
Building as an RPM just makes it a little easier to remove later on :slight_smile:

I’m also going to try 2.6.37 stable, and see if it’s a mainline bug specifically.

Problem located, stupidity strikes again, although it’s not all me…
I was saving the customised config as config2 with menuconfig first to make sure it was backed up. I then exited and saved, and this was writing to the config2 file, not the appropriate .config

Problem located, stupidity strikes again, although it’s not all me…
I was saving the customised config as config2 with menuconfig first to make sure it was backed up. I then exited and saved, and this was writing to the config2 file, not the appropriate .config
Well I am happy to hear you found your problem. I do wonder why you had a problem with my script file as it does not default to the config name you said you used manually.

Thank You,

jdmcdaniel3, your script is very good. It takes the pain out of compiling a Kernel for users who are new to building a kernel and who do not need to optimize the kernel, but who rather are happy to use generic openSUSE settings with a more recent kernel.

IMHO its very well done, and many thanks.

Here is a print from running this on my rather ancient sandbox PC (athlon-1100 w/1GB RAM):
http://thumbnails13.imagebam.com/11812/add844118119006.jpg](http://www.imagebam.com/image/add844118119006)
[click on image for larger view]

                         jdmcdaniel3, your script is very good.  It takes the pain out of  compiling a Kernel for users who are new to building a kernel and who do  not need to optimize the kernel, but who rather are happy to use  generic openSUSE settings with a more recent kernel.  

IMHO its very well done, and many thanks.

Here is a print from running this on my rather ancient sandbox PC (athlon-1100 w/1GB RAM):
http://thumbnails13.imagebam.com/11812/add844118119006.jpg](http://www.imagebam.com/image/add844118119006)
[click on image for larger view]
You are very welcome there oldcpu. The script does just use the tried and true method for the kernel compile/install, but hopefully it makes it easier, particularly for anyone that does not do this task everyday and for all new users. I must admit I have not seen a computer taking six hours, but the way it works, you should be able to leave it without fear. The only critical time is on the last step when it is installed for you. As always, I look for suggestions for the script. By the way, you are given a chance to make modifications to your kernel setup, if you know what you are doing. As far as I can tell, all options are present when you use the “make menuconfig” command, which is optional selection in SAKC main menu. That just means you are asked if you want to do this for every compile. Also, the saving of all make command outputs as a log file can be useful information and the timing of the compile process (how long it took) can tell you if you have sped up anything.

Thank You,

That was run on my wife’s old 32-bit athlon-1100 PC which is now into its 10 th year (and she gave this PC to me around 5 years ago so its really my PC now). Its NOT a young PC :slight_smile: and I do most my testing on this.

I think you mean this step:
http://thumbnails27.imagebam.com/11812/e0a149118118920.jpg](http://www.imagebam.com/image/e0a149118118920)
[click on image for larger view]

… and I do not normally build my own kernel (rather I will grab an rpm of one that was built by someone else) hence I selected “NO” as I did not want to modify the kernel configuration in a GUI. I know from experience if one does not know what they are doing there, that an inappropriate kernel build selection can really mess things up. :open_mouth:

I vaguely remember seeing this, but I see now I forgot to make a screen dump of it … and I’m kicking myself as I tried to capture all the script questions when it ran :slight_smile:

Still, its a very well done script, and IMHO users who are average openSUSE Linux users should have no problems using your script for a painless kernel build, as long as they remember to do the prequisites (install the required patterns from YaST Software Management) and as long as they know a bit about what is needed to carefully reboot after a kernel update (ie rebuild proprietary drivers, check the /boot/grub/menu.lst file … etc … )

On the SAKC kernel configurations, it is using the command “make menuconfig”. I have went into it and turned on floppy drive support for instance and I played with the cgroup_enable business, but that never seemed to produce any added speed I could tell. As for speed, doing a kernel compile on every computer seemed to show who was faster and who was not. My old work Dell laptop and its Intel Core 2 Duo P8400@2.26 GHz takes 48 minutes to compile a kernel and my newest Intel i7 2600K Quad Core @ 3.4 GHz takes 8-9 minutes. I have no emulators running at present for testing.

The need to install the development packages is mentioned a couple of times in the thread, but as the script got larger, I had to limit what was said in the actual script posting. I was trying to keep the script in the post as opposed to placing it in SUSE Paste. I did add a partner script I called KLIST which will list off the kernels you have for selection (without needing to enter the full name) and does a little folder stuff like changing to a default folder to do your compiles. I have toyed with added the KLIST function to SAKC. If anyone thought SAKC was worthy of posting it in the HOWTO section like mmcheck, I could do a lot more to the script to make it better if it needed it.

It is kind of funny I would end up writing a kernel compiler script considering what I knew about such things just six months ago, but I found the scripting part fun to do and very similar to old basic and DOS batch files, something I used to do a lot with many moons ago. Further, the informations to deal with kernel compiles has been documented pretty well in the threads here and supplemented with many fine suggestions by our openSUSE users in the forum that helped make it much better.

Without regard to anything else, my aim was to allow the easy compilation of a new kernel into any present version of openSUSE. It has been tested with 11.2, 11.3 and now 11.4. The reasons for this came about when I found I was unable to mount a USB 3 hard drive from my fstab file in openSUSE 11.3 due to a regression in kernel 2.6.34, even as USB 3 was “supported” in this kernel version. It is my hope that for instance if a problem should come up with kernel 2.6.37 in openSUSE 11.4, one could simply compile a newer version and eliminate the problem just as I was able to do with openSUSE 11.3. It would also seem I made a few comments about that issue with kernel 2.6.34 and USB 3 support which has not endured me to at least one of our kernel experts here in the forum. I have since decided it is best to keep such complaints to myself as they really do not help in our overall cause in the openSUSE forum.

Thank You,