LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-19-2003, 12:03 PM   #1
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
kernel compilation; applying patch


i had a coupla questions.
ok, so im tryin to apply the 2.4.22pre6 patch.

i currently am on the 2.4.20-13.8 kernel.

1. do i need to install the 2.4.21 (which is the
latest stable release), to apply the patch.
if not, i get an error while applying the patch.

2. i tried compiling the 2.4.21 kernel, and when i
reboot it, it gives me an error saying "unable to
mount root".
do u know what could have gone wrong while i was
compiling it? i had done a :
a. make oldconfig
b. make dep
c. make modules
d. make modules_install
e. cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.0
f. cp System.map /boot/System.map-2.4.0
g. mkinitrd /boot/initrd-2.4.21.img 2.4.21

then edited the /etc/grub.conf to have this:
title Red Hat Linux (2.4.21)
root (hd0,2)
kernel /boot/vmlinuz-2.4.21 ro root=LABEL=/
hdc=ide-scsi
initrd /boot/initrd-2.4.21.img


can anyone tell me where and what could have gone wrong above? or if there is more for me to do?

thank you very much for your time. :-)
 
Old 07-19-2003, 12:16 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
1. do i need to install the 2.4.21 (which is the
latest stable release), to apply the patch.
if not, i get an error while applying the patch.

Yes

2. i tried compiling the 2.4.21 kernel, and when i
reboot it, it gives me an error saying "unable to
mount root".

One possible solution: Check to make sure that you included ramdisk support in the kernel.
 
Old 07-19-2003, 12:20 PM   #3
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
hi, thnx for ur prompt reply.
ok, now when i do a "make oldconfig", i assumed it would keep the config from my existing kernel, and proceed.
so, i kept hitting enter at most prompts thinking it would be ok.
 
Old 07-19-2003, 01:24 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
I think that the first "oldconfig" must be introduced from outside the makefile. Thereafter it uses the previous oldconfig.
 
Old 07-22-2003, 01:33 AM   #5
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
hey - thnx again.
ok, this is what i did exactly!

in my /usr/src dir :
a. bzip2 -dc /tmp/rajesh/linux-2.4.21.tar.bz2 | tar xvf -
b. bzip2 -dc /tmp/rajesh/patch-2.4.22-pre7.bz2 | patch -p1
c. cp ../linux-2.4/.config .
d. make oldconfig
e. make dep
f. make modules
g. make bzImage
h. make modules_install
i. cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.21
j. cp System.map /boot/System.map-2.4.21
k. mkinitrd /boot/initrd-2.4.21.img 2.4.21

