View Full Version : Compiling the Kernel
06-02-2003, 07:30 AM
I am going to attempt a kernel rebuild to personalize my machine. I have read miles of text and I think I am ready. However, nowhere have I found what I can safely do away with after doing "make menuconfig". The box that pops up has a zillion options to select from. Some are easy - like "Toshiba Laptop Support". I know I do not need this because I do not have a Laptop!
Where do I go to find out which of these options I can trim? I do not have a clue as to what most of these options even mean. (Maybe I am not as ready as I thought - hehe)
I am going on vacation to the Smokies for some much-needed R&R. If I do not reply for a few days, do not think I am ignoring anyone. I appreciate all that have helped me in this forum.
06-02-2003, 07:47 AM
You need the services of Dramen, organG, or BoBG. They are the ones who are really play with kernel recompiles.
They will be trolling a bit later today, I'm sure you will get an answer then :)
Enojoy the Smokies, they are a beautiful mountain range. Holla off the top of one of those peaks for me, please :) Ya See, I grew up in dem dar hills :)
06-02-2003, 07:56 AM
Ok Bits, on Wednesday afternoon, we will be taking a trail up to a waterfall. I forget the name, but I know where it is.
I'm gonna holler "Bits - CAN YOU HEAR ME NOW!"
06-02-2003, 10:30 PM
I haven't been compiling kernels for a while, but when i did, i would always use the os's config for a guidline. You can find it in /boot and it is a text file, mandrake usually has the current kernel version to it's name or suse calls it vmlinuz.config. I will upload the suse file here so you can get and idea.
I always found kernel compiling a trial and error thing, you do need to know your own hardware and what you want available in the kernel at boot time.
the safest thing to do is build everything as modules that can be loaded later and keep the kernel small. some things will be obvious that you don't need such as ham radio modules, or bluetooth, unless of course you actually use them.
check out the text file in /boot that willl help a lot. You will never be satisfied with your first build anyway so..
and do make sure you don't get rid of your present kernel. ;)
I'm sure Grogan or Bob can offer more info as i've been away from much linux use for awhile, but that is about to end. :D
06-02-2003, 10:44 PM
Load it up to see what it looks like, but using the OS's config file isn't really much good, because it'll have almost everything selected as modules, in addition to building a lot of drivers statically that you don't need. You don't want or need to build modules for hardware you don't/can't/never will have, or support for features you'll never use. Also, unless you're going to build an initrd, that config won't even work for you. If you're going to build a kernel exactly like the vendor's then there's really little point in doing it. You'll gain nothing.
There really is no easy way to tell you what do do. Start with a kernel source tarball downloaded from kernel.org. The default config isn't actually a bad starting point.
Go through each and every category, and read the help available on the items you don't understand. This is one instance where help really is helpful. It even has provisions for people who don't understand the help on a given item. It'll tell you "If in doubt, say N" or "If in doubt say Y" if it's something that could be important. A lot of them will be common sense.
Other than that, if you have specific questions on a configuration option, ask.
You can't go too far wrong as long as you don't remove your original kernel.
06-02-2003, 10:54 PM
Case you didn't find this thread, Building the Linux Kernel (http://www.bitbenderforums.com/vb22/showthread.php?s=&threadid=49079) by Bobguy is really helpful.
The "make menuconfig" will have "help" files for most of the options. You can usually get a hint from there whether or not you want to incorporate an item. Usually you will only use the options for the hardware the OS is running on. Things like an ATI video card. If you think you are going to replace the video card in the near future, you can also build the new card, but build both as a modules. The same would hold true for sound cards.
Not to worry if you get something wrong. Building the kernel is actually one of the easier things to compile for Linux and you will find yourself customizing frequently. Just keep a working version handy to fall back on.
06-02-2003, 11:02 PM
I didn't mean to use the os's config as a template for your new kernel, just that it can be helpful to refer to as a general guide.
06-02-2003, 11:20 PM
Yes, for some items it might be good to look at the vendor's config. For example, you can see if they've built support for features like "BSD Process Accounting". There's more to it than just hardware configuration.
06-02-2003, 11:29 PM
I didn't explain that very well grogan, but mostly I used the vendors config as a starting point to see what they thought should be built directly into the kernel and what could be left to loadable modules.
Kernel building is fun, for me it is mostly experimentation and trial and error anyway.
06-02-2003, 11:43 PM
Anything I want to work all the time, (in addition to critical things needed to boot the system) I build statically. For example my network adapter... I never want to unload that driver and if I ever need to change NICs, it takes me about 3 minutes in total to build and install a new kernel.
Things I build as modules, are things I like to manually load and unload (I use little scripts to facilitate that). Floppy, CDROM, sound card, foreign filesystems, netfilter drivers... these are the things I build as modules.
That's just the way I do it though, it's probably not for everyone.
06-02-2003, 11:47 PM
I'd bet you have a super fast kernel, how many kb is it?
06-02-2003, 11:57 PM
Yep, my kernels are very fast. I cheat too.. I edit the arch/i386/Makefile to use -march=pentium4 instead of i686 for the pentium 4 configuration choice (gcc 3.x supports that processor target but 2.9x doesn't).
My kernel image is 583 kilobytes. That's version 2.4.21-rc6
06-03-2003, 12:31 AM
Nice and lean Grogan. Have you fooled around with 2.5 kernels, or do you generally shy away from developement kernels, or at least for your primary os/rig?
EDIT: Ooops,sorry mlangdn, i didn't mean to take this thread someplace else, now back to the original thread. :)
06-03-2003, 01:26 AM
I don't mind playing with development kernels in a stable series (like 2.4), but I haven't tried a recent 2.5 kernel. The earlier ones I tried (last one was 2.5.39 I think, I'd been sampling them at various intervals) were still a bit awful, and some things I needed to use were still broken.
I'm more looking for improvements, rather than experimenting these days.
I'm waiting until it's closer to being ready, because I don't want to break the harmony. I know that it will be detrimental.
See, I keep everything in balance. I compile everything myself, for my system, and I'm quite fussy and want things to match. That's the secret to having a good clean build environment for the software I use on this machine. For example, I compile glibc for pentium4, using current kernel headers, and only to support kernel 2.4.20 or higher (no backwards compatible cruft). This becomes the foundation for a lot of software. Eventually, everything gets recompiled as new versions come out. I'd prefer to keep my running kernel of that series also. Hopefully the 2.5 kernel wouldn't have any problem with that, but any new features of 2.5 wouldn't really be available for system calls anyway and there could be some "gotchas" in the mix because of the way I've done things.
When it's more mainstream and actually "kernel 2.6" and I've switched over, I'd probably want to start recompiling stuff. I'd then probably stay in that series.
The 2.4 series is really getting good, there's no reason for me to switch at this time.
06-03-2003, 05:12 AM
Thanks grogan, good explanation. I admire your tenacity (and the energy to do so) in keeping a clean and fit system. :thumbsup:
06-03-2003, 07:42 AM
Ok guys, I am heading for the Smokies now and will be back on Friday to make the attempt. Thanks for all the info - I will be doing some more reading in the meantime. Gotta holler for Bits too on some mountain top!
06-06-2003, 01:11 PM
Well, I built a new kernel and it WORKED! However, it is a little larger than the old kernel. I thought I was slicing and dicing real good - then I noticed that Grogan hand loads some modules as needed. I don't think I did it that way. Made 'em right into the kernel. While I got rid of a lot of stuff I did not need, I did not decrease boot time by much.
Back to the drawing board!
06-06-2003, 01:56 PM
You don't actually have to hand load the modules, in fact if you enable the kernel module loader (under loadable module support) the kernel will attempt to automatically load modules when called for.
Note Note Note: Don't build anything that's needed to start the system, as modules. For example, disk controllers, IDE hard disks, main filesystem.
06-06-2003, 04:31 PM
Here's something I forgot to ask. Programs I compiled from source get angry about running in the new kernel. For instance, to start x, I had to load the nvidia driver and it complained that I was going to "taint" the kernel and that there was no GPL license for the driver. It worked, but should I re-do the driver in the new kernel so that it will quit complaining?
06-06-2003, 05:54 PM
Proprietary, closed source drivers (and those with incorrect licensing information) are flagged like that on purpose. It "taints" the kernel because it's a proprietary driver and poisons the license. It also makes kernel debugging impossible. It's more of a protest than anything... the kernel developers don't like it, so they put in that warning.
You can just ignore the message. You in fact cannot fix that.
06-06-2003, 07:07 PM
Like G says, there ain't nothing you can do about it. I have a port patch in my kernel that does the same thing. The warning shows up in the boot process but things continue on their merry way.
06-06-2003, 11:44 PM
I forgot, what distro are you building this kernel for?
BTW, it does get easier with practice. :D
06-06-2003, 11:51 PM
Mandrake 9.1 is the distro I am using. I also used the kernel source from the CD, not from a downloadable source. I am rebuilding for practice and learning.
By the way, BobGuy, the link for your kernel tutorial on this page did not work - the one posted by CoolCanuk. Sure would like to have that.
Now, since I do not like the way it turned out, how do I start over?
06-07-2003, 12:36 AM
Now, since I do not like the way it turned out, how do I start over?
I'm not sure, because I don't know exactly what you have done so far. Sure hope you have 2 kernels in /boot.
$ cd /boot <--where the kernel lives
$ cd /lib/modules <--where the modules live
$ ls -l
drwxr-xr-x 3 root root 408 Apr 4 11:34 2.4.21-0.13mdk/
drwxr-xr-x 4 root root 416 Jun 6 18:58 2.4.21-rc7/
You should find out exactly what you have now before you go any further.
BTW you never upgrade the kernel that you have, you always build another kernel next to the working one that you have.
06-07-2003, 08:29 AM
I kept the original kernel. Here is what I have using the ls command:
From /lib/modules ls -l:
drwxr-xr-x 4 root root 4096 Jun 6 05:54 2.4.21-0.13mdk/
drwxr-xr-x 4 root root 4096 Jun 6 07:09 2.4.21-0.13mdkcustom/
Both kernels work, however, I caused a lot of bloat in the new kernel by loading most stuff in instaed of using modules. I could not create a boot disk because the kernel could not fit on a floppy. Livin' and learnin' and still not frustrated!
Iam currently downloading patch-2.4.20.bz2, patch-2.4.21-rc7.bz2, and the full source code 2.4.20.bz2.
Are these the correct files for compiling a new kernel?
06-07-2003, 11:38 AM
patch-2.4.20.bz2 is a patch to go from version 2.4.19 to 2.4.20. Discard that, it's not of any use to you with the 2.4.20 source.
patch-2.4.21-rc7 is a patch to be applied to 2.4.20 source. It's the latest development kernel in the 2.4 series. That's the kernel I'm using right now. I think it's OK (there's nothing broken in it that I use and it works great on my hardware), but I'll caution you on development kernels.
Do you know how to patch the kernel source?
First, unpack the 2.4.20 kernel source tarball. It will unpack to linux-2.4.20. Place the patch-2.4.21-rc7.bz2 file in the directory above linux-2.4.20.
bzip2 -dc ../patch-2.4.21-rc7.bz2 | patch -p1
The ../ notation is a shortcut to the directory above.
That will scroll your terminal like mad, while it shows every file it's patching. I don't like that, so I use patch -s -p1 (the -s switch is "silent")
After that's done, configure and build your kernel like normal.
06-07-2003, 12:00 PM
Thanks Grogan - I'll keep you posted and all other interested folks.
06-07-2003, 09:33 PM
Kernel is up and running - 2.4.21-rc7. However, it does not see /home/michael, and the login is set to bash instead of /home/michael. I also lost a cdrom and mouse, but I got the mouse back.
I cannot start x, even using insmod -f for the nvidia driver. I rebuilt the driver, but because I no longer have a /home/michael, KDE would not start.
I could not rebuild the ltmodem driver, but I believe this is because the binary is designed for Mandrake, and this kernel is not mdk.
I did get the kernel down to 801.6 kb, but it seems I may have left a couple of things out. I used xconfig because it was easier to use, especially for the help sections.
It is 9:13 pm and I am fried. Time to drink beer and regroup, and download a new binary for my winmodem. Maybe I will just go and buy me a hardware modem. I miss my old EISA modem, but this newfangled board has no ISA slot.
I have only had one beer. If you think I am rambling, wait till I have had two!
06-08-2003, 01:34 AM
What do you mean you've lost /home/michael? Is your /home partition mounted? What type of filesystem is it? Did you compile support for it (and not as a module, either).
06-08-2003, 07:59 AM
I can change to /home, but ls says it is empty. But it is all there with the original kernel. File system is ext3. Everything is owned by root. It still keeps my login, but sticks me in the / partition because it says there is no /home/michael.
It is going to take awhile, but I will figure this stuff out eventually. It would help if I knew a little more about options in the kernel, but crash-and-burn is a good teacher.
06-08-2003, 09:35 AM
Thanks for taking the plunge, Mike.
I've been wanting to rebuild my kernel for some time, but didn't have enough knowledge. After tons of reading on the subject and this thread, I'm almost ready to "crash-and-burn" myself. :D
06-08-2003, 10:20 AM
Yes, a mount point is an empty directory. It sounds to me like it's not being mounted for whatever reason. Lemme see the contents of your /etc/fstab file.
06-08-2003, 10:38 AM
Here it is, however, I destroyed the new kernel and am going to start again. This time, I am going to try to do a little more study and research on each option. I have done three kernels, and all three have booted, but there are little problems that I did not see coming. Each one has been better than the last, so about 10 more might do it - hehehehe!
dev/hdb1 / ext3 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hdb6 /home ext3 defaults 1 2
none /mnt/cdrecorder supermount dev=/dev/scd0,fs=auto,ro,--,user 0 0
none /mnt/cdrom supermount dev=/dev/hdc,fs=auto,ro,--,iocharset=iso8859-1,codepage=850 0 0
none /mnt/cdrom2 supermount dev=/dev/hdd,fs=auto,ro,exec,--,user,iocharset=iso8859-1,dev,codepage=850,suid 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,sync,codepage=850 0 0
/dev/hda1 /mnt/windows ntfs iocharset=iso8859-1,ro 0 0
none /proc proc defaults 0 0
/dev/hdb5 swap swap defaults 0 0
06-08-2003, 11:58 AM
Ok, there's no weirdness in your fstab that should cause this. I'm assuming you just missed the / in the first line when you pasted, as the kernel would panic if not.
If you haven't deleted the source directory yet, find the file .config in the top level (enable hidden files in a file manager to see it) and copy it somewhere and rename it to config.txt
Attach it to a post for me and I'll check your options.
It also might be good to show me the section in lilo.conf that boots your mandrake kernel. There could be an option in the command line, that the kernel you built doesn't support, for example, or perhaps you need to add an option.
06-08-2003, 03:00 PM
Ok, but it may be tomorrow before I am finished with this one. I am printing your post to remind me to do this. I deleted and restored /usr/src/linux-2.4.20 just to get rid of everything. I have patched the source file again and am about to restart the build process. Here goes!
Ralpha6 - go for it! It's funnnnnnnnn!
06-08-2003, 05:31 PM
Here is a new .config file. This kernel did not boot, and there was no error messages. Nothing showed up on screen for 5 minutes. Then I went back to the good kernel. I could not find the browse button to attach the file.
Deleted by me - Too much.
06-08-2003, 06:02 PM
Ok, first of all, deselect "Symmetric Multi Processing Support" under Processor Type and Features unless by chance your computer has more than one CPU.
Under General Setup, disable "support for hot pluggable devices". This will disable the entire category... I notice you have some PCMCIA cardbus devices built right into the kernel. Unless this is a laptop, you are extremely unlikely to make use of that.
You're also building a lot of modules I know you'll never use, but those are harmless because they'll never be loaded.
Get rid of "Multi Devices Support" (RAID). This is just "software raid" anyway.
You also don't need all those networking options, under Network Options. All you really need in there is Unix Domain Sockets, and TCP/IP Networking. You might also want to enable Network Packet Filtering, then go and build the IP: Netfilter Configuration items as modules. (for firewalling or masquerading to work). Incidently, you enabled just about everything under Netfilter Configuraiton except what you most need. Iptables support.
OMG! Under IDE/ATA/RFM/RLL and IDE, ATA and ATAPI Block devices, you have support built in for all kinds of different controllers and such that you can't possibly have. Only enable what you need in there. I am not surprised this kernel just hangs on boot.
Also, I'll warn you, you forgot to configure "Network Device Support" options. If you are dialing up, you will need PPP Support, PPP Support for Asynchronous Serial Ports, and additionally you should build the compressors. If you have an ethernet card, you should also enable support for it. The default is Intel EtherExpress Pro... unless you have one of those you must choose the correct card from the list.
Under character devices, don't enable support for all those AGP chipsets either. Only for what you have.
Also, under filesystems you did exactly what I said not to do. You enabled EXT3 Filesystem support as a module. This kernel would not boot for that reason alone, even if everything else was correct :-)
The reason Mandrake can build their kernels with things like filesystem support as modules, is because they use an initrd. (initial ramdisk, that loads from an image that the bootloader knows where to find). That's not really needed when you build your own kernel, and if you're going to use one it must be correct and the lilo.conf entry must point to the initrd image file.
I recommend that this time, you don't try and do things like the Mandrake config.
06-08-2003, 07:32 PM
By the way, for next time, to attach a file to your post, don't use the "quick reply" edit box down at the bottom of the thread. Instead, click the purple "Post Reply" button (you'll find one near the top and bottom of the posts) and more advanced controls will be available to you, including the form to upload an attachment.
06-08-2003, 09:22 PM
Here is the .config file done right
06-09-2003, 06:51 PM
I am on my 6th build and I got a totally different response this time:
Kernel panic : VFS : unable to mount root fs on 3:41
I am attaching the config file, then I have an appointment in town.
I am also attaching lilo.conf
Have patience - I am getting closer!
06-10-2003, 05:56 PM
Ok I just went though it all and I believe I have done it correctly. Now that's it time to edit lilo.conf, I have, but when I try to run /sbin/lilo I get no such file or directory.
1 case, 2 HD's hdd1 is the full 13 gig HD all for linux by itself, which is the HD I downloaded and compiled my kernel.
hdb has 2 windows partitions and 1 linux partition (hdb6) and this hd also contains the lilo.conf file I edited and can't seem to run /sbin/lilo for.
I can boot to Windows, Linux, and LinuxTestBed (with the original kernel)
Am I missing something or did I do something wrong?
append="devfs=mount acpi=off quiet"
append="devfs=mount acpi=off quiet"
append="devfs=mount acpi=off quiet"
append="devfs=nomount acpi=off failsafe"
06-10-2003, 06:50 PM
# CONFIG_EXT3_FS is not set
You didn't enable ext3 filesystem support at all :emb:
Your kernel cannot mount the root filesystem, because it does not have the driver code.
Please say Y to Ext3 Journaling Filesystem support on your next try :-)
06-10-2003, 06:56 PM
Ralph, try typing which lilo as root. To eliminate any confusion, actually log on to the system as root. (not just su where depending on how you did it, you may not have path variables)
I've always seen the lilo binary in /sbin, but it's possible that it's elsewhere, like /bin.
If you log on as root, you should just be able to type lilo
06-10-2003, 07:06 PM
I logged in as root:
[root@localhost root]# lilo
Fatal: open /mnt/disk/boot/vmlinuz-2.4.20-rc7: No such file or directory
[root@localhost root]# which lilo
Ok I changed the System.map symlink to point to the new System.map. Would this have anything to do with it?
06-10-2003, 07:22 PM
Ralph... you need to mount that partition first. Where your second linux distribution is installed. Remember, bobguy helped you with this. Lilo will just fail to update, if there are errors in the file. It's treating this as an error because the path to that kernel doesn't exist.
mount -t fstype /dev/hdwhatever /mnt/disk
Where fstype is the filesystem type (e.g. ext3, or reiserfs... whatever) and /dev/hdwhatever is the partition device (looks like it's /dev/hdd1)
so... assuming it's ext3 and /dev/hdd1 is correct
mount -t ext3 /dev/hdd1 /mnt/disk
Then run lilo as root.
06-10-2003, 07:28 PM
Grogan, thanks. I completely forgot to mount it first. It's been a while and I just got done with the make config, so my brain was a little fried.
It worked, so now I'm gonna boot to that kernel and see what's up. :D
06-10-2003, 07:30 PM
Mike, your kernel config was still as fucked up as a soup sandwich (excuse my french). There were too many things wrong with it, for me to explain.
So, try this on for a starting point. Rename it to .config and copy it to the kernel source directory.
There are a couple of things you need to verify, before you actually use this config though. Under IDE, ATA and ATAPI Block devices, I saw you enabled AMD Viper Support as a module. Is that what chipset you have? I have enabled that as Y in there. That is what you want, if you have an AMD viper chipset.
Next, under character devices. What AGP chipset do you have? AMD Irongate, 761, and 762 support is enabled, and /dev/agpgart support is set to M (that's what you want for /dev/agpgart support).
Verify that AMD Irongate is the correct choice.
Go through all the categories and see what I've done and adjust if necessary. This config should be a good starting point for you.
06-10-2003, 07:35 PM
Booted to a black screen :( So back to the drawing board.
06-10-2003, 07:39 PM
Ralph, in lilo.conf, set vga = normal instead of 788 and run lilo again. (don't forget to mount that partition first)
06-10-2003, 07:50 PM
Reading back through this thread, I noticed you mentioned how Mandrake uses initrd. Should that be in my lilo.conf for my new kernel, like it is for my original mandrake kernel?
06-10-2003, 07:54 PM
No... forget about initrd when you compile your own kernel. You didn't make an initrd. Don't include it in the kernel section either. Take the initrd line out from that kernel section that you just built (I missed that in your lilo.conf). That could by why your kernel won't boot.
Leave it in for your other kernels though!
06-10-2003, 09:52 PM
Now I know where I fucked up, and I love the French language. In an earlier post, you had said that I had ext3 loaded as a module, and I took this to mean "take it out"! My bad!
I will recompile and say yes this time. Thanks for the config help. I will look at it real close tomorrow and start over. It does not take as long to get through now - hehehe. I am getting a little more used to it now.
Ralph, keep on keepin' on! Good Luck!
06-10-2003, 11:47 PM
Marcelo Tosatti: Linux 2.4.21-rc8
Here goes -rc8. If nothing really bad happens in 2 days, this becomes final.
I tried the initrd.img it was a waste of time and resources. It did work tho.
But to avoid a kernel panic the entry in lilo.conf should look like this:
If your entry looks like this one below, you will get a kernel panic.
Better to not even build initrd.img in the first place!
Mandrake will run just fine without it. But your filesystem has to be built into the monolithic kernel, not as a module!
I use reisersfs, so during the 'make menuconfig' reisersfs=y
Also there is no need to symlink the System.map in mandrake, if System.map is labeled the same as the kernel version, as in System.map-rc7, the start up script will find and create the symlink for you.
You can check this out by opening the filemanager and looking in /boot, you will see that it's properly symlinked to the kernel you booted.
I dont think the kernel will be properly symlinked, mainly because there is already a vmlinux in /boot, so I always use the version number ie, vmlinuz-2.4.21-rc7
BTW, lilo will work with either symlinks or the file names. Thats why it can be either vmlinuz or vmlinuz-rc7. All kernels can not be called vmlinuz in /boot, one kernel one filename.
06-11-2003, 12:40 AM
The entry in lilo.conf should not have an initrd line if there is no initrd! Unless you create an initrd there will not be one. The only way you'll get one automatically, is if you use a vendor supplied kernel source and do the make install (it runs mkinitrd).
06-11-2003, 05:17 PM
I recompiled for the 3rd time now. When I reboot, I get this message:
kmod failed to exec
/sbin/modprobe -s -k block-major-22 errno-2
Kernel panic :VFS: unable to mount root fs on 16:41
on the second try, I got the same error message except it was:
/sbin/modprobe -s -k ide-disk errno=2
06-11-2003, 05:26 PM
Don't build IDE/chipset drivers as modules... you need to build that stuff right in the kernel (say Y, not M)
You know the drill. Copy your .config file and rename it to something.txt and attach it to a message for me if you want more help :-)
06-11-2003, 05:36 PM
When I compiled this last time, I was told that the kernel image was too large for a floppy, so I went through and changed some things to modules. I'll check/change the IDE/chipsets to built in.
06-11-2003, 05:43 PM
Don't get the wrong file... it's NOT vmlinux in the top level source tree (that's just the uncompressed binary you can't boot it). After building, your kernel image will be:
I'll look at your config in a while and attach a corrected one that you can use for an example.
06-11-2003, 05:46 PM
I moved and renamed the ~/linux-2.4.20/arch/i386/boot/bzImage to /boot/vmlinuz-2.4.21-rc7. That's what I was supposed to do right?
I just looked at the config file I attathed and I noticed something right away that's wrong. I have an AMD Athlon XP 1800+ and not a P3. d'oh!
06-11-2003, 06:03 PM
Yes, that was correct file.
OK, you really had the IDE chipset settings messed up. You build IDE support as a module, and didn't build PCI-IDE support at all.
Anyway, here's your config.
Since your CPU was wrong, then so is your IDE chipset. You won't have a PIIXn chipset. Make sure you choose the correct one. (e.g. VIA or AMD Viper... whatever). I'll leave this to you, because I don't know what you have. Don't omit this.
06-11-2003, 07:01 PM
Ok, I went through the config file again and believe I have it correct, if you want to peruse it real quick. ;)
06-11-2003, 07:15 PM
Looks ok, except why did you enable "Network Block Device" support? That's not what you think it is. Say N to that.
Also, it's ok to build ATAPI CDROM support as a module. (I see you changed it to Y, which is fine for now)
06-11-2003, 07:24 PM
Ralph, I've been thinking, you should probably also say Y to "Generic PCI IDE Chipset Support" just in case the VIA 82CXX choice doesn't work out. Gives it something to fall back on. (kernel probes as it loads the driver code).
06-11-2003, 07:30 PM
Ok I made the 2 changes you suggested. I don't know why I changed Network Block Device. I knew I didn't want that lol.
06-11-2003, 07:51 PM
I didn't change the generic PCI chipset choice, and successfully booted into the new Kernel!
But, :lol: sound and internet doesn't work, so I'll have to do some fishing around to find what's that about.
When I open up Konq, I get:
06-11-2003, 07:53 PM
You might have to load the modules for your sound card and NIC (I would have thought the kernel module loader would take care of that, but perhaps not)
Edit: Needs DECchip Tulip support (wrong NIC driver compiled)
06-12-2003, 09:19 PM
Rats, now I am booting to a black screen. I tried editing the lilo file from vga=788 to normal and that did not work. I have been over the config file a hundred times and I think I went brain dead. I must have missed something. Would you please look again?
06-12-2003, 09:22 PM
Here is the lilo.conf file
06-12-2003, 10:07 PM
Well I see something that could be killing you in your lilo.conf file. You have devfs set to mount, yet you didn't build devfs support.
To see dev filesystem support (under Filesystems) you first have to enable "prompt for incomplete code or drivers" under Code Maturity Level Options.
So you better build Dev Filesystem Support into your kernel, because it looks like you're using it.
You too, ralph.
P.S. Don't forget, any time you edit lilo.conf (not just when you add a new kernel) you must run lilo for the change to take effect.
Also, if you change your kernel image (e.g. recompile) you must also run lilo. Even if the lilo.conf file doesn't change. Lilo has to map the physical location of the kernel image.
06-12-2003, 10:25 PM
Mike, try taking the "vga" parameter right out of here
append="devfs=mount hdd=ide-scsi acpi=off quiet"
06-13-2003, 12:24 AM
My latest try.
06-13-2003, 08:28 PM
Success at last - sort of! I can boot, and pretty quickly to a console. I had to run the Nvidia installer to startx because I could not even use -f to load the module. But somewhere along the line, I lost the mouse. The pointer will not move. I am missing something in the config file I guess.
When I returned to the old kernel, it said I was missing the mouse and did I want to configure. Of course I did the config scheme and was ok in .mdk. I also put the original System.map back before booting. This is one item we have not discussed.
When I am in the new kernel, I have to reinstall the NV driver and again in the old kernel. Is there a way to make this install for each kernel until I am satisfied with a build and delete the old kernel?
How can I configure the USB mouse from the command line? Mandrake Control Center does not like the new kernel and nothing works from there.
06-13-2003, 10:31 PM
Well guys, I dunno. Mandrake seems to be a pretty sick puppy. Easy to use... as long as you stick to their way.
One of these days soon I guess I'll have to download it and see just what the Hell is up with this. I can't believe it's that far gone that you can't even build a standard kernel anymore. Last version of Mandrake I had was 7.2
06-14-2003, 12:01 AM
Mike, I didn't think you needed it to use USB devices, but maybe you should try enabling hot plug support (under general setup) if you have a USB mouse. You might as well be able to hot plug them.
Disable all the PCMCIA shit that appears if you enable hot pluggable support though.
06-14-2003, 12:35 PM
Yus guys are making me feel good about my ability. :D
06-14-2003, 05:03 PM
"Yus guys are making me feel good about my ability."
HEHEHE! Join in and screw up with us!
Grogan: I bet it is just us somewhere missing something. And, it is probably something simple. I know it would be better if you could actually see what was going on, but I really appreciate your help!
In the meantime, I am gonna go get the latest from Red Hat and see about that distro. I had 7.3 once and I liked it fine. However, I hosed the system and one of the CD's went bad according to the media check. Then I went back to Mandrake.
But until I get another distro, I am going to keep plugging away with building a custom kernel through Mandrake. I need to learn what all these options mean and do anyway. Doing this is educational and fascinating, even when it is a failure. I still love this stuff!
06-15-2003, 01:26 AM
Originally posted by mlangdn
HEHEHE! Join in and screw up with us!
I've already used up my quota of Grogan. :)
I had my share of "blank screens" which was cause by trying to use framebuffer or vga=xxx. Don't have something set right in the kernel but I forget what that is right now. Haven't played with it since Mar.
I think I've rebuit and patched the kernel a couple of dozen times trying different things and fixing screwups. Still don't have it quite right, but I'm comfortable beating on it now.
Not sure where you guys are now but I have mouse and keyboard support built in.
Support for hot plugable devices built in.
Plug and Play built in.
Support for USB buit in.
Support for the IDE drives and some file system built in.
Have no fear, Grogan will talk you into Slackware before your finished. :)
06-15-2003, 08:54 AM
Last night, I built a kernel using the source from the Mandrake CD. I had even more options to choose from using this, and I still had problems with some unresolved symbols. I also forget to add extended fs support.
Slackware? I think I will give it a try. Linux is still Linux under the hood, but it may be what I need for learning purposes. Mandrake does have a lot of bells and whistles.
06-16-2003, 12:41 AM
Last night, I built a kernel using the source from the Mandrake CD.
What CD number is that in?
06-16-2003, 07:46 PM
In Mandrake 9.1, it is #3. After looking closer, the unresolved symbols were with some kind of 3rd party stuff. I will have to look at it closer to see what, if any 3rd party items I have installed. The only thing I have installed other than from Mandrake is Opera and a winmodem driver from Ltmodem.org.
06-23-2003, 06:30 PM
I am able to get almost all the kernel working except USB. My mouse still does not work. The kernel is 792kb and boots pretty fast. To startx, I change the XF86Config file from the nvidia driver to the nv driver - faster and easier. Until I figure out USB and what I am leaving out, I will continue to just change the driver instaed of reinstalling each time. If you can stand one more look at a config file and the USB section, I would appreciate your help.
During boot, modprobe says it cannot locate char major 10-135?
06-23-2003, 06:39 PM
Are you loading the USB mouse support module? I see you have it built as a module.
Type /sbin/lsmod and see.
You also have to make sure that the input core support module is loaded, as well as mousedev (mouse support under input core) Since you also said 'm' to those.
06-23-2003, 07:15 PM
Here is the output from lsmod:
Module Size Used by Tainted: P
ppp_deflate 3480 0 (autoclean)
zlib_deflate 18168 0 (autoclean) [ppp_deflate]
zlib_inflate 18628 0 (autoclean) [ppp_deflate]
bsd_comp 4312 0 (autoclean)
ppp_async 8064 1 (autoclean)
ppp_generic 18752 3 (autoclean) [ppp_deflate bsd_comp ppp_async]
slhc 5472 0 (autoclean) [ppp_generic]
lt_serial 21460 3 (autoclean)
lt_modem 472475 0 (autoclean) [lt_serial]
es1371 31848 1
ac97_codec 11912 0 [es1371]
usbmouse 2300 0 (unused)
keybdev 2080 0 (unused)
mousedev 4408 1
hid 19428 0 (unused)
input 3616 0 [usbmouse keybdev mousedev hid]
usb-ohci 19784 0 (unused)
sr_mod 15704 0 (autoclean)
floppy 50812 0
ntfs 54464 0 (autoclean)
ide-scsi 10448 0
scsi_mod 59124 2 [sr_mod ide-scsi]
And now the mouse is working on this boot! I do not have a clue as to what is happening. I still get a message about char-major - there is two.
The attachment is from /var/log/messages and it includes the shutdown and reboot into 2.4.21-rc7.
06-23-2003, 07:29 PM
OK, that's the kernel module loader loading those modules for you. It should work.
You may get bunch of this kind of stuff after compiling your own kernel on a complex distribution like Mandrake. It's possibly stuff you've got built in your kernel (e.g. parallel printer support is char-major-6) or not built at all.
Jun 23 13:40:21 localhost modprobe: modprobe: Can't locate module char-major-10-134
Jun 23 13:40:27 localhost modprobe: modprobe: Can't locate module char-major-6
Jun 23 13:40:28 localhost last message repeated 15 times
That's module aliases at work. It's not the real name of the modules. Those things there may not have been built as modules, or not at all. Check your /etc/modules.conf (or possibly named conf.modules on some silly systems) file to see what the hell that crap is supposed to be. It's possible to get rid of those error messages, but then it'll result in your original vendor kernel not working properly (because the modules can't load)
If everything is working, just ignore those messages.
06-23-2003, 09:22 PM
/etc/modules.conf only contains char-major-62. This is the autoload for the lt_serial module for my winmodem. There is no other reference to any other module or char-major number. I reckon I can ignore them (the messages).
I just found out that my numeric keypad does not work, in the old or new kernel. However, it does work in XP. The numlock key comes on at boot, so I don't know what the hell I did. Gotta be more careful and start takin' notes!
07-10-2003, 11:36 PM
Well I said I wasn't gonna do it, but the next Linux kernel is going to be pre-2.6 (getting closer) so I took the plunge. I'm using 2.5.75 now. I had to upgrade a few things before I started though... for example the kernel module system has changed and requires completely different module utilities... module-init-tools. (backwards compatible with 2.4 kernels though)
The build system and configuration screens have changed a bit. For example, there's no more make dep. All you really need to do is, configure your kernel with your choice of make menuconfig, make gconfig (gtk+ based config), or make xconfig (for a new qt based config) and then simply type make, which does make bzImage and make modules. It is of significance to note, that it still accepts all the old commands (make dep just warns you that it's no longer necessary). This means that people's build scripts won't fail :-)
It's considerably larger, (my kernel image is 811 kb) because I need to use the ACPI stuff this time around. In 2.4 I wasn't using it, because it was at least flushing and spinning down my drives at shutdown, requiring only a quick press of the off button to complete the task. But now with ACPI, it actually shuts down all the way like it should. At the cost of about 100 kb in kernel size though. Oh well, I should have been using it anyway on this system. Gotta get with the times... I'm resistant to change.
All my stuff seems to work... I'll run this for a few days and see. Memory management/caching seems to be working good, disk access A-OK, audio couldn't be better and display is good in both Radeon frame buffer console, and XFree86.
It seems completely usable for me now.
07-10-2003, 11:56 PM
bwaahaaha... I decided to check out the kernel configurators (I just stick to menuconfig myself)
Here's xconfig (qt based... the fancy decorations come from my KDE Liquid style)
And here's gconfig (gtk+ based)
07-11-2003, 12:19 AM
Cute GUI configurators, but somehow menuconfig seems like the way to go for me. It just gets easier to use everytime I compile a kernel.
Thanks for the peek at the 2.5.75 :)
07-11-2003, 03:38 AM
Thanks G. I haven't broken anything for awhile. Might have to poke at it again. :)
07-11-2003, 06:20 PM
When I built a kernel in Slackware, xconfig did not come up. Menuconfig worked fine. I still ain't worth a shit at kernel building, but I keep trying! Now you got me fixin' to do it again!
07-11-2003, 10:13 PM
Mike, you need to have the tk/tcl packages installed for the xconfig in the 2.4 kernel. Menuconfig is the best configurator anyway, it's best to get used to that. Much faster to fly through the configuration, and X is not necessary. It can be done at the command console, or in a remote terminal session.
07-13-2003, 11:36 PM
If I have installed the kernel source from the install CD, then wish to create a custom kernel, do I take out the CD package before I untar the downloaded source code? I never asked this question in the beginning of all this. I simply removed the source package and installed the kernel source and the patch in /usr/src, which then created /usr/src/linux. Can I simply create another directory in /usr/src - such as linux2?
07-14-2003, 12:28 AM
Yes, you could create another directory named linux2, and in fact you can compile your kernel anywhere. I just compile it as a user, in a directory I own (e.g. under home directory somewhere). It is not until it's time for make modules_install that you need to su to root.
On second thought, no, don't simply create another directory under /usr/src without renaming "linux" to something else. There may be some parts of the kernel build that could react adversely if /usr/src/linux points to another kernel tree (incorrect methods of including headers in some source files). I know it's happened to both Bobguy and myself (I had identical failures when I made that mistake). It really shouldn't happen, but it did.
Easiest thing to do is just compile it elsewhere, like in your home dir. There's no reason to use /usr/src/linux at all in your distribution. (kernel includes aren't symlinks in /usr/include that point to the kernel tree anymore... they are copies of the header files)
07-15-2003, 04:52 PM
I put the USB to PS/2 adapter on my USB mouse. It still thinks it is a USB mouse, even after a complete re-install. It's a Microsoft Optical - go figure. I can't seem to build a kernel and get this mouse right.
Big question - The System.map created during a build: everything I read says to place it in /boot. It then overwrites the one that is there. I made a copy before doing that and saved it in my home directory. After rebooting from a custom kernel to the original, a box comes up that says new hardware has been added. It then takes me to the USB wheel mouse checkbox, I click OK, and the mouse works in the original. Go back to the custom kernel, get the same box, and the mouse will not squeek!
I am gonna beat this thing! I am bigger than that damn mouse!
I am gonna download 2.6Test1 tonite. Nothing like a good battle.
Did I ask a question here somewhere?
07-15-2003, 05:01 PM
What I (and most people and distribution vendors) do with System.map is copy it as System.map-version and make a symbolic link to it.
for example, when in the top level kernel build tree (that's where System.map will be after a build)...
cp System.map /boot/System.map-2.4.21
ln -s System.map-2.4.21 System.map
Of course, rename your existing System.map before creating the symbolic link.
P.S. As for that detecting new hardware bullshit, you can disable kudzu at boot time, using the Mandrake Control Panel.
07-15-2003, 08:51 PM
I see the sym link in /boot for the original. Now it makes some more sense. It also makes sense to do away with hardware detection - I don't change hardware often.
07-15-2003, 09:08 PM
Mike, WARNING about 2.6.0-test1. You first must install module-init-tools (not modutils) for the kernel module system is new and incompatible with the old tools. (module-init-tools is backwards compatible though with 2.4 kernels) You will not be able to load any modules if you don't install module-init-tools.
When compiling a new kernel (well, a new series anyway) you must look in the file linux/Documentation/Changes to see what the current requirements are. There is a list, with corresponding commands to find out what version of the utilities are installed on your system.
Don't mess with this unless you're prepared :-)
07-15-2003, 09:22 PM
I keep good backups in case I get into more trouble than I can fix! I am an expert on re-installs, he he. A re-install sets me back about two hours counting the configuration and rebuilding the modem driver for my ltmodem. I found out the hard way in Mdk 9.1 about new version compatibility and the new compilers and such. I'm good at starting over - now if I can remember why I had to start over, I could get a little more ahead!
07-16-2003, 10:00 AM
I THINK I DID IT THIS TIME!
I have a working kernel that is 674 kb in size. I am online now and everything seems to be working - EVEN THE DAMNABLE MOUSE!
After a reinstall, I compiled again using the source from kernel.org 2.4.21.
Here are the exact steps I did:
make xconfig (config and lilo attached)
copied bzImage to /boot/vmlinuz-2.4.21-New
Renamed System.map to System.map1
copied System.map to /boot/System.map-2.4.21
ln -s System.map-2.4.21 System.map
Re-installed Nvidia driver
Rebuilt modem driver
So far - so good!
And this thing boots a lot faster now, even with X on automatic login. From the lilo screen, I can be running from console in less than 30 seconds. With X, about 60 seconds.
Now to study this thing to make sure that in the future I keep doing it right!
During boot, what is:
mount: Fs type supermount not supported by kernel.
This comes up 3 times, then says:
Wrong type or too many file systems (I may have that worded a little wrong).
07-16-2003, 10:25 AM
Great, Mike! Now, make sure you copy your .config file so you can use it next time. (with make oldconfig)
Note however that you cannot use that config for a 2.6.x kernel, in future. The config is too different and make oldconfig won't get it right. I recommend sticking with 2.4 kernels for a while yet anyway. 2.4.22 will be out soon :-)
07-16-2003, 04:10 PM
I might have spoke too soon.
My cdrom's won't play nice. I went to Mandrake Control Center to load an rpm from disk, and it did not automatically open the cdrom drawer. I put the disk in manually and it kept asking for the disk. I closed the app and clicked on the cdrom icon and Konqueror opened but showed no files without an error message. I went to a terminal and cd to /mnt/cdrom with ls and got Total O. The thing won't spin up with mount. However, the CDRW still functions in K3b, just won't read.
07-16-2003, 04:32 PM
ehhh, it's probably just that stupid supermount. Show me your /etc/fstab (attach it as a text file, don't just paste it). I'll fix you up for ease of manual mounting (trust me, it's much better for all the times you'll actually use a data cd in Linux anyway)
07-16-2003, 04:42 PM
Also, you do realize that you have hdd (secondary slave writer?) set to use ide-scsi by passing a command to the kernel in lilo.conf, right? I see you built the scsi drivers and ide-scsi as a module. This means you will have to load said module, in addition to scsi_mod, sg, sr_mod if you want to mount that device (as /dev/sr0 or /dev/scd0... either one will be fine)
You cannot mount that device as an IDE CD (even though you have that built right in your kernel), while passing the append="hdd=ide-scsi" parameter to the kernel, if that's the device you were trying to use.
If you have a hdc (secondary master) CDROM drive, you should be able to mount that one normally
07-16-2003, 04:57 PM
I use the writer only for writing. I use hdc for reading or copying from to the writer. In Mdk Control Center, the floppy has changed files from fd0 to floppy/0. hdc changed also but I can't remember to what, /dev/ide/host0/bus1/target0/lun0/cd I think.
ntfs is the same, can't mount
07-16-2003, 05:33 PM
Looks like you were using devfs before. You probably don't need to use that, but your /dev/ide/host0/bus1/target0/lun0/cd crap won't exist without devfs (has to be mounted, at that). To enable devfs in the kernel, you first must enable the "prompt for incomplete/experimental" option, under Code Maturity Level Options. You will then see /dev filesystem (experimental) under Filesystems. Either check the box to automatically mount it at boot, or add devfs=mount to the append="" statements in your lilo.conf section.
What I would do, is just fix up my fstab file and forget about devfs.
Make a copy of your old one. fstab.bak or whatever.
Take a look at this fstab file I'm attaching and note the lines I've changed, and the lines I've removed (let's just drop those devfs device entries from fstab for now)
You'll have to load filesystem modules as well in order to mount the devices. This means iso9660 for the CDROM drive, and ntfs for the windows filesystem. To mount the floppy disk, you're going to need msdos and vfat.
Complication: Because you built ntfs filesystem support as a module, the partition can't be mounted at boot time. (no module loaded). You probably should build support for hard disk filesystems right in the kernel, unless you just want to manually mount them like I do. The kernel module loader should take care of this (I see you enabled it) but...
Anyway, after making the changes to fstab, with the iso9660 filesystem module loaded, to mount the CD you just put a CD in the drive and type
With the ntfs module loaded, type
07-16-2003, 08:54 PM
Here is the output from lsmod immediately after boot. The module was loaded for ntfs and it looks pretty close to a stock lsmod.
I will do the other things you suggested.
07-16-2003, 09:24 PM
OK, the ntfs module is loaded. If the drive won't mount at boot, when you get up try manually mounting it and see what it says.
07-18-2003, 09:48 PM
To do a successful kernel build in Mandrake, it seems that one must use a Mandrake kernel source. If I can ever figure out the Mdk cooker site, I will try another. I seen so much shit there that I can't figure out what is what. I still have the Slackware distro that I had trouble with. I may give that another try when I get another box. An older machine will work fine for that. Something like a 500mhz or so should be cheap enough for my stretched budget. I spent $400 bucks on my truck this week - that would have been more than enough! Oh well, it's a '97 and hasn't given me any trouble yet. This week was for frontend parts and an alignment.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.