Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 11-27-2003, 04:58 PM   #1
Registered: Nov 2003
Posts: 40

Rep: Reputation: 15
Help! I messed up my system with a kernel compile

I dont know why, but every time I try to make a new kernel I end up
needing to reinstall slack. My third time trying to compile my own kernel was the best shot so far but I some problems with the system now.

Well, I would rather fix my problems this time without reinstalling, so if someone is sympathetic maybe you can give me a hand..

Here is what I did... (this is all from memory and might be a bit fuzzy)

(1)I moved to /usr/src/linux

(2)I typed mrproper


Now when I got here, I was given the menu of options to select for the new kernel. At this screen several things were already selected so I assume I was looking at the current kernel. I didnt change much really. I removed RAID and PCMIA (however you spell it, <the laptop stuff>), adding some modules for language support, changed the cpu to a pent 4 (which is what I have).... etc.. etc..
Since I didnt remove too much I assumed that everything should still work nice and peachy.

I saved the config.
(4)make dep
(5)make bzImage
(6)make clean
(7)make modules
(8)make modules_install

(9) mv /boot/vmlinuz /boot/vmlinuz.old
(10) mv /boot/ /boot/
(11) cat /arch/i386/boot/bzImage > /boot/vmlinuz
(12) cp /boot/

(13) added another boot entry in /etc/lilo.conf to also boot linux.old

Ok, then I rebooted and came to the boot option, for either linux or linux.old.
I selected linux.

It was faster, lots of the weird module errors I was getting were gone now. I arrived at the boot prompt, full of confidence and beaming with happiness as I just installed my first working kernel. When I got in, X wouldnt work. I tried to reinstall the Nvidia driver. It told me that the kernel changed and the sources were different, I needed to install the sources it said. My sources are installed.. hmm. Ok... I ran the installer and uninstalled the driver. Then tried to install it again. Same deal. Ok... Ill deal with it later I thought.

I typed adsl-start.

Hmm, I typed adsl-connect.
I received a message that there there was no signal from PAPO or something like that... not even sure what that means. The computer never flashes the modem box so I know its not even getting to the modem.
I dont know why it cant find it now, when it could before. What do I need to put in the kernel to get adsl working?

I figure ok, Ill just recompile the kernel again, but first I'll boot into linux.old.
After coming to the prompt in linux.old, X wouldnt work, the Nvidia drivers gave me the same warnings, and adsl-start was timing out again. adsl-connect said the same thing as the other kernel did.

I paniced. I deleted /boot/vmlinux, and and restord the old files.
I erased the extra boot entry in /etc/lilo.conf and /sbin/lilo'ed.

Since then I have tried to recompile two more kernels, all with the same problems. Im not sure what Im doing wrong, so if someone can pass over some advice, I would be greaty appreciative.
Old 11-27-2003, 05:17 PM   #2
Senior Member
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 47
okay, first did you remember to run # /sbin/lilo after you changed the lilo.conf file? it kind of sounds like it's still booting the old lilo, which would be pointing to the new kernel image (or whatever it's called -- vmlinuz) that you put in /boot.

second, what exactly is your status now? are you able to get into your system? what i did the first time i tanked my kernel was use the config of the bare.i kernel from the slack CD to compile one from there. once that was up and running smoothly, i took it from there and eventually got a good working kernel.

those nvidia drivers suck. IIRC (if i remember correctly), after uninstalling the old ones, you actually have to re-untar the original package again (delete the old directory) before doing the compile. weird, but it was the only way it seemed to work.
Old 11-27-2003, 05:53 PM   #3
Registered: Jan 2003
Location: USA
Distribution: Slackware
Posts: 498

Rep: Reputation: 30
First, when you ran make mrproper, you essentially restored the kernel to its pure current config was gone.

Refer to this thread for the correct way to compile...

The you'll likely need to re-install your Nvidia drivers.
Old 11-27-2003, 06:20 PM   #4
Registered: Nov 2003
Posts: 40

Original Poster
Rep: Reputation: 15
My current status is this..

I can get into my system, using the original kernel that I selected at install time from the CD, it was the first one on the list that supported RAID.

I did run /sbin/lilo

i cannot get into x, nor can I get adsl-start to connect to the net, where it could connect before.

Im not really too worried about Nvidia drivers, I will delete the files are re-untar it. Im sure I can manage that, but Im mostly worried about adsl-start not working. I dont know why it wouldnt work now, after I reverted to the old kernel, but it doesnt. I re-ran adsl-setup but still nada.

