LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-14-2003, 01:08 PM   #1
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Rep: Reputation: 15
kernel screwed, start over


few questions:

Running Slack 9.1, was using the default kernel 2.4.22 off the CDs. Tried to compile 2.6.0-test6-mm1 (using directions provided by others in my previous thread "Kernel 2.6 - Any Takers") and now when I try to mount /dev/cdrom it says "cdrom is not a valid block device". So I goofed somewhere. I tried to recompile again adding in block support and SCSI support for the CDRW but that didn't help.

So:

1. How could I just reload the bzimage of the kernel off the slack CDs? Now it's not letting me even fully boot into linux, nor can I mount the cdrom so I'll have to do this using the installer CD I think. I just want to copy over the kernel from the CD to my hard drive and later try to recompile a newer kernel than 2.4.22.

2. How do I compile a new kernel using the config from my current kernel? Do I just load the old configuration file when doing 'make menuconfig?' The install off the slack CD got all of my stuff working but sound (i'm using a quirky card and will have to figure that out later).

3. I was getting a lot of errors during compiling and sometimes had to repeat a step. I was doing the compiling from a terminal with X running. Should I be out of X when compiling a new kernel or does it matter if X is running?

Thanks.
 
Old 10-14-2003, 04:00 PM   #2
quietguy47
Member
 
Registered: Mar 2003
Location: Everett
Distribution: Slackware
Posts: 805

Rep: Reputation: 35
2. make oldconfig If there are any new options in the new kernel that you need to make decisions on, it will ask you using the same interface as make config.

3. It doesn't matter if X is running. My prefered method is with make menuconfig from the command line.

You can have more than one kernel installed. Infact, if you are going to compile a new kernel, you should keep the 'default' kernel around just incase everything doesn't go quite right.
Before running lilo during the compile process, you should edit /etc/lilo.conf so that you can boot the 'old' kernel just incase the new one doesn't work.
Here is an example of what I mean.
image = /boot/vmlinuz.old
root = /dev/hda2
label = Linux
read-only
image=/boot/vmlinuz
root=/dev/hda2
label=newkernel
read-only
I hope this helps
 
Old 10-14-2003, 04:08 PM   #3
JollyRogers
Member
 
Registered: Sep 2003
Location: Va USA
Distribution: Slackware
Posts: 81

Rep: Reputation: 16
hmm you overwrote your original kernel image? not a good idea when compiling a new kernel. For 2.6.0-test7 (or any new kernel) I highly recommend doing something like 'make bzImage' and 'cp arch/i386/boot/bzIamge /boot/bzImage-linux-2.6.0-test7' then editing /etc/lilo.conf by hand and running lilo to avoid it in the future....
here is an example of my /etc/lilo.conf that matters:
# Linux bootable partition config begins
image = /vmlinuz
root = /dev/hda2
label = Slackware
read-only
image = /boot/bzImage-2.4.22-ac4
root = /dev/hda2
label = 2.4.22-ac4
read-only
image = /boot/bzImage-2.6.0-test7
root = /dev/hda2
label = 2.6.0-test7
read-only
# Linux bootable partition config ends

OK
#1. boot off the cd. READ what it says about booting in a pinch! using root=/dev/hdXX (wherever your root partition is...) and put that in there as a boot option. It should now boot and your system should be running....
so for me:
boot: root=/dev/hda2

Then you can go and rerun pkgtool and select the part about installing your kernel. Well thats the theory

2. I always grab the .config and copy it to CONFIG as a backup before I start messing with kernels, because make mrproper deletes the .config. Sometimes I grab a .config from the cd in the kernels directory on Slackaware. Regardless 'cp .config CONFIG'. Then after make mrproper I copy CONFIG to .config. Now I have a config to start with. But I compiled 2.6.0-test7, this didn't work for me hah! but I know my hardware and kernel options well enough to get what I needed..

3. Hmmm 2.6.0-test7 compiled very error free for me. There where some warnings, but nothing serious.... I do it in X all the time, from the console whatever, it doesn't matter....
 
Old 10-14-2003, 05:25 PM   #4
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Original Poster
Rep: Reputation: 15
Ok. Figured out the answer to question 1. Thanks to quietguy and JollyRogers for making me think a little. Here's how I did it.

1. Insert Slack disc 1

2. When it prompts you at boot, hit enter.

3. When it says login: type root

4. Type setup

This is the normal install procedure so far

5. Initialize the swap partition from the install menu... slack will reformat your swap partition and mount it.

6. Mount the root filesystem after the swap is initialized.. DON"T FORMAT. Tell it no when it asks to reformat.

7. Go through Configure your system. Tell it to install the bare.i kernel and go through all the steps (network configure, select timezone, services to be turned on.. yada yada yada). For some reason I had to tell it to install LILO again.

8. Exit from the installer.

9. CTRL + ALT + DEL

10. Happy slacking!
 
Old 10-14-2003, 07:49 PM   #5
JollyRogers
Member
 
Registered: Sep 2003
Location: Va USA
Distribution: Slackware
Posts: 81

Rep: Reputation: 16
yea that works. good for you
 
Old 10-14-2003, 08:21 PM   #6
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Original Poster
Rep: Reputation: 15
Ok. Now problem number 4 .

I d/led 2.6.0-test7. Unzipped, cd'd to the dir and ran 'make menuconfig'. I made sure to incorporate the SCSI CD-ROM support, frambuffer and whatnot extras I didn't have in before with 2.4.22.

I did a make clean, make bzImage and cp'd it from arch/i386/boot/bzImage over to /boot/bzImage-2.6.0-test7 and made another lilo entry to run test 7.

Now, I can't mount my CD. It returns an "invalid block device error". I looked at my fstab and it was set to /dev/cdrom /mnt/cdrom iso9660 ...etc.

I ran a ls -l /dev/cdrom and it returned dev/cdrom --> dev/sr0.

So I tried changing my fstab /dev/sr0 /mnt/cdrom. No luck.

I tried mount -t /dev/cdrom iso9660. No luck.
I tried mount -t /dev/sr0 iso9660. No luck.

Any thoughts on why I can't mount my CD drive? This happened when I compiled test6-mm1 as well.


**Edit** I also later tried it with a make modules, make modules_install and it's still a no go. Found a number of times the compiler came back with errors during make bzImage where I just typed make bzImage again and it seemed to pick right up where it left off. Does that make a difference?

Everything else seems to be working okay.. (so far)

Last edited by zigmund555; 10-14-2003 at 08:23 PM.
 
Old 10-14-2003, 08:54 PM   #7
quietguy47
Member
 
Registered: Mar 2003
Location: Everett
Distribution: Slackware
Posts: 805

Rep: Reputation: 35
If it is a cd -r/rw, then you need to add this line to /etc/lilo.conf append="hdx=ide-scsi".
Example:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
append="hdc=ide-scsi"
boot = /dev/hda
message = /boot/boot_message.txt
prompt
change the x in hdx to what letter your cdrom is

Last edited by quietguy47; 10-14-2003 at 08:56 PM.
 
Old 10-15-2003, 03:56 AM   #8
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Original Poster
Rep: Reputation: 15
quietguy. That line was already in there. I added it in during the install.
 
Old 10-15-2003, 01:34 PM   #9
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Original Poster
Rep: Reputation: 15
Updates.. (note: I do write long posts and try to provide a lot of detail to help others more easily provide suggestions as to how I can fix my problems).

I decided to say screw it and just used the old config file from the 2.4.22 located in /usr/linux/src. Compiling 2.6.0-test7 in my home dir.

so I cp over the .config file to my /home/username/2.6.0-test7 directory, run a make menuconfig and Load Alternate configuration file. I tell it to load .config (doesn't seem to me that I can change the location of where to find .config but I copied it over anyway so what does it matter).

From there I didn't touch it, I just exited out and selected Yes when it prompted to me to save my new kernel config. So, really I stuck with the same config options as the default config from the original 2.4.22 install off the CDs.

I ran a make bzImage (skipped the make clean) and it gave me a few Error 1, Error 2 messages and stopped. I just ran make bzImage again and it picked up where it left off.

So, I finish make bzImage and it tells me my new kernel is ready. I copied over the image from my arch/i386/..blah over to my /boot/bzImage-2.6.0-test7 where lilo points.

Then I do a make modules (to compile all the modules) and I hangs up at sx.o. Error 1 and Error 2. I try to run make modules again but it won't get by this one module. No clue.

This is using, AFAIK, the exact bloated options under the default kernel install. I wanted to make sure I could get 2.6.0-test7 to work and then I'd start trimming the fat. But, I can't get through making the modules and therefore I can't get to make modules_install so it doesn't help much with the CDROM issues.

Yes I run 'lilo' after I copy over the bzImage to the new location.. just in case.

append="hdc=ide-scsi" is in my lilo.conf.

So.....

1. Any ideas why I might be getting so many errors when compiling? 'make bzImage' will usually give me 6 or 7 errors and will stop while compiling. 'make modules' does the same. Should I do a make clean or a make mrproper first, then copy over the .config file and try it that way?

2. While you can type ? on a kernel option under menuconfig to get some more information it seems that some modules might rely upon others in order to work. Does anyone have a webreference for more documentation on the different options? Just trying to learn what I can and can't take out. I know I can remove support for the hardware I don't have, filesystems I don't use, telephony support (no modem), etc. But, for instance I tried to cut down on all the USB stuff I don't have (scanners) and although I left support for USB HID my USB mouse stopped working.
 
Old 10-15-2003, 05:43 PM   #10
quietguy47
Member
 
Registered: Mar 2003
Location: Everett
Distribution: Slackware
Posts: 805

Rep: Reputation: 35
1. If your recompiling 2.6.0, make mrproper. If your starting from a clean source, then make mrproper is probably unnecessary. make clean is for after it compiles(ex: make clean, make bzImage.....)
2.http://www.ibiblio.org/pub/Linux/doc...O/Kernel-HOWTO
 
Old 10-16-2003, 05:42 AM   #11
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Original Poster
Rep: Reputation: 15
Ok. Still more problems, pretty frustrated. I'll try to keep this one short.

Here's what I did, step by step the last time. Did I goof somewhere?

1. Download 2.6.0-test7 into my home/username dir
2. tar xzvf linux-2.6.0-test7 this makes /home/username/linux-2.6.0-test7
3. cd to linux-2.6.0-test7
4. Take the original config file from the 9.1 cd, bare.i kernel, copy as CONFIG in /home/username
5. cd to /home/username/linux-2.6.0-test7
6. make mrproper
7. cp /home/username/CONFIG /home/username/linux-2.6.0-test7/.config
8. in /home/username/linux2.6.0-test7, make oldconfig. (so it uses the default config fom the CD). Go through the new options and choose yes, no, module.. etc. Followed the notes for each one to help me decide y, m, or n.
9. make bzImage .. no errors, no warnings
10. cp /arch/i386/boot/bzImage to /boot/bzImage-2.6.0-test7 (this arch is under my /home/username/linux-2.6.0-test7)
11. make modules ... a few errors which stopped make. I'd just start it up again by doing make modules again.
12. make modules_install

my lilo section I added is:
image = /boot/bzImage-2.6.0-test7
root = /dev/hda5 (correct hda#)
label = 2.6.0-test7
read-only



Now when I reboot and chose the new kernel under lilo I'm not getting any screen output. Used to be it would work except for my CD but now I can't even see anything on the screen. The kernel boots. If I wait a bit although I can't see anything on the screen I still can login as root or as a user and do 'startx' or 'reboot' to go back to my old kernel.

Did I miss a step or goof somewhere?

I tried changing lilo from the default resolution of 1024x768x32 to just "vga" and that didn't work either. 2.4.22 boots fine using the higher resolution.
Read the howtos on this forum, kernel trap, ibiblio, and the README that came with the kernel. They all provide a different way of compiling and installing the kernel.
 
Old 10-16-2003, 05:46 AM   #12
shreev
Member
 
Registered: Apr 2003
Location: India
Distribution: Slackware 10
Posts: 37

Rep: Reputation: 15
A useful tip when u are recompiling ur kernel is to set the 'EXTRAVERSION' in the Makefile in the kernel src directory. That way, 'make modules_install' won't overwrite ur existing modules...thus reducing any chances of errors that way.

I'm not really sure if modules compiled with different kernels work properly with a kernel of a different version - mebbe that is causing a problem ?
 
Old 10-16-2003, 08:57 AM   #13
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Original Poster
Rep: Reputation: 15
shreev,

Could be. I'll try that tonight.
 
Old 10-16-2003, 10:18 AM   #14
smokybobo
LQ Newbie
 
Registered: Feb 2003
Posts: 29

Rep: Reputation: 15
Quote:
Originally posted by zigmund555
Now, I can't mount my CD. It returns an "invalid block device error". I looked at my fstab and it was set to /dev/cdrom /mnt/cdrom iso9660 ...etc.

I ran a ls -l /dev/cdrom and it returned dev/cdrom --> dev/sr0.

So I tried changing my fstab /dev/sr0 /mnt/cdrom. No luck.

I tried mount -t /dev/cdrom iso9660. No luck.
I tried mount -t /dev/sr0 iso9660. No luck.

Any thoughts on why I can't mount my CD drive? This happened when I compiled test6-mm1 as well.


**Edit** I also later tried it with a make modules, make modules_install and it's still a no go. Found a number of times the compiler came back with errors during make bzImage where I just typed make bzImage again and it seemed to pick right up where it left off. Does that make a difference?

Everything else seems to be working okay.. (so far)
Okay, I've read this entire thread so far, and a couple things aren't quite clear to me. You say when you 'make modules' you get errors. Are these errors every time you run that command, or just the once? And can you post what the errors exactly are? With certain kernel versions, it may be that some options if set will not allow kernel compilation to complete error free.

Also note, that with the 2.6 series kernel, certain modules will not autoload anymore due to the revamped system of handling modules. Assuming of course you've got the most recent release of the module-init-tools package, any input modules (like joystick i.e. joydev or anything else not handled by hotplug) will NOT autoload if you are not using devfs, even if you put the perfect syntax in /lib/modules/modprobe.conf. Either your startup scripts or /etc/modules will have to modprobe 'em. For instance, on my machine, I always have to modprobe the modules psmouse and joydev.

For the cdrom stuff, if you're hell bent on using ide-scsi, make sure ide-scsi, sr_mod, and sg modules are loaded into the kernel with a 'lsmod' command.

And in general, you will probably have to learn the syntax of the new /lib/modules/modprobe.conf which completely replaces /etc/modules.conf in the 2.6 kernel series. It took me a hell of a time trying to get alsa sound modules to autoload, and an even longer time to find out why everything under /dev/input would not autoload (since I don't use devfs). If you want to try out the 2.6 kernel now, though, this is inevitable as I wouldn't think most distros who don't use 2.6 kernel yet would go to the bother of rewriting /etc/modules.conf into /lib/modules/modprobe.conf.

Note: there is a utility included with the module-init-tools source package that will attempt to convert /etc/modules.conf into a proper modprobe.conf file, but it didn't work well with some things on my box so...

Note2: I believe that the correct mount command is, as used by the root user (assuming the /dev/cdrom symlink exists and is correct):

Code:
mount -t iso9660 /dev/cdrom /cdrom
 
Old 10-16-2003, 10:25 AM   #15
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Original Poster
Rep: Reputation: 15
smokybobo, I'll give it another go at lunchtime to post the errors I get with make modules. Roughly from memory the make modules routine stops and it spits out Error 1 and Error 2 lines. If it happens again next time I'll put in the exact error messages.

Not sure if I have the newest mod-init-tools. I will look.

Using the ide-scsci because I thought that was required for CD-RWs to burn.
 
  


Reply



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
How to start kernel? paschim Linux - Software 6 10-10-2004 06:42 PM
Slackware kernel and lilo (i screwed up) jmonolith2001 Slackware - Installation 4 04-26-2004 10:49 PM
New kernel won't start TazG Debian 9 04-22-2004 06:07 PM
Various Problems After Kernel Recompile - Keyboard Screwed, "Illegal Instructions"... johnleemk Linux - General 0 02-04-2004 11:33 PM
Blast, I screwed my kernel up Darktyco Slackware 8 12-25-2003 01:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration