SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)
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?
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
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.
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
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.
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.
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...
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.