also, Im curious abuot what to add to a kernel to get adsl-working in the first place. I added everything on the ppp list, I even tried a config with everything added on the isdn list as well. I wonder if its not the kernel config but some other config that went sour?

any more ideas?

DaOne, I read your compile guilde, but I went with the official slackware version on that compile. At that time I really didnt know what mrproper was, and thought it would be better to use it as the "book" recommended. Next time Ill be more mindful though.
Old 11-28-2003, 01:17 AM   #5
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Probably the best way to approach compiling a custom kernel if you're having problems is to copy the default Slackware kernel config into the source tree and use it as a base. Then just spend some time going through all the options, disabling the ones that you "know" you don't need or want. This way it's harder for you to miss something that is crucial to your system. Also if you want to use the "make mrproper" command, then do so prior to copying the config into the source tree, since as noted above, that command will remove it and a default .config will be created when you run xconfig, which is likely to not include something you need. Anyway, unless you removed it, you should be able to grab a copy of the config Slackware installed from /boot. If not, then you can grab it off the CDROMs. The procedure would go something like this:
  • cd /usr/src/linux
  • make mrproper # if you want
  • mv .config .config-old # if present
  • cp /boot/config-ide-2.4.22 .config # May not be config-ide-2.4.22 on your system
  • make xconfig # or menuconfig or etc
  • make dep
  • make clean
  • make bzImage
  • make
  • make modules
  • make modules_install

Now go into your /boot directory and figure out what is what. I'm not sure exactly what you did, so hard to say on this. However, it is likely that the Slackware installed kernel is the bigger of the 2. If you're not sure what is what, then it would probably be best to just leave things as they are and simply call your new kernel something else and set it up like so:
  • cp /usr/src/linux/
  • cp /usr/src/linux/arch/i386/boot/bzImage vmlinuz-cs
  • cp /usr/src/linux/.config config-cs # Not required, but nice to have when you need it

Then add a entry to lilo.conf for your new kernel, leaving the other entries in place (unless you figured out which one was which). Then run lilo from the command line and reboot your system. Check your /var/syslog & /var/messages for any errors that might be there. Sometimes fixing those will require you to go back in and recompile the kernel, sometimes not. Once your happy with your new kernel and have ran it for a few days, if you want to go back and clean up /boot, then all you need to do is edit lilo.conf, make whatever changes you want in /boot, and rerun lilo. Although, it's not a bad idea to keep the default Slackware kernel around. That way if you run into a problem down the road, you have a couple different kernels to test with.

Also, gcc-3.x.x is known to mis-compile some stuff when you compile the kernel as i686, which using Pentium 4 would do. I never did get scsi emulation to work right when doing that. So if something is broke that you can't figure out, and you really want the kernel optimized for a P4, then you can try installing gcc-2.95.3 off to the side (the kernel team still recommends against using gcc-3.x.x for compiling a kernel) and compiling the kernel with it vs the one Slackware installed. You can reference the Linux From Scratch guide for doing this. And yeah, anytime you recompile a kernel, you'll also need to recompile/install the nvidia drivers.
Old 11-28-2003, 01:29 AM   #6
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
About the adsl thing, I'm not sure on that. But if I had to guess, my guess would be a module you missed in the kernel that got removed when you recompiled the kernel. Use the original Slackware kernel config as described above and I would bet your problem with that will be solved. Also, check the logs, you may can find the problem there.

BTW, Rule #1 for Linux: Don't Panic!!!!
Rule #2: Don't reinstall!!! Work it out.

Reinstalling is what windows users do.. No disrespect meant... You'll come out feeling a whole lot better if you'll stick too the problem and work it out vs resorting to reinstalling. And as a bonus you'll learn alot more. If need be, grab an old PC out of the closet and install linux on it. Use that system to test stuff like this on.
Old 11-28-2003, 04:47 PM   #7
Registered: Nov 2003
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks guys,

You adviced helped a lot. Im getting things sorted out now.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile kernel: iaMMai Linux - Newbie 9 05-19-2005 08:05 AM
Need to compile a Linux kernel so that it can use the FATX file system... Nebetsu Linux - Software 9 04-18-2005 11:10 AM
Slow System After 2.6 Kernel Compile/Install isoFlux Slackware 3 04-12-2005 03:41 PM
I want to compile 2.6 kernel and keep everything from 2.4 intact (dual kernel system) sina_kish Linux - Software 7 02-02-2005 09:01 AM
Kernel compile error/system hangs, APIC/ACPI taids Linux - Hardware 14 08-23-2003 06:11 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration