|
Gentoo Linux - Kernel Configuration - Modules |
bamccaig
Member #7,536
July 2006
|
This is somewhat of a part 2 thread for my Gentoo installation (part 1 can be found here). Thus far, I have managed to "install" a base system, however, it won't boot. By the time I finished setting up the bootloader it was like 11:30 PM Sunday night (and I had already rushed the kernel - built it before I really understood what was needed) so I had to shutdown and put it on hold. I didn't pay too much attention to why it wouldn't boot because it was so late, but IIRC grub didn't seem to recognize one of the partitions. It could have been that the kernel didn't know what the LVM2 partition (/dev/sdb4) was, which wouldn't surprise me because I was pretty clueless about configuring modules in the kernel's make menuconfig, but if memory serves grub indicated the root (/) partition (/dev/sdb3) which is ext3. As you can tell, I'm not really sure where grub stands down and the kernel takes over, but after failing to boot whichever partition I was returned to the grub boot menu so I assume grub was still in control... Either way, my current dilemma is kernel modules and determining which ones are required for my system and which ones may be used. As I understand it, certain modules need to be compiled into the kernel and others can be compiled separately and loaded after the kernel boots. I seem to be under the impression that modules built into the kernel will perform faster than those loaded outside of the kernel. If this is right should I compile all of the modules used by my system into the kernel (I guess in theory if something changed I could recompile the kernel)? For the record, when told to add modules to /etc/modules.autoload.d/<kernel_version> I discovered that only one module existed for my kernel. I'm assuming that these were built along with the kernel, but since I didn't know what to select only the one ended up being built. I could go the genkernel route, but I'd rather learn to understand and identify modules. When I get home tonight I'll probably reboot the installation CD, chroot back into my environment, and try again. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
HoHo
Member #4,534
April 2004
|
If you can't get past GRUB then I think that it cannot find a kernel to boot. Most common problem is a typo in grub.conf, anotherone is forgetting to do "make install" in kernel source dir while /boot is mounted __________ |
CGamesPlay
Member #2,559
July 2002
|
Quote: I seem to be under the impression that modules built into the kernel will perform faster than those loaded outside of the kernel. No, the kernel links them into the kernel in the same way a DLL is loaded. No penalties (except for loading times). In fact, you only need to store modules built into the kernel if the kernel needs those modules to access /lib/modules. In other words, you should build in your hard disk controller and filesystem, and the rest can be modules. Quote: I could go the genkernel route, but I'd rather learn to understand and identify modules. Genkernel won't save you form that. I actually don't really find the script that useful, it just creates a more heavyweight boot process. Could you show what the message your system gave was, and please post /etc/fstab and /boot/grub/grub.conf? -- Ryan Patterson - <http://cgamesplay.com/> |
bamccaig
Member #7,536
July 2006
|
HoHo said: If you can't get past GRUB then I think that it cannot find a kernel to boot. Most common problem is a typo in grub.conf, anotherone is forgetting to do "make install" in kernel source dir while /boot is mounted I'll double check, but I'm 90% confident that grub.conf is accurate. The Gentoo Handbook doesn't actually make install the kernel. Instead, it does make && make install_modules and then manually copies the kernel image into /boot. cd /usr/src/linux/ It's difficult to be confident that I did make && make install_modules at the appropriate time because I entered and reentered make menuconfig 3 or 4 times trying to make sense of which modules to build (and which ones were being built where). It's possible that I built at the wrong time, etc... It's also very likely that my kernel is missing modules and that my system itself is lacking modules. CGamesPlay said: No, the kernel links them into the kernel in the same way a DLL is loaded. No penalties (except for loading times). In fact, you only need to store modules built into the kernel if the kernel needs those modules to access /lib/modules. In other words, you should build in your hard disk controller and filesystem, and the rest can be modules. That makes sense. Thanks. So perhaps the problem isn't the kernel, but the lack of external modules (because only one existed there was only one I could add to /etc/modules.autoload.d/<kernel_version> - which was scsi related, not that it necessarily matters ). CGamesPlay said: Could you show what the message your system gave was, and please post /etc/fstab and /boot/grub/grub.conf? I definitely will as soon as I get home. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Don Freeman
Member #5,110
October 2004
|
You should be using the correct make options for the kernel:;) make menuconfig make && make modules_install && make install Also, post the output of: cd /boot/ dir * -R You can usually just use vmlinuz, but I prefer to actually fully qualify the name.8-) As for modules, I prefer to find out which ones I need and build those into the kernel. Why keep these out? Granted there are times when you may need to do this, but I would imagine that building them into the kernel is more secure....it is in the kernel, so who can hack it?;)::) Edit: Edit 2: (hd0) /dev/sda (hd1) /dev/sdb Then when you reference a drive in grub (like the /boot/grub/grub.conf file): root (hd1,0) //really /dev/sdb1 kernel /vmlinuz-2.6.22-gentoo-r2 root=/dev/sdb3 //set root= to your actual / directory
-- |
bamccaig
Member #7,536
July 2006
|
Don Freeman said: Also, when you chroot, be careful that everything is correct. You can think you are chrooted, but you are not. Just be careful. If you are using the same arch (say i686), you can chroot from any Linux distro that matches that arch....(I know you can't chroot into a 64bit environment from a 32bit environment though:-/). Yes, one thing that I realized ~10-30 minutes after chroot'ing into my new environment was that it only affected (effected? I should really clear those up... The xkcd comic made it clear how poorly I understood the differences...) the current terminal. It made sense, but didn't occur to me originally. Since I was switching between all 6 text-terminals it became a minor issue, though I mostly used the other terminals to browse the Web as a regular user. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Don Freeman
Member #5,110
October 2004
|
I have updated my last post about grub...please re-read.::) Edit: I said: I know you can't chroot into a 64bit environment from a 32bit environment though.:-/
Just one more reason to run a 64-bit environment!;D They better be 64-bit to chroot me!8-) Gentoo will make you learn a lot of things about Linux...it is not the easiest distro by far, but that is why I like it so much.8-) Edit 2: -- |
Thomas Fjellstrom
Member #476
June 2000
|
oh, if you''re not well versed in kernel configuring, you can just borrow the config from the livecd, it should be in /boot/config*, which you copy to /usr/src/linux/.config then run "make oldconfig", and continue on. After compiling the kernel you may want to create the initrd image, especially if your root part is on lvm or md raid (unless you made sure those drivers were built into the kernel instead of being modules as the livecd config sets up). -- |
Don Freeman
Member #5,110
October 2004
|
You don't need an initrd...not normally anyway. The only time I have seen the need is when doing EVMS.:) -- |
bamccaig
Member #7,536
July 2006
|
Don Freeman said: Just one more reason to run a 64-bit environment!;D They better be 64-bit to chroot me!8-) According to my interpretation of the Wikipedia article, my processor (Pentium D 940, IIRC) should be 64-bit (or at least supports the x86-64 instruction set? )... I thought it was 32-bit because the Windows version installed was 32-bit... Cool. Don Freeman said: I remember when I first started with Gentoo and chrooted (well thought I was), I untarred the portage tarball on the livecd base system...didn't hurt anything, just a reboot...but boy, I felt stupid!;D The Gentoo Handbook has us untar both the stage3 archive and portage snapshot before chroot'ing, making sure to untar them in /mnt/gentoo and /mnt/gentoo/usr, respectively. Also when we do chroot into the new environment we update the prompt with a (chroot) prefix. (chroot) livecd /# I guess that's why. BTW, when you're running off of the Gentoo Installation CD where does it store files that are written to the filesystem...? I got the impression that "tmpfs" had something do with it, but wasn't sure... Are they all just kept in memory or does it find a piece of unallocated space somewhere and write to there? Don Freeman said: What file system did you decide to take? I know that the xfs file system has some really powerful backup tools...saves the entire partition for you...and it doesn't bog down the system. You can't even tell when it is running.::) I went with ext3 because it seems like a pretty common choice and it's what the Gentoo Handbook did. IIRC, they recommended not to use XFS unless you had a SCSI drive for whatever reason. Since I'm using a SATA HDD I figured that I should just stick to ext3. Thomas Fjellstrom said: oh, if you''re not well versed in kernel configuring, you can just borrow the config from the livecd, it should be in /boot/config*, which you copy to /usr/src/linux/.config then run "make oldconfig", and continue on. After compiling the kernel you may want to create the initrd image, especially if your root part is on lvm or md raid (unless you made sure those drivers were built into the kernel instead of being modules as the livecd config sets up). That sounds like a viable option, though I would still prefer to understand the modules... One of the installation docs I was reading suggested that as well, but not until after I had chroot'd into the new environment. At the time, I didn't know it was possible to just exit back to the previous root (/) so I figured that the livecd[/"tmpfs"?]'s /boot partition was lost until I rebooted. Of course when it came time to actually reboot I was enlightened. Don Freeman said: You don't need an initrd...not normally anyway. The only time I have seen the need is when doing EVMS.:) Apparently the genkernel script builds one... I don't have a clue what it is or why it's needed though. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Don Freeman
Member #5,110
October 2004
|
If that is indeed the processor you have, then yes...you can run gentoo in 64-bit mode. It is a little more of a pain to get right, not something I recommend for you just starting Gentoo. If you want in the future, I will help you with that...it has to do with the way it deals with 32-bit and 64-bit libraries. Also, no 64-bit flash player yet...:( Quote: Apparently the genkernel script builds one... I don't have a clue what it is or why it's needed though. Yes, but you do not NEED the initrd file. genkernel is just that...a generic kernel. You could have just copied the livecd kernel for that! It is a generic kernel...it has to support everything!;) You just: cd /usr/src/linux make menuconfig make && make modules_install && make install modules_update mc -e /boot/grub/grub.conf // or use whatever editor you have (vi?) A sample of the packages you may find useful (When we get you up and running.:P)
I would start with mc (midnight commander: awesome), gentoolkit, pciutils, eselect, and definately euses (helps with finding out what the use flags are used for). An example of euses: euses doc doc - Adds extra documentation (API, Javadoc, etc) dev-java/gjdoc:xmldoclet - Also build support for the xml doclet that generates output in xml instead of the traditional html javadoc. sys-apps/portage:epydoc - Generate api documentation with epydoc. www-apps/knowledgetree:opendoc - Allow to search in opendoc documents
-- |
CGamesPlay
Member #2,559
July 2002
|
Quote: BTW, when you're running off of the Gentoo Installation CD where does it store files that are written to the filesystem...? I got the impression that "tmpfs" had something do with it, but wasn't sure... Are they all just kept in memory or does it find a piece of unallocated space somewhere and write to there? tmpfs is a RAM filesystem, so they aren't saved to your disk. Quote: That sounds like a viable option, though I would still prefer to understand the modules... And I think that's a good choice. If I were you, I would strip your kernel to the bare minimum needed to get to a login prompt, and everything should be compiled into the kernel. Then, once you are on your system, you can change the kernel modules and activate them without even restarting. Quote: Yes, but you do not NEED the initrd file. genkernel is just that...a generic kernel. Not actually important, but genkernel is "generate kernel" Anyways, I don't think we can really work on the problem any more until we know exactly what it is, so let us know what the boot messages are, what your /etc/grub/grub.conf is, and what you /etc/fstab is -- Ryan Patterson - <http://cgamesplay.com/> |
Don Freeman
Member #5,110
October 2004
|
Yeah...and stuff. Also, if you can post the output of lspci...we could probably help you pick the correct modules to build into your kernel, so you can actually boot into it.::) -- |
MiquelFire
Member #3,110
January 2003
|
Another package you may want is screen. I use it all the time when updating my system. --- |
BAF
Member #2,981
December 2002
|
Quote: That makes sense. Thanks. So perhaps the problem isn't the kernel, but the lack of external modules (because only one existed there was only one I could add to /etc/modules.autoload.d/<kernel_version> - which was scsi related, not that it necessarily matters ). No, the problem is either the bootloader, or the kernel. Wether or not you have modules or if it's all compiled into the kernel, etc doesn't matter. The lack of modules won't affect your system's ability to boot, but missing modules that aren't compiled into the kernel can cause various hardware not to work. |
Thomas Fjellstrom
Member #476
June 2000
|
Quote: The lack of modules won't affect your system's ability to boot, but missing modules that aren't compiled into the kernel can cause various hardware not to work. Not true at all. If ext3 is a module, and/or lvm or your ide driver is a module, and they aren't loaded, it'll never get past the boot loader. Immediate fail. -- |
BAF
Member #2,981
December 2002
|
I meant to say external modules. My point was the lack of stuff in his modules.autoload.d or actual external modules themselves do not affect the boot process at all (with the assumption you have the correct internal modules, but that has nothing to do with his theory that lack of external modules were causing the problem). |
Thomas Fjellstrom
Member #476
June 2000
|
Quote: (with the assumption you have the correct internal modules, but that has nothing to do with his theory that lack of external modules were causing the problem There is no such thing as "internal modules". You have modules, and you have "not modules". You assumption is flawed. -- |
bamccaig
Member #7,536
July 2006
|
It appears instead to be having problems with the /boot partition, though it is somehow reading /boot/grub/grub.conf. While I was fetching the following information it occurred to me that lvm2 isn't even installed on my system... I'm sure that will help eventually. /boot
/boot/grub/grub.conf
/etc/fstab
It would appear the pass numbers for /home, /opt, /usr, and /var should be something other than 1... :) When I try to boot the first listing (/dev/sdb) Booting 'Gentoo Linux 2.6.22-r9' root (hd1,0) Filesystem type unknown, partition type 0x7 kernel /kernel-2.6.22-gentoo-r9 root=/dev/sdb3 dolvm2 Error 17: Cannot mount selected partition Press any key to continue...
-- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
BAF
Member #2,981
December 2002
|
I don't know anything about LVM, so I can't really help. I always just install straight up. Sounds like you need some LVM module or something, or maybe an initrd. The Gentoo Wiki points here for info on installing with LVM. That should help. |
bamccaig
Member #7,536
July 2006
|
BAF said: The Gentoo Wiki points here for info on installing with LVM. That should help. Thanks for the link. I had combined this with the Gentoo Handbook to get my lvm2 partition created and to load it, etc. It seemed to be a little bit more disconnected from the Gentoo Handbook requiring me to fill in the gaps a little bit more. The one you link to seems to compliment the Gentoo Handbook so it will surely help. Unfortunately, I'm still not sure which modules I should build into my kernel and which ones I should build into external modules. Also, grub doesn't seem to be getting as far as the lvm2 partition so I don't think that's the issue. If anything, those partitions would fail, but my base system would have booted successfully. So I don't think lvm2 is my immediate problem. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
le_y_mistar
Member #8,251
January 2007
|
back in the day, when i didnt know better and used gentoo, i'd geet annoyed of compiling the kernel...So, I'd copy the kernel from the livecd and the associate modules into my current install, and i'd be able to boot off of it with, saved a lot of time and effort and comes with all the modules that you would need. Seriously dude, why don't you just go debian or ubuntu? ----------------- |
BAF
Member #2,981
December 2002
|
The only things you have to build into the kernel are your file systems and any drivers required to get access to your /boot partition. The rest can be external and loaded as needed for other hardware. |
CGamesPlay
Member #2,559
July 2002
|
Quote:
Booting 'Gentoo Linux 2.6.22-r9' root (hd1,0) Filesystem type unknown, partition type 0x7 kernel /kernel-2.6.22-gentoo-r9 root=/dev/sdb3 dolvm2 Error 17: Cannot mount selected partition Press any key to continue...
Partition type 0x7 is NTFS. Go back into cfdisk and set the type of the partition on your swap and root drives. If that is set correctly, then you need to verify your grub identifiers. You can do that from the grub console from within your chroot. -- Ryan Patterson - <http://cgamesplay.com/> |
bamccaig
Member #7,536
July 2006
|
CGamesPlay said: Partition type 0x7 is NTFS. Go back into cfdisk and set the type of the partition on your swap and root drives. If that is set correctly, then you need to verify your grub identifiers. You can do that from the grub console from within your chroot. I gather that the second suggestion was to verify that (hd1,0) is pointing to my slave (Linux) drive and not my master (Windows) drive? -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
|