Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with kernel rebuild 1

Status
Not open for further replies.

nfaber

Technical User
Oct 22, 2001
446
US
I am running RedHAT 7.2 and I am trying to compile the 2.4.14 kernel. The process goes just as expected with no errors during the make xconfig, make dep etc...but when I try to boot the new kernel, It will not boot with multiple errors:

/etc/sysinit: no such file or directory

It can't seem to find paths to my files. With one build (I have tried this at least 5 time) I saw the kernel attempting multiple touch commands to create files!

All the HOWTOs I have seen make scant mention of the /usr/src/redhat directory the /usr/src/linux directory and what they do and what links are needed if any. One said to delete the linux directory before untaring the distribution and another said to rename it after! What is the deal here?

Also what does the /boot/boot.h file do and why is it not created for my new kernel when I compile it?

Any help is appriciated.
 
Have you ever compiled a kernel before successfully?
If not read the kernel howto;

QUICK:
(if *.tar.gz ; else bzip)
tar -zxvf linux-2.4.14
mv linux /usr/linux-2.4.14
cd /usr/src
if [ -e "$PWD/linux" ]
then
rm $PWD/linux
ln -s linux-2.4.14 linux && cd linux && make
menuconfig
else
ln -s linux-2.4.14 linux && cd linux
make menuconfig
fi
 
If this is the source that came with your distro, you might try downloading a new tar ball. The ones that come prepackaged seem to be missing some files.
 
marsd,

No I have not. I am a HP-UX Solaris guy. Which kernel HOWTO? I have read several. I also have the Mastering RedHat Linux 7.1 book. No procedures from any have worked (at least for me). I would rather not use a script. I want to understand what is happenenig before I script it.

RythmAce, I do a clean redhat 7.2 install, then download the 2.4.14 distro, then run through the procedures.

I think I ammissing something simple. Live shouldn't new files be created in /boot? Like boot.h or something? What about soft links between /usr/src/redhat and /usr/src/linux? Does there need to be any and what does the /usr/src/redhat directory do anyway? I see no reference to it anywhere.
 
Hi,











The 'linux' directory in /usr/src/ is normally a symlink to the underlying source version directory (people normally have several kernel versions on disk). So, assuming you had such a link it would be normal to delete the link first before untarring the source. The compile steps are as follows :











cd /usr/src





rm linux





tar jxvf linux-2.4.14.tar.bz2

(or
tar zxvf linux-2.4.14.tar.gz)


mv linux linux-2.4.14





ln -s linux-2.4.14 linux





cd linux





make xconfig (or make menuconfig)





make dep





make clean





make bzImage





make modules





make modules_install





cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.14





cp System.map /boot/System.map-2.4.14





(if you have scsi or otherwise need an initial read-disk also do -)





/sbin/mkinitrd /boot/initrd-2.4.14 2.4.14











Then you edit /etc/lilo.conf and create a new image block something like this :











image=/boot/vmlinuz-2.4.14





label=linux2414





initrd=/boot/initrd-2.4.14.img (if needed)





read-only











You would also duplicate any 'append' lines in existing (working) image blocks.











Then update the lilo binary image as root with :











/sbin/lilo -v











A word of warning.... Don't use the (unpatched) 2.4.15 or 2.5.0 kernels .. there is a bug that corrupts your filesystem on shutdown.











Finally, /usr/src/redhat is the 'hard-coded' location where source rpms (srpms) will be installed on redhat. If you installed a redhat kernel-source rpm you'd end up with the source tarball in /usr/src/redhat/SOURCES. This directory structure is really for building binary rpms - for example the control file to do the build is put into /usr/src/redhat/SPECS so to build a binary rpm from a redhat source rpm you'd 'cd /usr/src/redhat/SPECS' and then do 'rpm -bb whatever.spec'. You'd end up with a binary rpm in /usr/src/redhat/RPMS/i386 .











Hope this helps





 
thanks ifincham,

that makes sense, I will try it after work tionight. Three things I am seeing for the first time:

cp System.map /boot/System.map-2.4.14

mv linux linux-2.4.14
ln -s linux-2.4.14 linux

/sbin/lilo -v (I assume the v switch is verbose)


Also how do I check and perform the following?:

>>You would also duplicate any 'append' lines in existing (working) image blocks.<<


Also what does the &quot;make install&quot; do. Is that necessary?

 
Hi,

Not sure what 'make install' does - I've never used it. I'll have a look in the Makefile later. The reference to append is in case you are passing any parameters to the kernel via lilo (for example to set ethernet card parms if driver is builtin to the kernel). These are just the arguments (if any) you would pass at the boot: prompt. The following is an example :

image=/boot/vmlinuz-2.4.14
    label=linux2414
   initrd=/boot/initrd-2.4.14.img 
append=&quot;mem=128m&quot;
    read-only

If you have no such entries for your existing kernel(s) then you don't need it.

Regards


 
Thanks for the help! I saw the reference to make nstall in the redhat HOWTO on kernel rebuilds. It says that it writes all the necessary files to the proper directories or somehting like that so it seemed useful, and using the RH HOWTO I was finally able to at least recompile my kernel successfully. No If you can just make my winmodem and SiS7012 on-board sound card work I'll be all set! (just kidding). At least I have a recompiled kernel now to try to install the drivers without the &quot;dependancy&quot; problems (which is why I did it in the first place).

Thanks again from a Solaris guy.
 
make bzlilo is also used, instead of make bzImage, but the more savvy way of doing things is the way IF described.
That seems analagous to &quot;make install&quot;
 
ifincham,