this is what i "observed" during the above steps:
[a-f] : went through with no problems
g : i got some warnng like :
tools/build -b bbootsect bsetup compressed/bvmlinux.out CURRENT > bzImage
Root device is (3, 3)
Boot sector 512 bytes.
Setup is 2540 bytes.
System is 1393 kB
warning: kernel is too big for standalone boot from floppy
make[1]: Leaving directory `/usr/src/linux-2.4.21/arch/i386/boot'

i dont know if that is to make any difference.

[h-k] : went ok.

now, when i go into the /boot dir, i see :
a. vmlinuz-2.4.21
b. System.map-2.4.21
c. initrd-2.4.21.img

i notice that the initrd-2.4.21.img file is about half the size of the initrd of the previous kernels.

then i edit the /etc/grub.conf to be:
title Red Hat Linux (2.4.21)
root (hd0,2)
kernel /boot/vmlinuz-2.4.21 ro root=LABEL=/ hdc=ide-scsi
initrd /boot/initrd-2.4.21.img
title Red Hat Linux (2.4.20-13.8)
root (hd0,2)
kernel /boot/vmlinuz-2.4.20-13.8 ro root=LABEL=/ hdc=ide-scsi
initrd /boot/initrd-2.4.20-13.8.img


and i reboot.
ok, so it initializes the devices and then goes into a kernel panic saying it cannot mount root filesystem.

my questions are:
1. does that warning i see after 'make bzImage' make any difference?
2. when i do the 'make oldconfig', and it asks the questions, can i keep hitting 'enter' thinking i have moved the old .config into this dir before running make, and it would keep that config?
3. how do i check to see if ramdisk support is included? and shouldnt it be a moot point if im using the old .config?
4. when i reboot, and see the kernel panic, is there anyway i can restart without pulling the plug out?
5. and is there anything i should do in /sbin/grub? (im just guessing)

been thro everything online and all the docs, but i cant seem to find much on troubleshooting this. most of them are just docs on how to do it!

any help is highly appreciated! thanks again!
 
Old 07-22-2003, 05:41 AM   #6
wrc1944
Member
 
Registered: Aug 2002
Location: Gainesville, Florida
Distribution: Gentoo ~x86 2007.0
Posts: 139

Rep: Reputation: 15
If you get through with only warnings, your generally OK- if things are really amiss, it will error out.
I've found it best not to compile kernels as root in /usr/src.
What I do is this:

1.Download 2.4.21.bz2 to it's own directory in /home, and extract it there.

2. Cd to the linux-2.4.21 directory,do make mrproper, then put the .bz2 patch inside the linux-2.4.21 directory, and in a console, still as user, issue:

bzip2 -dc patchxxxx.bz2 | patch -p1

Check the toplevel Makefile extraversion line- it should reflect the patch version- if not, call it = -whatever, to differentiate it from any other kernel on the system.


3. Then you can make xconfig, and load your saved config file into xconfig, and make any edits you need. (Don't do make oldconfig- it's easier to load a copied config file, and then edit in xconfig). If you need ramdisk support, just set it as "y." Save, and exit xconfig.

4.Then do make dep, make clean, and make bzImage, and make modules.

5. su to root, and do make modules_install.

6. Don't do make install!
Instead, copy manually System.map and bzImage, naming them to what the kernel version is. Just make sure it isn't the same as an already installed kernel. I don't use an initrd, but I don't have any scsi drives, so it's OK.

7. Edit, and run lilo, or edit grub. Check lib/modules and /boot to be sure all is correct. reboot, and select the new kernel.

Hope this helps,
wrc1944
 
Old 07-22-2003, 04:04 PM   #7
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
hey - thanks for the reply.
tried it, but i get the same error - kernel panic.

someone pointed this out to me :
Q: My system memory is not fully detected, or the computer hangs shortly after starting with the message "Panic: cannot mount root file system"!

A: Some boards apparently report the usable memory size incorrectly to the Linux kernel. Solution: specify the system memory size as an additional "knoppix" boot option. For example, for 128 Megabytes use

knoppix mem=128M

(Note: make certain an upper-case M is typed after the memory size!)

now, this is using knoppix.
is there an equivalent place/file i can edit to do the above on redhat8?

tia!
 
Old 07-22-2003, 04:05 PM   #8
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
the above question was frm:
http://www.knoppix.net/docs/index.php/FaqHardware
 
Old 07-22-2003, 05:19 PM   #9
harrygraham
Member
 
Registered: Apr 2001
Location: Ottawa, Canada
Distribution: Mint Cinnamon AMD64
Posts: 155

Rep: Reputation: 18
Whenever I attempt to change a lot of kernel settings I get the same thing. For this reason I have only been able to successfully compile kernels that have just the processor type reset, and nothing else. Every time I edit the modules something messes up and I get the kernel panic you described. Probably adding a patch is similar.

The problem is that some modules are being skipped over in the compilation process. To get all the modules properly made you have to do some pretty fancy stuff (IE the nohup options etc.), which I've never been able to master.

Also, that warning about the kernel being too big to fit on a floppy doesn't really mean that it's not a good kernel.

Hope this helps.
 
Old 07-22-2003, 05:42 PM   #10
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
thnx harry.

ok, all the settings are done during the "make xxxconfig" right?

now, no matter what i do "make old/x/...config", i get asked the same questions.

even if i do a make xconfig, and load the config file from my prev kernel version, and follow the steps, i get the error.
if i do a "make oldconfig", i get asked questions on cmd-line, and its even more annoying, cos here i am thinking it will just compile usin the config from the already running kernel.

this is soo annoying!

and umm, u wudnt know if theres an equivalent to the knoppix thingie on RH, wud ya?


thnx again
 
Old 07-22-2003, 11:45 PM   #11
harrygraham
Member
 
Registered: Apr 2001
Location: Ottawa, Canada
Distribution: Mint Cinnamon AMD64
Posts: 155

Rep: Reputation: 18
Dear H/W,

Try adding this line to your lilo.config file:

append= "mem=176M"

It works on Mandrake. Maybe it will also work on RedHat.

But I do not think a small configuration problem would interfere with your kernel compiling. Maybe you should try to weather through the almost baffling Kernel-HOWTO on http://www.linux.org. It's not for the feint of heart though.

Good luck!
 
Old 07-23-2003, 11:23 AM   #12
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
thnx, since im using grub ...
will try it out later now.

thnx again!
 
  


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
Applying Kernel Patch browser Linux - Software 2 08-31-2005 07:18 AM
Applying a kernel patch.. RoaCh Of DisCor Linux - Software 2 05-07-2005 08:41 PM
applying kernel patch pirozzi Debian 1 12-01-2004 08:47 AM
Building a kernel RPM with applying a patch barisdemiray Programming 1 08-04-2004 07:50 AM
applying ck kernel patch Abe_the_Man Linux - General 1 01-29-2004 12:43 PM


All times are GMT -5. The time now is 07:02 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration