LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-18-2007, 10:50 PM   #1
mirror_man
Member
 
Registered: Jan 2007
Distribution: Debian squeeze
Posts: 34

Rep: Reputation: 15
Can't boot into OS after kernel compile and install


Hi,

I've just done a kernel (2.6.20.3) compile and install using the guide at www.kroah.com/lkn/. Now I can't boot into my OS. This is my first attempt at doing this.

The guide says that I might have a package called mkinitrd which I understand loads the modules at boot. It also has an install script in it called installkernel. I checked lilo.conf and there is no entry in there to load initrd so I wonder how the modules were being loaded before? Anyway, everything was working alright so I thought things would be ok without it. So, I decided to try:

Code:
make moules_install
make install
Looking back, I think I should only have done this if the installkernel script was present

Here's the output from the first command:

Code:
 make modules_install
  INSTALL arch/i386/crypto/aes-i586.ko
  INSTALL crypto/aes.ko
  INSTALL crypto/arc4.ko
  INSTALL crypto/blkcipher.ko
  INSTALL crypto/cbc.ko
  INSTALL crypto/crypto_algapi.ko
  INSTALL crypto/cryptomgr.ko
  INSTALL crypto/ecb.ko
  INSTALL crypto/md5.ko
  INSTALL crypto/sha1.ko
  INSTALL crypto/sha256.ko
  INSTALL crypto/tgr192.ko
  INSTALL drivers/char/agp/nvidia-agp.ko
  INSTALL drivers/char/agp/via-agp.ko
  INSTALL drivers/crypto/geode-aes.ko
  INSTALL drivers/crypto/padlock-aes.ko
  INSTALL drivers/crypto/padlock-sha.ko
  INSTALL drivers/crypto/padlock.ko
  INSTALL drivers/hwmon/hwmon.ko
  INSTALL drivers/hwmon/k8temp.ko
  INSTALL drivers/input/misc/pcspkr.ko
  INSTALL drivers/media/video/compat_ioctl32.ko
  INSTALL drivers/media/video/dabusb.ko
  INSTALL drivers/media/video/v4l1-compat.ko
  INSTALL drivers/media/video/v4l2-common.ko
  INSTALL drivers/media/video/videodev.ko
  INSTALL drivers/mmc/mmc_block.ko
  INSTALL drivers/mmc/mmc_core.ko
  INSTALL drivers/net/natsemi.ko
  INSTALL drivers/net/wireless/hermes.ko
  INSTALL drivers/net/wireless/hostap/hostap.ko
  INSTALL drivers/net/wireless/orinoco.ko
  INSTALL drivers/net/wireless/orinoco_pci.ko
  INSTALL drivers/net/wireless/zd1201.ko
  INSTALL drivers/usb/net/asix.ko
  INSTALL drivers/usb/net/cdc_ether.ko
  INSTALL drivers/usb/net/net1080.ko
  INSTALL drivers/usb/net/usbnet.ko
  INSTALL drivers/usb/net/zaurus.ko
  INSTALL drivers/usb/storage/usb-storage.ko
  INSTALL fs/ntfs/ntfs.ko
  INSTALL net/ieee80211/ieee80211.ko
  INSTALL net/ieee80211/ieee80211_crypt.ko
  INSTALL net/ieee80211/ieee80211_crypt_wep.ko
  INSTALL sound/ac97_bus.ko
  INSTALL sound/core/oss/snd-mixer-oss.ko
  INSTALL sound/core/oss/snd-pcm-oss.ko
  INSTALL sound/core/seq/oss/snd-seq-oss.ko
  INSTALL sound/core/seq/snd-seq-device.ko
  INSTALL sound/core/seq/snd-seq-dummy.ko
  INSTALL sound/core/seq/snd-seq-midi-event.ko
  INSTALL sound/core/seq/snd-seq-midi.ko
  INSTALL sound/core/seq/snd-seq.ko
  INSTALL sound/core/snd-page-alloc.ko
  INSTALL sound/core/snd-pcm.ko
  INSTALL sound/core/snd-rawmidi.ko
  INSTALL sound/core/snd-rtctimer.ko
  INSTALL sound/core/snd-timer.ko
  INSTALL sound/core/snd.ko
  INSTALL sound/drivers/mpu401/snd-mpu401-uart.ko
  INSTALL sound/oss/ac97_codec.ko
  INSTALL sound/oss/es1371.ko
  INSTALL sound/oss/sound.ko
  INSTALL sound/oss/uart401.ko
  INSTALL sound/oss/via82cxxx_audio.ko
  INSTALL sound/pci/ac97/snd-ac97-codec.ko
  INSTALL sound/pci/snd-ens1371.ko
  INSTALL sound/pci/snd-via82xx.ko
if [ -r System.map -a -x /sbin/depmod ]; then /sbin/depmod -ae -F System.map  2.6.20.3; fi
And from the second:

