View previous topic :: View next topic |
Author |
Message |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Wed May 23, 2007 7:56 am Post subject: Compile and use multiple kernels |
|
|
Hi there,
I've installed gentoo 2007.0 on my toshiba satellite 1800-400 laptop. I've used the genkernel option (described in the gentoo handbook) to compile my kernel. The system is up and running (needs some tweaking, ofcourse) and seems to work fine. Sound wasn't working, though, and I used the ASLA guide to get it up and running, which seems to work fine (although the device doesn't show up in the system>preferences>sounds menu in gnome).
The guide let me compile (see the ALSA guide) a new kernel which seems to have overwritten my previous kernel. That's okeh because it works. However, I was wondering how I can configure/compile another kernel (just to learn how to do this (read n00b)) and use it next to my current kernel. So I want to make another kernel, add it to grub so I can choose which kernel to use, so I can enhance my knowledge of kernel configuring and compiling.
Is this possible? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Wed May 23, 2007 12:51 pm Post subject: |
|
|
Thanks for that. I'll be sure to read it. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Thu May 24, 2007 8:13 am Post subject: |
|
|
I've read through the HOWTO and also this HOWTO on a different subject, but which deals with multiple kernels as well. Some questions remain, however.
What does the symbolic link do? The HOWTO's point out that it has to point to the kernel of my choice, but don't I choose the kernel of my choice in GRUB?
When running or Code: | genkernel --menuconfig | what is created? Is it a bzImage? If yes, how is it called and where is stored? I need to copy it to /boot to make it bootable?
The kernel in use is stored in /boot, right? Can I just rename it even though it is in use?
Quite some questions. I hope you're willing to answer. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Thu May 24, 2007 11:44 am Post subject: |
|
|
HydroDiOxide wrote: |
What does the symbolic link do?
|
The symbolic link is there for your Kernel, in fact, when you compile a kernel, you need to update this link /usr/src/linux, because with that you can compile a kernel the kernel that you want. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Thu May 24, 2007 11:47 am Post subject: |
|
|
HydroDiOxide wrote: |
The HOWTO's point out that it has to point to the kernel of my choice, but don't I choose the kernel of my choice in GRUB?
|
After you have compile you kernel that you have choose with /usr/src/linux and with the command make && make modules_install, the result of your kernel will be a bzImage that can be found here : /usr/src/linux/arch/i386/boot/bzImage
After that you need to create your bzImage and place it inside your /boot partition with that command :
cp arch/i386/boot/bzImage /boot/kernel-version
exemple :
cp arch/i386/boot/bzImage /boot/kernel-2.6.20-Gentoo-r8 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Thu May 24, 2007 11:50 am Post subject: |
|
|
HydroDiOxide wrote: |
When running or
Code: | genkernel --menuconfig | what is created? Is it a bzImage? If yes, how is it called and where is stored? I need to copy it to /boot to make it bootable?
|
Make menuconfig is when you choose to configure manually your kernel and Genkernel is use when you want a generique Kernel.
After theses commands, you will have the result kernel inside the bzImage that can be found here :
/usr/src/linux/arch/i386/boot/
And yes, you need to copy /usr/src/linux/arch/i386/boot/bzImage to /boot and also change de name to have a more explicit name for your kernel. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Fri May 25, 2007 1:38 pm Post subject: |
|
|
How can I check what my current kernel is supporting (eg iso mounting, what kind of cpu's, what chipset, that kind of stuff)? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mark_alec Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/153763560547ad83e5abc42.png)
Joined: 11 Sep 2004 Posts: 6066 Location: Melbourne, Australia
|
Posted: Fri May 25, 2007 2:41 pm Post subject: |
|
|
HydroDiOxide wrote: | How can I check what my current kernel is supporting (eg iso mounting, what kind of cpu's, what chipset, that kind of stuff)? | Assuming you built in config.gz support, `zcat /proc/config.gz` will show you what your kernel supports. _________________ www.gentoo.org.au || #gentoo-au |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Sat May 26, 2007 6:33 pm Post subject: |
|
|
first, to check your kernel version, just type this :
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Rabbi Hillel Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/206854849446751440e98a1.gif)
Joined: 15 Feb 2007 Posts: 209 Location: Norderstedt, Hamburg
|
Posted: Sat May 26, 2007 6:45 pm Post subject: |
|
|
I always use it like this:
For fresh sources:
Code: | genkernel --menuconfig --gensplash=livecd-2006.1 --gensplash-res=1024x768 --bootloader=grub --debuglevel=2 all |
And if I change something in already compiled sources I use:
Code: | genkernel --menuconfig --gensplash=livecd-2006.1 --gensplash-res=1024x768 --bootloader=grub --debuglevel=2 --no-clean --no-mrproper all |
For the bootsplash you'll need to do this first:
Code: | emerge -va splashutils splash-themes-gentoo splash-themes-livecd |
You can also do
Code: | genkernel --gensplash=livecd-2006.1 --gensplash-res=1024x768 --bootloader=grub |
and (after long time of compiling (1 1/2 hours on my ancient pIII 1Ghz)) you'll have a livecd-alike kernel.
The option does the job for making the new kernel appearing in grub on boot.
References:
http://www.gentoo.org/doc/en/genkernel.xml
http://gentoo-wiki.com/HOWTO_fbsplash _________________ Gentoo - the chosen distro. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Mon Jun 18, 2007 2:46 pm Post subject: |
|
|
@d2_racing
I've read through the HOWTO and it makes sense to me. I understand the process much better now. However, the article mentions something about not configuring and compiling a new kernel as root. However, I can neither save the configuration file nor compile a kernel as my normal user.
Also, I have saved a configuration file (as root) under another name than .config in /usr/src/linux and I want to use that config file as the source for the kernel compilation. Is that possible?
Another question remains. How do I know what to compile as a module and what not? I will probably have some other questions later on... sorry about that. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Mon Jun 18, 2007 5:12 pm Post subject: |
|
|
HydroDiOxide wrote: | @d2_racing
I've read through the HOWTO and it makes sense to me. I understand the process much better now. However, the article mentions something about not configuring and compiling a new kernel as root. However, I can neither save the configuration file nor compile a kernel as my normal user.
|
I know, this howto is from a book, so since Gentoo has Portage, I think that we are save with that
HydroDiOxide wrote: |
Also, I have saved a configuration file (as root) under another name than .config in /usr/src/linux and I want to use that config file as the source for the kernel compilation. Is that possible?
|
No, just copy your config file in /boot like that :
Code: |
# cd /usr/src/linux
# cp .config /boot/config-kernel-2.6.20-r8
|
With than, when you can to recompile or upgrade your kernel, with the following :
Code: |
# cp /boot/config-kernel-2.6.20-r8 /usr/src/linux/.config
|
Another question remains. How do I know what to compile as a module and what not? I will probably have some other questions later on... sorry about that. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Mon Jun 18, 2007 5:13 pm Post subject: |
|
|
[quote="HydroDiOxideAnother question remains. How do I know what to compile as a module and what not? I will probably have some other questions later on... sorry about that.[/quote]
When you will get some kernel panics or some error when loading your box ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Mon Jun 18, 2007 5:30 pm Post subject: |
|
|
@d2_racing
So the rule of thumb is... compile everything as modules, except for the obvious. So what are the obvious? Proc, File system, ide driver... any more? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Tue Jun 19, 2007 11:48 am Post subject: |
|
|
HydroDiOxide wrote: | @d2_racing
So the rule of thumb is... compile everything as modules, except for the obvious. So what are the obvious? Proc, File system, ide driver... any more? |
Ok... I will recap the howto : Always configure in hard [*] all your hardware :
- Video card
- Chipset for the board
- File System
- IDE driver
- SATA drive
- Network card
And just for the record check my kernel configuration : http://www.gentoo-quebec.org/doc/hb_part1_chap1.html#doc_chap7 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Tue Jun 19, 2007 1:06 pm Post subject: |
|
|
@d2_racing: Hey, thanks for the recap.. can't recall reading that in this https://forums.gentoo.org/viewtopic-t-539024.html HOWTO, however.
About the link: wish my french was what is used to be... is it available in english as well?
Do you have answer for my configure/compile as a user question as well, maybe?
Cheers! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Tue Jun 19, 2007 4:02 pm Post subject: |
|
|
HydroDiOxide wrote: | About the link: wish my french was what is used to be... is it available in english as well? Cheers! |
No, only in French, since I'm french Canadien ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dspahn Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Space Quest/Space_Quest_-_Roger_Wilco.gif)
Joined: 22 Jun 2006 Posts: 392
|
Posted: Tue Jun 19, 2007 4:36 pm Post subject: Recommendation on modules... |
|
|
When I compile a kernel, I keep the core system built in, and not load it as modules. This includes any boot-level resources, filesystems needed. sound cards, network cards, and encryptions/protocols needed to support them. I build things that I might need to unload, such as experimental hardware, as modules. I try to minimize the modules I use and keep it all built in. this makes the kernel move slower and use more memory, but it seems to make my overall system run smoother and better. I also enable module autoloading to cut back on how much configuration my modules need. Having an intimate understanding of the system's hardware (start with lspci) will help you decide what to leave out. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Tue Jun 19, 2007 4:54 pm Post subject: Re: Recommendation on modules... |
|
|
dspahn wrote: | When I compile a kernel, I keep the core system built in, and not load it as modules. This includes any boot-level resources, filesystems needed. sound cards, network cards, and encryptions/protocols needed to support them. I build things that I might need to unload, such as experimental hardware, as modules. I try to minimize the modules I use and keep it all built in. this makes the kernel move slower and use more memory, but it seems to make my overall system run smoother and better. I also enable module autoloading to cut back on how much configuration my modules need. Having an intimate understanding of the system's hardware (start with lspci) will help you decide what to leave out. |
It's so true ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Tue Jun 19, 2007 7:33 pm Post subject: |
|
|
Thanks for all the help on that.
This is the error which I get when I try to run make in the /usr/src/linux folder as a normal user
Code: | HOSTCC scripts/basic/fixdep
scripts/basic/fixdep.c:397: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied
compilation terminated.
make[2]: *** [scripts/basic/fixdep] Error 1
make[1]: *** [scripts_basic] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop. |
When I try to save a .config in that directory as a user I get an error like permission denied.
Thanks. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Wed Jun 20, 2007 2:35 am Post subject: |
|
|
Of course
You need to use your root account to do that ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Wed Jun 20, 2007 10:27 am Post subject: |
|
|
Okeh, so this advice
Quote: | Important Warning: The kernel developers advise against uncompressing the kernel source code, configuring or building the kernel as root. It should be done as an ordinary user. Only the one or two commands needed to install the kernel and the modules should be run as root. There have been bugs in the build process in the past which have caused files in /dev to be deleted when run as root and uncompressing the kernel archive as root can lead to some files getting the wrong permissions. gkh-lkn: "None of the primary kernel developers build kernels as root". |
in this HOWTO is not possible? And I can only configure, compile and install a new kernel as root? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d2_racing Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/1190120345458c61e31ec3c.jpg)
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Wed Jun 20, 2007 11:30 am Post subject: |
|
|
Yes, but in other distribution, maybe you can do the manipulation of the kernel with a fakeroot method.
But in Gentoo, we compile as root ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HydroDiOxide n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131912715846ee6a0eb4b43.gif)
Joined: 22 May 2007 Posts: 55 Location: Groningen
|
Posted: Fri Jun 22, 2007 1:34 pm Post subject: |
|
|
Right, I managed to compile my own booting kernel. However, I get some errors during the boot process. I wasn't able to write them all down (can you pause the boot process to write those errors down?).
Most of them concern things like snd_timer, ac97_bus and the general warning is: Fatal error ... invalid module format (with a path in the error as well).
Also I get the warning that DMA is not enabled. I have compiled it in the kernel, though, as described in the gentoo handbook.
Any ideas? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|