I read about the bug in 2.4.15 and that actually slowed me down quite a bit because i though that was the problem originally.

marsd,

The RH HOWTO also called for the make bzlilo AND the make bzImage If I recall correctly. I will check the HOWTO tonight.

Now I just need to see what recompiling a Solaris or HP-UX kernel entails. This is just not something we normally do with commercial versions of UNIX.
 
IFINCHAM,

IT DID NOT WORK!!!!

I ran through the install from your post verbatum and I get the same error! This is weird! The first error I can see is the kernel is unable to mount a file system. Then I get a series of &quot;cannot find file&quot; messages when it tries to run the init scripts!

I am baffled here because the 2.4.7-10 kernel boots fine?


ANY IDEAS?
 
Sure: scripts not running aftera critical fs is not mounted
is logical;) -don't panic.
What fs are you using?
ext2 ext3 , reiserfs?

Ideas:
Make sure that you have compiled support for the fs
into your new kernel.
Make sure that you have specified loadable module
support into your kernel.
Make sure that if you are using scsi disks you have made
the drivers you need and either have done mk_initrd(if
they are loaded as modules) or have compiled them into
the kernel.(if they are not loaded as modules)
Maybe you did not rerun lilo after editing the lilo.conf?

I think we will need to know your HW config now to help
you back up.
 
Hi,

I just realised you are on 7.2 . The kernel included with that version of redhat is patched from the original (nothing unusual in that as such) but this one would have the ext3 support and you probably have a ext3 filesystem. At the moment the ext3 stuff is not merged into the official kernel tree.

So, you need to get a kernel patch for ext3. The patch would be in the redhat source rpm if there was one for 2.4.14 but there obviously isn't yet. The address given in the faq --> , i.e. doesn't seem to be accessible at the time of writing. You can get the code from --> ftp://ftp.kernel.org/pub/linux/kernel/people/sct/ext3/
but they are 2.2.x patches so not easily useable on 2.4.x .

I got a patch that I used against 2.4.14 myself only about a week ago but I can't be certain whether it was from the above location. I'll have to have a look. One thing you could try is to install the kernel-source rpm from redhat and then grab the 2.4.7 patch from /usr/src/redhat/SOURCES. If the kernel source has not changed significantly from 2.4.7 then that patch may well work successfully against the 2.4.14 source tree .

I'll check it a bit more later...

Regards
 
Hi,

Actually, I found the 2.4 patches again .. They are at --> . So for 2.4.14 you'd need --> . To apply the patch to the source tree do the following :

cd /usr/src/linux
gunzip < /tmp/ext3-2.4-0.9.15-2414.gz | patch -p1

(where /tmp/ext3-2.4-0.9.15-2414.gz is wherever you downloaded the source code patch).

Once you've patched the kernel source you must remember when doing your 'make xconfig' to select ext3 support in the 'filesystems' section. Also, select it as builtin (not a module) otherwise you will get into the problem of initrds, etc.

I did notice one file corruption report in the lkml on ext3 with 2.4.14 but that may be for a combination of reasons --> .

Also, FYI, 2.4.16 is now out - that is very little different to 2.4.15 and you may find that the above patch runs against that too..

Before you do all the above, you might like to check that you are indeed using ext3 -

cat /etc/fstab

(should show ext3 instead of ext2 on /)

Hope this helps
 
ifincham,

That sounds familiar. As my new kernel boots (or tries to) just before the failures start it tries to mount an ext3 file system. I tried quickly this morning to download and run the path from your link, but had some problems downloading it to a fat partition and reading it in Linux (I have a winmodem and have not been able to make it work with Linux so all downloads I do from Windows 2000 to a fat16 partition I set up).

Just in case, how to I instll the pathc in two commands versus one? eg:

tar zxvf &quot;patchfile&quot;

&quot;install patch command&quot;
 
ifincham,

That sounds familiar. As my new kernel boots (or tries to) just before the failures start it tries to mount an ext3 file system. I tried quickly this morning to download and run the path from your link, but had some problems downloading it to a fat partition and reading it in Linux (I have a winmodem and have not been able to make it work with Linux so all downloads I do from Windows 2000 to a fat16 partition I set up).

Just in case, how to I instll the patch in two commands versus one? eg:

tar zxvf &quot;patchfile&quot;

&quot;install patch command&quot;
 
Hi,

Without the pipe you would do ....

(Assumimg patch is downloaded to /tmp )

cd /tmp
gunzip ext3-2.4-0.9.15-2414.gz (unzips compressed archive to ext3-2.4-0.9.15-2414)
cd /usr/src/linux
patch -p1 < /tmp/tmp/ext3-2.4-0.9.15-2414

Regards

 
ifincham,

I have downloaded the patch and tried to install it severl times per your instructions and I keep getting &quot;not in gunzip format&quot; when I try to gunzip it. Any ideas? When I try to download using binary FTP (holding down shift key, a window opens up and the script loads in it as a text document.
 
Hi,





Well I just tried it myself (download & gunzip) and it works fine for me. When you issue the command, incidentally, it doesn't say anything by default - only unzips into a file named the same but without the .gz extension. You can try with the -v (verbose) switch to get some feedback :





gunzip -v ext3-2.4-0.9.15-2414.gz 





I'm not sure whats going on with your transfers - it sounds as if the download is being unzipped on the fly or something. You certainly should download it as binary though - it won't work otherwise, especially from a windows download.The size of the unzipped file for the above is 515655 bytes so if you can save the text file at that size thats what you need. What ftp client s/w are you using ?





Regards





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top