Code:
make install
sh /home/cue/linux/linux-2.6.20.3/arch/i386/boot/install.sh 2.6.20.3 arch/i386/boot/bzImage System.map "/boot"
Added Linux *
It says in the guide:

Quote:
2. The build system will install the static kernel portion into the /boot directory and name this executable file based on the kernel version of the built kernel.
Well it didn't do that, it just made a backup file of the original, vmlinuz.old and put the new one in it's place.

I looked in lilo.conf and the entry was just vmlinuz so I went ahead and rebooted.

When I boot the machine, I see the Lilo screen with the boot prompt and flashing curser, I hit Enter and see the message "Loading Linux", then "BIOS data check succesful". Then there's just a black screen and the hard drive light on the case stays lit up. That's as far as it gets.

Using Knoppix i've gone in and renamed vmlinuz to vmlinuz.2.6.20 and vmlinuz.old back to vmlinuz. I also renamed system.map to system.map.2.6.20 and system.old back to system.map. I thought dong that might let me boot to the old kernel (2.6.17.13) but it hasn't worked.

The day before doing the kernel build I had disabled "Update all the shared library links" and "fc-cache" in /etc/rc.d/rc.M and added lines in /etc/rc.d/rc.local to make them run a few minutes after boot. I forgot to reinstate it but have done so now.

Any pointers to how I've messed up and how to put it right will be gratefully received
 
Old 03-18-2007, 11:02 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 58
i too recently compiled my (first) kernel (2.6.20.2), on slackware 11.
one important step i did was to copy the default .config file that was installed into the folder where i extracted the new kernel source code i had just downloaded. then when i used 'make menuconfig' i loaded the .config file that was in that folder (default one that i copied).

does the hard drive light _stay_ on? or does it flash every now and then? for me, my first compile didnt work. after selecting my linux option from LILO and displaying the messages you receive as well, it would also sit at a black screen. however, the harddrive light was still flashing. It turns out everything was working fine with my new kernel, except that i hadnt compiled into it support for a certain console video driver.

regarding what you did to /etc/rc.d/rc.M, i did the same thing and there seems to be no negative side effect so that shouldnt be a problem.

when I screwed up compiling, the many times i did, i used the slackware 11 install disc #1 to boot up. after the cd loads, use mkdir to create a mount point for where your slackware system is installed, then use 'chroot <mntFolder>' to 'use' your previously unreachable slackware system. from here you can now go back to your new kernel source folder and run make menuconfig again to make sure you have all options you should. i imagine this is where your problem is--your missing some support that is required.

after tweaking the config, continue as you did initially compiling/installing the kernel and lilo.

hope this helps
 
Old 03-18-2007, 11:27 PM   #3
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
You should ALWAYS keep a good kernel to boot in case the compiled one fails. So, there should always be at least 2 boot options in lilo ... a good and a new (testing).

What to do now ? You have to add the old kernel back in to lilo.conf then run '/sbin/lilo'. Maybe use the slack install CD ...
 
Old 03-18-2007, 11:48 PM   #4
mirror_man
Member
 
Registered: Jan 2007
Distribution: Debian squeeze
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nadroj
i too recently compiled my (first) kernel (2.6.20.2), on slackware 11.
one important step i did was to copy the default .config file that was installed into the folder where i extracted the new kernel source code i had just downloaded. then when i used 'make menuconfig' i loaded the .config file that was in that folder (default one that i copied).
I used the one from the running kernel session as per the instructions in the guide:

Code:
$ cp /proc/config.gz ~/linux/
$ cd ~/linux
$ gzip -dv config.gz
config.gz:       74.9% -- replaced with config
Then I copied it into the kernel sourse folder and modified it using xconfig.

Quote:
does the hard drive light _stay_ on? or does it flash every now and then? for me, my first compile didnt work. after selecting my linux option from LILO and displaying the messages you receive as well, it would also sit at a black screen. however, the harddrive light was still flashing. It turns out everything was working fine with my new kernel, except that i hadnt compiled into it support for a certain console video driver.
It stays on for a while and then goes out, no flashing. I checked the HD and couldn't detect any activity. Also checked xorg.conf and everything is alright there.

Quote:
regarding what you did to /etc/rc.d/rc.M, i did the same thing and there seems to be no negative side effect so that shouldnt be a problem.
OK, thanks.

Quote:
when I screwed up compiling, the many times i did, i used the slackware 11 install disc #1 to boot up. after the cd loads, use mkdir to create a mount point for where your slackware system is installed, then use 'chroot <mntFolder>' to 'use' your previously unreachable slackware system. from here you can now go back to your new kernel source folder and run make menuconfig again to make sure you have all options you should. i imagine this is where your problem is--your missing some support that is required.
I don't think I disabled anything to do with console video drivers, it was more a case of enabling some options I thought looked interesting. I'll give that a go though and check through the config again to be sure.

