Forum: Geek Forum
Topic: Hardcore linux stuff
started by: Beldurin

Posted by Beldurin on Jun. 28 2002,05:16
Ok, background:  I'm working on a beowulf class computing cluster.  The director of the project wants to switch to a new software, < Clustermatic >.  So I download the software and instructions.  Now here's the problem.

The first step of the instructions say that you need to patch the kernel with the bproc.x.y.z patch.  The example command says to go to /usr/src/linux and

type
Code Sample
patch -p1 < ~/path_to_patch_file (in this case /root/Clustermatic/Tar \Files/bproc-2.3.9/patches/bproc-patch.2.3.9 I think)


This function call terminates with an error.  I think it's saying that it can't find /kernel-2.7.18-lanl/exec.c and another .c file.  Sometime earlier I got an error saying that something about some header (.h) files as well.  

Here's my preliminary diagnosis (I'll admit that I'm out of my element here).  First of all, I'm doing this on RedHat 7.2.  The default source directory for linux is (I think) /usr/src/linux whereas RedHat uses /usr/src/redhat, then SOURCES/,RPMS/,BUILD/, etc.  This might be a problem.  The other thing is that I don't think the guy that installed the linux installed the source files for the kernel, but I'm not positive.  I tried to sift through the CD's and install the source rpms, but couldn't find one with the kernel headers for the i686 (PII, right?).

Help?  Please?
Posted by Darth Liberus on Jun. 28 2002,11:13
1. grab the latest 2.4.x kernel source from < www.kernel.org >.

2. untar it into /usr/src/linux.  curse red hat for being the Microsoft of the Linux world and always trying to "improve" things.

3. apply the patch with the command you were given.  man patch might help.

4. make menuconfig (or make xconfig if you're running X) and select the features & modules you want.

5. make dep

6. make bzImage

7. make modules

8. make modules_install

9. cp /usr/src/linux/arch/i386/bzImage /vmlinuz  # might be something other than /vmlinuz on redhat; check the image= line in /etc/lilo.conf

10. lilo    # this updates lilo with the new kernel image

11. cross your fingers

12. reboot


Posted by blanalex on Jun. 29 2002,18:57
The thing might be that you're trying to apply a patch to the wrong version of the kernel distribution.

1- Even with RH, the kernel source always sits in /usr/src/linux, but it is in reality a symlink to /usr/src/linux-2.4.18-xx. /usr/src/redhat has nothing to do with the kernel, it's only for the building of RPM packages.

2- Red Hat, like many distros, adds some home made patches, go grab the latest source off  < ftp://ftp.kernel.org/pub/linux/kernel/v2.4/ >.

3- Check clustermatic's documentation, i'm sure they mention that the patch you want to apply is valid only with a specific version of the kernel. Again, grab that version off ftp.kernel.org and follow Darth Liberus' instuctions

4- I suggest you remove the /usr/include/linux directory, and create a symlink with ln -s /usr/src/linux/include/linux /usr/include/linux to make sure all you're going to compile will use the right version of the linux headers.

that's pretty much it
Posted by Beldurin on Jun. 29 2002,19:08
that's part of the problem...there is no /usr/src/linux directory
Posted by blanalex on Jun. 29 2002,19:27
Quote (Beldurin @ 29 June 2002,06:08)
that's part of the problem...there is no /usr/src/linux directory

eheheh that's THE problem ;)

you can't apply a patch against something you don't have :-p

check Clustermatic's doc, determine what version of linux source you must have, download it from kernel.org (use the link above). The file you want is linux-2.4.xx.tar.gz

go in /usr/src and unpack the tarball with tar zxvf <path of the downloaded file>/linux-2.4.xx.tar.gz, then follow DL instructions
Posted by forumwhore on Jun. 29 2002,20:34
If you are really and truly stuck, I can forward your question to webhost; he knows more about linux etc than all of us put together.

However, you *must go through me.  
If you write him directly he'll have no idea who you are.
Posted by incubus on Jun. 29 2002,22:35
Your problem is as above.  The reason you didn't have a /usr/src/linux directory is that you didn't install the kernel-sources or kernel-devel RPM (or whatever it's called).

As people have said you WILL need to get a vanilla kernel from www.kernel.org if you want your patches to work.

Finally if you want high performance on your cluster without the bloat move so something a bit more tight like < Gentoo Linux > ... :)
Posted by CaptainEO on Jun. 30 2002,06:22
Quote
4- I suggest you remove the /usr/include/linux directory, and create a symlink with ln -s /usr/src/linux/include/linux /usr/include/linux to make sure all you're going to compile will use the right version of the linux headers.

Just an aside - DO NOT DO THIS. EVER. (unless you are compiling glibc yourself - which I don't recommend you do either =).

The headers in /usr/include/linux must match the installed version of glibc. They are there for the benefit of user-space, they have nothing to do with the kernel you are running...

Sorry for jumping on you; this just comes up very often on the LKML, and we want to stamp out this bad habit forever =).
Posted by Beldurin on Jun. 30 2002,23:06
ok, I've made it pretty far thanks to you guys.  Here' s the new problem:

went through the software install, did the make and the make install.  The next step in the instructions is to modprobe bproc.  However, I get the following message "modprobe:  Can't locate module bproc"

now what?
Posted by CaptainEO on Jul. 01 2002,04:31
:06-->
Quote (Beldurin @ 30 June 2002,15:06)
went through the software install, did the make and the make install.  The next step in the instructions is to modprobe bproc.  However, I get the following message "modprobe:  Can't locate module bproc"

When you are compiling the kernel (in /usr/src/linux), make sure you do:

make modules
make modules_install

in addition to the usual make bzImage or make install. This will compile any kernel modules you have configured, and copy them into /lib/modules/<kernel version>/kernel. (modprobe will look in there for bproc.o, and it's giving you the error because it can't find it)
Posted by Beldurin on Jul. 01 2002,05:27
I did a completely clean install of 7.2.  When it installed the development headers, it put them in /usr/src/linux-2.4.7-10 and a symlink linux-2.4 to that directory.  

I followed DL's instructions (including make and make_install)

the bproc.o file was put in /lib/modules/2.4.18/bproc

I tried copying it into /lib/modules/2.4.18/kernel but it still gave me the same message

Another question.  I copied the bzImage file into /boot/ (as indicated in lilo.conf), but it didn't overwrite anything.  Is this what it's supposed to do?  There is an .img (initrd-2.4.7-10.img) file in there which is referenced in lilo.conf and then there's a file called vmlinuz-2.4.7-10 which is also in lilo.conf.  Does this make any sense to you?

also, when did the lilo command, it didn't seem to change anything.  How can I tell if it is booting the new kernel version?  

This is really pissing me off.
Powered by Ikonboard 3.1.4 © 2006 Ikonboard