LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 07-06-2005, 09:49 AM   #1
dvm
Member
 
Registered: Sep 2004
Posts: 62

Rep: Reputation: 16
compiling a custom kernel in 9.3


Hi,
yesterday I tried to compile a custom kernel for my 9.3 machine. I have an Athlon XP 1700+ on a ASUS A7M266 motherboard (which was out before the athlon xp was out).
I tried to create a custom kernel. I copied the existing installed kernel sources to another directory linux-2.6...-amd and did a make xconfig; make; make modules_install. I got some error messages about the modules which I ignored (guess I shouldn't have).
Then I tried booting into the new kernel but failed because it couldn't load any modules. The ones that got loaded where for 586 and I wanted K7 or vice versa. The problem now is that if I try to boot into the old kernel, he as well can't load the modules as he's asking for 586 and he's getting K7. (Though fortunately, I can log into a working system, with no mouse). Is there a suse 9.3 kernel how-to? I'd like to do it because even though 9.3 is a great OS it's too damn slow (takes 2.30 minutes to load on my system)
 
Old 07-06-2005, 10:37 AM   #2
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
If you get error messages during kernel compilation, you should not proceed. Warnings are OK, but errors not!

I think in the SUSE admin manual is a good howto for kernel compilation, however I am not sure.
 
Old 07-06-2005, 06:31 PM   #3
dvm
Member
 
Registered: Sep 2004
Posts: 62

Original Poster
Rep: Reputation: 16
Ok, I've managed to recover the system. I made a make mrproper; make clean; make cloneconfig; make; make modules_install
Fortunately the old kernel was there. Only the modules where damaged.
So I've read that if I want to compile another kernel I should change the EXTRAVERSION or the NAME in the Makefile? This should guarantee that I get unique modules.
If I do this and compile another kernel could I have a system with two kernels?
Is there a resource that describes what modules are, where they are installed etc?
 
Old 07-07-2005, 03:49 AM   #4
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
Quote:
If I do this and compile another kernel could I have a system with two kernels?
Sure! Copy the new kernel to /boot and name it with the version (e.g. vmlinuz-2.6.11.12-test), then add a new entry to your bootloader config that points to this kernel. Don't forget to make an initrd, if you would like a bootsplash or need drivers at boottime that are compiled as modules.

Quote:
Is there a resource that describes what modules are, where they are installed etc?
Have a look in the documentation of your kernel sources (/usr/src/linux/Documentation). The compiled modules are always installed in /lib/modules/Žuname -rŽ/kernel
 
Old 07-07-2005, 07:46 AM   #5
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
Quote:
Sure! Copy the new kernel to /boot and name it with the version (e.g. vmlinuz-2.6.11.12-test), then add a new entry to your bootloader config that points to this kernel. Don't forget to make an initrd, if you would like a bootsplash or need drivers at boottime that are compiled as modules.
Simply at the end of compilation enter:
#make install
so the correct command sequence would be:
#make bzImage && make modules && make modules_install
# make install

The above command will
1. copy kernel and System.map to /boot and will automatically rename it as per Makefile (EXTRAVERSION =) or .config (CONFIG_LOCALVERSION=)
2. create initrd and give it correct name corresponding to your kernel name
3. enter apropriate entry to GRUB (LILO?)
4. create correct symlinks (this actually should be changed back to the original and working kernel in /boot and entry in GRUB)

In other words one command will do all

About modules: check your hardware
copy default config file (located in /boot) to /usr/src/your_kernel_name/.config and use as an template. Remove all modules/devices you don't have. This way you don't have to worry what should be compiled as module and what should stay in the kernel.

Last edited by broch; 07-07-2005 at 07:48 AM.
 
Old 07-07-2005, 07:50 AM   #6
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
Quote:
In other words one command will do all
Yes, and it will overwrite your old kernel if you did a mistake with the version
No offense, but I prefer to do the installation myself (good old cp).

EDIT: BTW, since we already simplify: 'make bzImage' and 'make modules' can be combined in 'make'

Last edited by abisko00; 07-07-2005 at 07:52 AM.
 
Old 07-07-2005, 08:14 AM   #7
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
probably you just skept editing either Makefile or .config
And probably you have never really looked at /lib/modules
Changing kernel name afterward (post compilation) makes not that much sense. You will still have same entry in the /lib/modules

With your "way" switching between kernels AND nvidia is impossible: you will get an error (when going back to the old kernel and trying to reinstall nvidia) that kernel sources are not available or you are trying to install drivers onto wrong kernel

There is a pourpose for .config and Makefile
 
Old 07-07-2005, 08:35 AM   #8
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
Quote:
probably you just skept editing either Makefile or .config
And probably you have never really looked at /lib/modules
Changing kernel name afterward (post compilation) makes not that much sense. You will still have same entry in the /lib/modules
Not sure what you are talking about. Never talked about renaming the kernel after compilation. I only don't 'trust' the 'make install' command and prefer to do the installation of the kernel binary myself. It does not require many steps (copy byImage and System.map, run mkinitrd and edit menu.lst) and I know what happens. About one thing you are perfectly right: If I did a mistake with the kernel version, 'make modules_install' will already kill my system, so this was a bad argument for the manual way. It's just the way I prefer to do it.
 
Old 07-07-2005, 04:32 PM   #9
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
that is fine, but don't say that there is a problem with "make install" command unless you can prove it.
Make install is easier, and faster, whatever you do is up to you. Your post sounded rather that you (expert) must have the last word.

Quote:
Not sure what you are talking about.
comment about /lib/modules was a result of this:
Quote:
Yes, and it will overwrite your old kernel if you did a mistake with the version
That can only happen if you did not change kernel name in Makefile or .config
If you do not change kernel name in the above file(s) and you are using SuSE default settings, then yes new kernel with the same name as the old one will overwrite old kernel and also will overwrite the entry in the /lib/modules. The consequences for installing modules are in this scenario pretty obvious (I hope).
If you do not change kernel name in the above files but at the end simply copy bzImage to new kernel name, it is still wrong because modules will be copied to the old /lib/modules entry. Now if you would like to go back to the old kernel and install nvidia modules again, then you will be not able to reinstall nvidia because driver setup will be "confused": old folder corresponding to the new kernel. I hope that this is clear now.

Anyway
#make install
command is safe. Saying otherwise means that you have no idea how it works.
 
Old 07-07-2005, 07:29 PM   #10
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
Quote:
Originally posted by broch
that is fine, but don't say that there is a problem with "make install" command unless you can prove it.
Make install is easier, and faster, whatever you do is up to you. Your post sounded rather that you (expert) must have the last word.
Thanks for calling me an expert! I regard this as a compliment and cordially invite you to have the last word...

You are welcome!

Last edited by abisko00; 07-10-2005 at 09:03 AM.
 
Old 07-10-2005, 06:52 AM   #11
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Rep: Reputation: 15
Thank you all for your replies, you are an inspiration to me. -

I'm just a newbie trying to learn to use linux and am currently in transition(leaving windoze).

Compiling a custom kernel is in my future projects but for now I'm just learning the basics like installing/unstalling apps, monitoring, configuring, updating system, etc.

Even though I got lost in the middle of the posts it was still useful because it pushed me to learn more and stay interested in Linux.
 
Old 07-10-2005, 07:49 AM   #12
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
Quote:
Even though I got lost in the middle of the posts it was still useful because it pushed me to learn more and stay interested in Linux.
My apologies! This discussion was not very helpful. If you have questions on kernel compilation, we will try to help!

Last edited by abisko00; 07-10-2005 at 07:50 AM.
 
Old 07-10-2005, 07:57 AM   #13
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
Yes, I agree you have no idea what are you talking about. Your posts about danger of "make install" are pretty useless.
 
  


Reply



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
trouble compiling modules against custom fedora core 4 kernel blahJake Linux - Software 6 12-16-2006 06:54 AM
Compiling custom Kernel from install cd turtlespit Slackware - Installation 27 10-09-2006 09:48 PM
Problem Compiling Custom Kernel E Pierce Debian 9 08-09-2005 04:48 AM
compiling iptables into custom kernel straxus Linux - Newbie 1 03-26-2005 10:32 PM
Errors compiling custom kernel tron_thomas Linux - General 4 09-03-2004 11:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 08:08 AM.

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