Quote:
after tweaking the config, continue as you did initially compiling/installing the kernel and lilo.
Should I repeat the modules install too? Also, I didn't do anything to Lilo as it looked ok as it was.

Quote:
hope this helps
Thank you, I'll check the config and try again.
 
Old 03-19-2007, 12:02 AM   #5
mirror_man
Member
 
Registered: Jan 2007
Distribution: Debian squeeze
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by H_TeXMeX_H
You should ALWAYS keep a good kernel to boot in case the compiled one fails. So, there should always be at least 2 boot options in lilo ... a good and a new (testing).

What to do now ? You have to add the old kernel back in to lilo.conf then run '/sbin/lilo'. Maybe use the slack install CD ...
The new one was called vmlinuz the same as the old one so I didn't know if either would be recognised if I named them something other than that. Would it work so long as the kernel name is the same as the name in lilo.conf?

I have though, renamed the kernels and tried to use the original one:

The new one I named vmlinuz.2.6.20 and the original one (which had been renamed vmlinuz.old), vmlinuz, as it was to start with. The lilo.conf entry is vmlinuz but the OS won't boot. I also renamed the system.map so as to use the original.
 
Old 03-19-2007, 02:58 AM   #6
mirror_man
Member
 
Registered: Jan 2007
Distribution: Debian squeeze
Posts: 34

Original Poster
Rep: Reputation: 15
Got it. I used the install disk and booted into my system from there, then did /sbin/lilo and rebooted into the HD. This time the OS booted. I renamed the new vmlinuz to vmlinuz.2.6.20.3 and made an entry for it in lilo.conf. Rebooted again and choose the new kernel, it booted ok this time but I have no display, neither TUI nor GUI. Now I just need to find the error in the kernel config.

So, all that was preventing either kernel from booting was that I hadn't restarted Lilo.

Thanks guys!
 
Old 03-19-2007, 10:26 AM   #7
Muraii
Member
 
Registered: May 2006
Posts: 62

Rep: Reputation: 15
Similar, but substantially different result

Hi,

I'm piggybacking on your thread to avoid yet another independent kernel compiling thread. Just last night, I compiled a new 2.4 kernel to try and eek out a little more performance from my PIII system. I'm not precisely sure how different it is from the original kernel I was using; I backed up the original .config file but I couldn't find it after my episode began.

Using menuconfig, I spent some time learning all the options, and selected the fewest I felt I needed to operate stably. I compiled, following the suggested method in the Slackbook. There were no errors or issues during the compilation. I followed the suggested method of moving the kernel image into the proper place, per the guide referenced above:

Code:
# mv /boot/vmlinuz /boot/vmlinuz.old
# cat arch/i386/boot/bzImage > /vmlinuz
# mv /boot/System.map /boot/System.map.old
# cp System.map /boot/System.map
# make modules_install
I actually changed this, as upon initially running /sbin/lilo, the new kernel image couldn't be found. I moved it instead to /boot/vmlinuz rather than /vmlinuz.

Upon booting, I received a kernel panic at the point that my harddrive is being mounted with ReiserFS. I compiled that into the kernel, I'm nearly certain (the only cause for uncertainty being the error; I remember deliberating on it and selecting it to be supported within the kernel). I tried using the install disc to reset things, but didn't think about using chroot.

I read the LILO FAQ, and found that I could use ALT + SHIFT to choose a kernel at boot, and I chose my original kernel. This loaded fine, except none of my modules loaded. I have been running this kernel and its modules for nearly a year with no issue. I reverted my lilo.conf to its original state, ran /sbin/lilo again. Still no modules.

Is this a product of having run
Code:
# make modules_install
or something? I have the System.map that corresponds to my original kernel placed where it has been all these months. When during boot the kernel says it can't find the modules, is it System.map that it uses as a reference? Even issuing, e.g.,

Code:
# modprobe radeon
returns an error that the module can't be found. It still exists, per $ locate radeon, so I'm not quite sure what to think.

Thanks for your time.

Daniel
 
Old 03-19-2007, 01:07 PM   #8
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 58
Quote:
Originally Posted by mirror_man
Also checked xorg.conf and everything is alright there.
the Xorg drivers are for your GUI, different from your bootup console interface. look around for VESA console drivers, framebuffer.. i dont know exactly what its called. later tonight i can try and find it if you cant get it. the thing to do is to look at every relevant option.

Muraii, im new at compiling a kernel so im no expert.
could you give us the _exact_ error message you recieve when trying to boot your new kernel? i believe you said it, but, again, to reenforce, you have to have support for your root filesystem and boot device built in (*).

regarding the System.map ive come to find that it is not required. at least it is not for me.. after compiling my new kernel i deleted all source code and modules of the old kernel.

