compiling a kernel incorrectly
I sure hope I can present this problem well enough for someone to be able to help me. I am a :newbie: and am (now depressingly) trying to compile one of the mdk linux 9.2 kernel sources so I orriginally update alsa for my SB Live!.
First. I have no idea why and now cannot even remember the exact turn of events. I only remember that I was attempting to compile 2.4.22-21 and it failed. Then I went to bed adn when I came back the next day my linux was suddenly missing browsers, my adsl internet connection was lost, many othe rKDE desktop functions were dead, and I lost the 0.9.6 version of alsa. I probably should have gone back to my cd's and did an update on mdk9.2 which is supposed to repair things, but my addiction to urpmi had me to an "easy urpmi" and when I did a mdk software install from the mdk control center I found a kernel source for 2.4.22-21mm.1mdk and decided to download and install it. The rpmdrake decided it was necessary to delete 2.4.22-21, I did not understand that but told it to go ahead. I then attempted to compile 2.4.22-21mm.1mdk, but it constantly gave me errors thus not completing the compile. I even tried to reinstall 2.4.22-21 to fix whatever was wrong and mdk just said there were conflicts so it could not install the kernel. :scratch: :scratch: Then I did some more research on the net to find instructions to guide me at doing a successful kernel compile. Everything I found was either oudated, or had very basic instructions to follow. All pretty much said the same as this; 1- download sources * install the kernel sources of your distro. they will install in /usr/src/linux-version-number. You can also download a .tar.bz2 file at http://www.kernel.org. Go to /usr/src/, and extract it with "tar jxf linux-2.4.22.tar.bz2" * create a symlink from /usr/src/linux-version-number to /usr/src/linux, for example: ls -s /usr/src/linux-2.4.22 /usr/src/linux 2- cd into /boot/ and look for a file called Config, that file contains all the options that were used to configure the currently running kernel. configure your kernel source with make xconfig, then click load from file, load the config file from /boot/ then make only the changes you need, (the alsa thing) (plus maybe a few other things, but unly if you are 100% sure what u are changing) now try compiling, it should go quite smooth. * open /usr/src/linux/Makefile in a text editor, and upgrade the revision number, for example "-my1". (or you might overwrite your existing kernel modules) compile it * type these commands: make dep make clean make bzImage make modules install it make modules_install cp /usr/src/linux/arch/i386/boot/bzImage /boot/linux-2.4.22-my1 cp /usr/src/linux/System.map /boot/System.map-2.4.22-my1 * create the links to System.map: cd /boot ln -s -f System.map-2.4.22-my1 System.map * You may need to remove System.map first: rm System.map * update your boot loader.. (I'll assume it's lilo here) edit /etc/lilo.conf, add another "image = /boot/linux-2.4.22-my1" line, etc.. * run lilo, and reboot. * backup your .config: cp /usr/src/linux/.config /boot/config-2.4.22-my1. * clean up compiler objects: cd /usr/src/linux make clean make mrproper Then I was successful at compiling the kernel, but lilo does not place it on the boot menu for a kernel choice. So when I rebooted I was not able to use the kernel I compiled. I repeated the complie, but it still will not appear. As such, I am also incapable of having ANY ALSA AT ALL even in the precompiled kernels. So I am TOTALLY LOST? Is there anyone out there who can help me....PLEASE?? :scratch: :scratch: :newbie: |
If it's not one the lilo boot screen and you are in fact using lilo then there could only be a couple of problems to deal with.
You failed to add the image to you lilo.conf, or you failed to run lilo after editing the file. |
This is what I did in lilo
First I tried this, because I have no idea what to say other than the image itself with the slightly changed name to protect the orrigial soure.
"image=/boot/linux-2.4.22-21mm.1mdk-my1" Then ran "lilo" which showed the image on the list. So I rebooted and I still only had the orriginal 2.4.22-21mm.1mdk. So then I tried repeating some of the info the rest of the images in lilo had by adding, "label=2422my1-21mm1 root=/dev/hda1 read-only optional vga=788" and ran "lilo" again, but still nothing. I am still confused, but know I must be missing something. What do you think? :scratch: :newbie: :scratch: |
Oh Yeah!!
I do notice that the rest of the images have a vmlinuz instead of a linux on th eimage line such as,
"image=/boot/vmlinuz-2.4.22-21mm.1mdk" but if I type vmlinuz instead of linux it still doesn't work. Is lilo supposed to creat the vmlinuz and if so how do I make it happen? :scratch: :newbie: :scratch: |
You need to make sure that the file you specify in lilo.conf is in fact the new kernel you compiled. So if you have the line:
"image=/boot/vmlinuz-2.4.22-21mm.1mdk" in lilo.conf, you need to check that you have the file /boot/vmlinuz-2.4.22-21mm.1mdk. If not, it should be as simple as doing this: "cp /usr/src/linux-version-number/arch/i386/boot/bzImage /boot/vmlinuz-2.4.22-21mm.1mdk" Which copies the new kernel (found in linuxsourcedir/arch/i386/boot/bzImage) to the correct location. Then run "lilo" If this fails then: Post the output of running "lilo" Then post the output of "ls /boot" And also: Quote:
I think this is because (someone please correct me if I'm wrong): Several programs will need to link against the libraries compiled with the header files of you original kernel and will need the original headers to compile correctly. So you need the original kernel source as /usr/src/linux if that's where it was before, and on most dists, that is where it is. I'm a bit unclear myself, but I know it's generally considered a bad thing to do. Hope this helps Guy |
If lilo showed the images listed and did not show an error I can only guess now that you installed it somewhere other than the mbr of the boot disk and the old one on the mbr is unchanged.
show us your lilo.conf file |
More than the lilo if space permits!
Now I am really freaked out! I have been doing that damn;
________________________________________________________________________________ * create a symlink from /usr/src/linux-version-number to /usr/src/linux, for example: ls -s /usr/src/linux-2.4.22 /usr/src/linux ________________________________________________________________________________ For the last 8 attempts to complete the ALMOST STUPID compile. The first one worked, but only if I did nothing with the sound beyond activating the soundcore and assigning emu10k1 to SB Live! and doing absolutely nothing with ALSA.. Then I went to ALSA and downloaded the .0.9.8 driver/utils/libs/etc..(I read that the kernel had to be completely compiled beforfe installing the mods for ALSA. SO I went back in to Xconfig and took care of ALSA, including ALSA's emu10k1 for SB Live! Then the compile CRASHED or in simpler terms just did nothing but give me errors. Almost every time I got a different error. During the compile attempts I tried using the the symlink deal and also tried the following to complete the compile. ________________________________________________________________________________ cd into /boot/ and look for a file called Config, that file contains all the options that were used to configure the currently running kernel. configure your kernel source with make xconfig, then click load from file, load the config file from /boot/ then make only the changes you need, ________________________________________________________________________________ That was what I did along with the symlink deal for my first successful compile. IT HASN'T WORKED AT ALL SINCE and now i think I have destroyed or at least damaged three kernel sources, perhaps even a precompiled kernel because I am losing memory of which ones were which (they are not labeled as source anymore).:cry: :cry: Hell I am almost ready to try the new 2.6 kernel source, in fact, I may not have a choice unless I am willing to wipe out everything I have in my computer to start from scratch (THAT WOULD REALLY SUCK!!). i have no way to backj up anything yet, with only one hard drive, no tape drive, cdburner is not functioning as a burner either since the ALSA screw up, but does at least read things now so I can reinstall, but damn I hope someone can figure a way around this. Nevertheless, this is the result from my last TWO compile attempts ________________________________________________________________________________ mem.c: In function `read_zero_pagealigned': mem.c:424: error: too few arguments to function `zap_page_range' make[3]: *** [mem.o] Error 1 make[3]: Leaving directory `/usr/src/linux-2.4.22-21mdk/drivers/char' make[2]: *** [first_rule] Error 2 make[2]: Leaving directory `/usr/src/linux-2.4.22-21mdk/drivers/char' make[1]: *** [_subdir_char] Error 2 make[1]: Leaving directory `/usr/src/linux-2.4.22-21mdk/drivers' make: *** [_dir_drivers] Error 2 ________________________________________________________________________________ As such, I cannot for anything figure the problem. THE LILO IMAGE IS LARGE so I will place it in another thread. |
try this
cd /usr/src/linux make mrproper make oldconfig make menuconfig -- Make your config changes -- make dep clean bzImage modules modules_install install |
Here is my Lilo.config
map=/boot/map
install=menu default="linux" keytable=/boot/us.klt prompt nowarn timeout=100 message=/boot/message menu-scheme=wb:bw:wb:bw image=/boot/vmlinuz label="linux" root=/dev/hda1 initrd=/boot/initrd.img append="quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5 splash=silent" vga=788 read-only image=/boot/vmlinuz label="linux-nonfb" root=/dev/hda1 initrd=/boot/initrd.img append="quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5" read-only other=/dev/fd0 label="floppy" unsafe image=/boot/vmlinuz-2.4.21-0.25mdk label="2421-25" root=/dev/hda1 initrd=/boot/initrd-2.4.21-0.25mdk.img append="quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5 splash=silent" read-only image=/boot/vmlinuz-2.4.21-0.13mdk label="2421-13" root=/dev/hda1 initrd=/boot/initrd-2.4.21-0.13mdk.img append="quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5 splash=silent" read-only image=/boot/vmlinuz-2.4.21-0.25mdk label="old_2421-25" root=/dev/hda1 initrd=/boot/initrd-2.4.21-0.25mdk.img append="quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5" vga=788 read-only image=/boot/vmlinuz-2.4.21-0.25mdk label="old_linux" root=/dev/hda1 initrd=/boot/initrd-2.4.21-0.25mdk.img append="quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5" vga=788 read-only image=/boot/vmlinuz-2.4.21-0.25mdk label="old_linux-nonfb" root=/dev/hda1 initrd=/boot/initrd-2.4.21-0.25mdk.img append="devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5" read-only image=/boot/vmlinuz label="failsafe" root=/dev/hda1 initrd=/boot/initrd.img append="quiet devfs=nomount hdc=ide-scsi acpi=ht resume=/dev/hda5 failsafe" read-only image=/boot/vmlinuz-2.4.22-21mdk-i686-up-4GB label=2422i686up4G-21 root=/dev/hda1 read-only optional vga=788 append=" quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5 splash=silent" initrd=/boot/initrd-2.4.22-21mdk-i686-up-4GB.img image=/boot/vmlinuz-2.4.22-21mdk label=2422-21 root=/dev/hda1 read-only optional vga=788-i686-up-4GB.img append=" quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5 splash=silent" initrd=/boot/initrd-2.4.22-21mdk.img image=/boot/vmlinuz-2.4.22-21mm.1mdk label=2422-21mm1 root=/dev/hda1 read-only optional vga=788 append=" quiet devfs=mount hdc=ide-scsi acpi=ht resume=/dev/hda5 splash=silent" initrd=/boot/initrd-2.4.22-21mm.1mdk.img image=/boot/linux-2.4.22 label=2422 root=/dev/hda1 image=/boot/linux-2.4.22-21mm.1mdk-my1 label=2422my1-21mm1 root=/dev/hda1 read-only optional vga=788 Although it did not appear for at least 5 reboots, the image=/boot/linux-2.4.22 is the orriginal 2.4.22-21 (I changed the name to supposedly protect the 2.4.22-21, but don't know about that) that I was successful with from leaving out the ALSA. Since it would not allow me to use the ALSA, I attempted to load it into the config of the -21mm1 and thought it might work, but NOPE. I had even used the -i686-up-4GB kernel source and that didn't work either. I sure hope you guys can see what I cannot. :scratch: :scratch: :scratch: |
add this to the top of the file
boot=/dev/hda then run /sbin/lilo |
Still does not take care of compiling the into the kernel:
Although, none of the other images use boot=dev/hda, I will give it a try once I manage to recompile. At this time, the kernel will not allow me ot have alsa and is changing what I commpiled in my kernal at every crash. I have no idea where to go now. I KNOW WHERE TO TELL M computer and Linux where to go, but that doesn't solve my problem. I cannot very well do anything with Lilo until I get this thing to compile.with the alsa
Why won't it accept it?. |
It has absolutely nothing at all to do with compiling anything, where your kernel is, or what the image section contains. It has to do with installing lilo.
You could just as easily leave the file as is and run this /sbin/lilo -b /dev/hda However if you forget to use the -b switch your back where you are now. Installing lilo to the big bit bucket in the sky. Now you can actually install and test the kernel once you get it compiled. |
OK OK ...I am linux stupid, but trying real hard!
I am going to have to do another kernel compile and try one more time to get alsa installed, but I cannot even get past the basic soundcore . I am still getting the same errors;
mem.c: In function `read_zero_pagealigned': mem.c:424: error: too few arguments to function `zap_page_range' make[3]: *** [mem.o] Error 1 make[3]: Leaving directory `/usr/src/linux-2.4.22-21mdk/drivers/char' make[2]: *** [first_rule] Error 2 make[2]: Leaving directory `/usr/src/linux-2.4.22-21mdk/drivers/char' make[1]: *** [_subdir_char] Error 2 make[1]: Leaving directory `/usr/src/linux-2.4.22-21mdk/drivers' make: *** [_dir_drivers] Error 2 So let me ask these questions. 1. How do I clean out all the garbage so I can perhaps shrink that boot directory and most certainly take away the bad kernels in lilo without making things worse?? 2. If I can do that or if it isn't really necessary, although I don't understand how I can keep using those kernels when the compile keeps saying that they are writing over other info or not able to install due to exiisting info and may be part of the whole problem, do I need to completely turn off my sound system while I am compiling?? 3. I think I have mentioned what my distro is, but just in case it is mdk 9.2 and while I have seen a lot of references to Slackware, debian, and Red Hat kernel installs Even though they are usually at least three years old, I am not able to find the same for Mdk 9.2. So I am most likely also using the wrong info. What do you think?? 4. I found the following kernel info for a slackware distro and it is supposed to be less than a year old. The directions actually seem to make pretty good sense even for mdk, but I do not want to keep screwing things up (at least not blatantly). So CAn you guys tell me if it will work for mdk?? ________________________________________________________________________ First, we need to edit lilo.conf. Pick your favorite editor...one that is easy for newbies (and I still use this from time to time) is pico. pico /etc/lilo.conf Add this to your config...you can just copy what is there and add the .old stuff. image = /boot/vmlinuz.old root = /dev/hda1 label = slack.old read-only Note: Replace /dev/hda1 with the correct location of your root partition. Now we need to edit the Makefile to make sure your new kernel is copied to the appropriate directory. If you are using 8.1 or later, open /usr/src/linux/Makefile in a text editor, scroll to line 74 and uncomment the the line #export INSTALL_PATH=/boot. For 8.0 you must leave this line commented. So...cd /usr/src/linux pico Makefile scroll to line 74 and uncomment the the line #export INSTALL_PATH=/boot. For 8.0 you must leave this line commented. Now for the fun make menuconfig (make your changes here...when done, save your new configuration) make dep (sets all the kernel dependencies) make clean (removes un-needed files) make bzImage (builds the kernel) make make install (installs, moves and renames all the needed files and updates lilo) make modules (builds all the kernel modules) make modules_install (installs the modules) Note: The 'make install' command is the one that most don't use but it works fine in slackware as long as you have prepared lilo.conf and edited Makefile according to the instructions above. Now you can reboot using your new kernel!!! _____________________________________________________________________ Of course, I do not use pico but I have other editors. |
Your kernel should compile if you do this
make distclean make mrproper make oldconfig make menuconfig --- configure your changes --- make dep make clean make bzImage make modules make modules_install make install |
??????????
Ok David, sounds good, BUT I have some further Strange info. OF COURSE, NO ONE IS SAYIG ANYTHING ABOUT MY ALSA ISSUES!
Now the info! I have oddly enough (only because I am learning these things by experimentaton) pieced together an almost exactly same set of compile steps. However, In using them I LOST the rest of my sound (oss and the emu10k1 driver). I tried everthing to find it and decided to try an update/repair installation of my mdk9.2. Here is where things become a bit more interesting! After it was done, ALL OF MY SUCCESSFULLY COMPILED KERNEL SOURCES WERE IN THE BOOT MENU AS I NAMED THEM????). So, at that point, I am thinking I might also have my (oss and emu10k1) sound back, but NOPE!! So I then urpmi for updates and such to find the alsa/oss/emu10k1 rpm's that mdk had supplied for 9.2. I found the alsa rpm's but did not find emu10k1 and I asume it is because it is still somewhere in my computer, but even a file search cannot find it (?????). None of that last part makes sense to me, but I am guessing it is some how embedded into another part of my system that is still lost (as the successful compiles were lost until I did the hard update/repair/instal). SUSPICIAN!! I am certainly ot a linux programmer and such, but I am beginning to come to the conclusion that (PERHAPS) for some of the same reasons that we still have to do an "update-menus -v" whenever we install new rpm's we have to someone ALERT the system that we made ANY changes even to the kernel itself, because the system is not recognizing anything. Hell, it is still quite confused about most of the urpmi downloads before it allows them to install and often does not allow it to happen!! BUT, what the heck do I do?? Ok, I am finally in one of MY KERNELS, but I still cannot get the damn sound back. I have been on my computer since 5 am Thursday and it is NOW 3 AM FRIDAY, this time going one step at a time (researching EVERY STEP as best I could) and just 5 minutes ago managed to complete the xconfig adjustment. I have not done the make dep, etc..., becase I thought I would copy what I had doen in SOUND to see if it make sense to you first. Then if it fails again, you may have a better idea of my problem. OH WELL; NO COPY! However, I put a "y" on Sound Card Support, nothing else recieved anything other than a "n" until I got to "Creative SB Live! (emu10k1) where I gave another "y" and did the same for "Creative SB Live! Midi and OSS Sound Modules. However, I read that ALL SB cards use YAMAHA FM synth and such. I assume that is why the system immediately tries to activate 5 Yamaha options. I have not so far been able to determine if those have had a negative effect ot not, but to be safe I moduled them (although the Yamaha PCI Legacy port had to be given a "y"). I would especially be interested in some feedback on that part as well. Anyway, I am given an option to config ALSA, but I am constantly NOW finding info from everywhere including the ALSA web page and it's own install that I MUST NOT DO ANYTHING WITH IT until I have successfully compiled and entire kernel, which ALSA is part of (so that is confusing). Hope you can help me with that confusion! Finally, in the ALSA config, if I really should do nothing to it, does that mean I make sure everything is turned off in there, or do I leave it the way the system has automatically set it up? The system automatically MODULED EVERYTHING in ALSA except it activated the OSS API Emulation and the OSS Sequencer API along with activating the SB 16 part of the ISA Devices. Of course, I feel that I must deactivate the ISA part since I have absolutely no ISA. What do you think?? I am not dong the rest of the compile until I here from you. :scratch: :newbie: :scratch: :Pengy: OOOOPS!! last question. How do I comment or uncomment info in a config or makefile? Sorry about that. |
All times are GMT -5. The time now is 06:25 PM. |