about the 'make modules_install' i dont really know. maybe the modules for your old kernel were overwritten by this command with your new kernel? just a guess.

again, it seems you may know already but, when you make any serious changes to your /boot/ folder, make sure to edit /etc/lilo.conf and run lilo again to reinstall it.

ill check back later tonight.. hope it helps a little.

Last edited by nadroj; 03-19-2007 at 01:08 PM.
 
Old 03-19-2007, 03:35 PM   #9
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Quote:
Originally Posted by Muraii
I read the LILO FAQ, and found that I could use ALT + SHIFT to choose a kernel at boot, and I chose my original kernel. This loaded fine, except none of my modules loaded. I have been running this kernel and its modules for nearly a year with no issue. I reverted my lilo.conf to its original state, ran /sbin/lilo again. Still no modules.
That happens probably because you compiled for a different architecture, but same kernel version. That means the modules were compiled say for a pentium4, but cannot be loaded into a kernel compiled for i686. You have to install or use the original kernel modules. To circumvent the problem, you might wanna change the name of the kernel ... you know it can be 2.6.17.13-smp ... maybe you could do 2.6.17.13-new ?
 
Old 03-19-2007, 03:44 PM   #10
Muraii
Member
 
Registered: May 2006
Posts: 62

Rep: Reputation: 15
Quote:
Originally Posted by nadroj
Muraii, im new at compiling a kernel so im no expert.
could you give us the _exact_ error message you recieve when trying to boot your new kernel? i believe you said it, but, again, to reenforce, you have to have support for your root filesystem and boot device built in (*).
I'll work on that tonight; but unless I get it working, I won't be able to post about it since I don't have any modules, including no eth0 driver.

Quote:
Originally Posted by nadroj
maybe the modules for your old kernel were overwritten by this command with your new kernel? just a guess.
I thought the same thing, but I can't imagine that the kernel compilation method would be as old as it is and there be no warning in any documentation to back up your modules.

Quote:
Originally Posted by nadroj
again, it seems you may know already but, when you make any serious changes to your /boot/ folder, make sure to edit /etc/lilo.conf and run lilo again to reinstall it.
I appreciate the reminder. I'm almost certain I did this, but I'll make sure. My primary concern is that, upon reverting to a known working kernel, none of my modules can be found by the kernel or modprobe. I'm not quite sure what to think about that yet. I suspect I have fudged a path reference somewhere.

Thanks. I'll keep looking, too.
 
Old 03-19-2007, 04:20 PM   #11
Muraii
Member
 
Registered: May 2006
Posts: 62

Rep: Reputation: 15
Quote:
Originally Posted by H_TeXMeX_H
That happens probably because you compiled for a different architecture, but same kernel version. That means the modules were compiled say for a pentium4, but cannot be loaded into a kernel compiled for i686. You have to install or use the original kernel modules. To circumvent the problem, you might wanna change the name of the kernel ... you know it can be 2.6.17.13-smp ... maybe you could do 2.6.17.13-new ?
I suppose that might be the case. I did compile the new kernel specifically for a PIII, and I'm not sure what the original stock kernel (the typical slackware 10.2 base kernel from the install disk) was compiled for specifically. However, that doesn't explain the more mysterious part of this: when I revert LILO back to my original kernel setup, I still can't load modules. It says it can't find them. Maybe the old module paths were renamed and I have to change the names back. Otherwise, I don't understand, as, again, they're the same modules as have been working with this same stock kernel for months.

Thank you for your response.

Daniel
 
Old 03-20-2007, 10:16 AM   #12
Muraii
Member
 
Registered: May 2006
Posts: 62

Rep: Reputation: 15
Some things learned

Hi,

Regarding my part of this thread, I believe I may have run all the compilation steps as root. I still haven't figured out how to let the kernel know where all the modules are. I'd still like to learn what I've done, because I'll need to know what I did if I do it again; but I may, to get my machine more usable, simply move on to the next challenge: installing Slackware 11 and moving to the 2.6 kernel.

Also, in case anyone else is similarly flummoxed, I was completely mystified that my .config file disappeared when I renamed it. I thought I'd screwed something up until reading that, yes, that's precisely what happens.

Sheesh.

Have a great day.
 
  


Reply


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
kernel compile while using floppy to boot? detpenguin Slackware 6 06-22-2004 07:08 PM
kernel compile - boot screen kam_kenneth Linux - Newbie 2 05-08-2004 04:32 PM
after compile still boot into the old kernel?? why?? ckamheng Slackware 7 12-30-2003 04:02 AM
kernel compile and boot loader Abe_the_Man Linux - Newbie 2 10-06-2003 08:13 PM
Kernel Compile Boot Loader? boot disk? SPMcRuube Linux - Newbie 3 12-03-2002 07:02 PM


All times are GMT -5. The time now is 05:07 AM.

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