[etherlab-users] Kernel question

dclark at mmto.org dclark at mmto.org
Mon Feb 15 21:03:08 CET 2010


Hello,

I, like you, am new to Etherlab, and also working with Fedora. Here is my
little HOWTO from my notes for Fedora. I recommend trying the simple step
first of "yum install kernel-devel linux-headers"; if after that you find
you need all of the kernel headers, read on (substitute your kernel
version where appropriate):

%%--- Getting Linux Sources for Fedora 12 --%%

Here's a quick and dirty way to get the linux sources for your running
copy of Fedora (12). The reason for this rigamarole is that 'yum install
kernel-devel linux-headers' DOESN'T provide you will all of the source
files for Fedora. I'm sure there's a good reason for this; my guess is
that it prevents the Average User from hosing up the distributed kernel
sources (e.g. module sources) but still lets them make their own modules
that have dependencies on the distribution header libraries.

However: sometimes for 3rd-party software, it will want to (patch?) or
otherwise "use the source, Luke". So for Fedora, I will describe what I
had to do...

NOTE: there is no (good) reason to do most of this as root, I will note
commands that require root by prepending a hash, like this: #ln -s foo
bar, or even via 'su -c'.

You need to have rpmdevtools and yumutils available on your system,
fortunately Fedora comes with these out of the box.

So first, get the source:

/home/$user> yumdownloader --source kernel

This will get an RPM that is called kernel-$yourinstallflavor.src.rpm. Now
to get the source unpacked and ready. NOTE THAT THIS IS ALL AIMED AT
GETTING A COPY OF YOUR RUNNING KERNEL! If you need to build a custom
kernel, I wish you luck, and point you here, which is where I got a good
number of the steps shown here:

http://fedoraproject.org/wiki/Docs/CustomKernel

Now we get the build tree ready via:

/home/$user> rpmdev-setuptree

This puts a build tree @ /home/$user/rpmbuild that lets you put all the
stuff from your source RPM into the correct spots Fedora/RPM expects for
kernel konstruction.

Okay, so now we need to take care of any build dependencies for our
running installation via this:

/home/$user> su -c 'yum-builddep kernel-2.6.31.12-174.2.3.fc12.src.rpm'

Next, we expand the kernel source tree and build up any archived sources
by executing:

/home/$user> rpm -Uvh kernel-2.6.31.12-174.2.3.fc12.src.rpm

/home/$user> cd rpmbuild/SPECS
/home/$user> rpmbuild -bp --target-'uname -m' kernel.spec

The 'uname -m' substitution didn't really work, so I just put in the
'i686' string from uname in there to get the rpmbuild command to run. Now
we have all the source files expanded and prepared AS IF we were going to
patch and rebuild the kernel. Which we won't. No, sir! We're just making a
copy here.

Now your "new" kernel source code is available under your /home directory
thus --

$user/rpmbuild/BUILD/kernel-$yourflavor/linux-$yourflavor.$yourtarget

Your running kernel probably has a more up to date .config file, so all we
need to do to make sure our source system is configured the same is copy
the .config file from your running installation to the built source
directory above. Now you have a) a copy of the running source, and b) and
.config that is the same, so it SHOULD build and be exactly the same (I
won't test this, and tempt fate).

Finally, for the needs of your 3rd-party software that needs your kernel
source, or at least needs to know where it is, we can do the simple thing,
and make a link in the Usually Suspected Linux Location:

su -c 'ln -s
/home/$user/rpmbuild/BUILD/kernel-$yourflavor/linux-$yourflavor.$yourtarget
/usr/src/linux'


%% ----- the end ----------------%%
Now, I STILL have not been able to build ethercat master from the
mercurial repository (probably because I don't know enough about the GNU
autotools -- see my earlier thread on this), so I would be interested to
know if you succeed at it.

Good luck,

Dusty Clark
MMT Observatory
University of Arizona

> Hi!
>
> I'm new to etherlab, and in the process of setting up my first master.
>
> My system.
> OS: Fedora 12
> Kernel: 2.6.31.5-127
> Ethernet card: Intel Corporation 82567LF Gigabit Network Connection (rev
> 03)
>
>
> Tried to set up the installation of ethercat 1.4.0 with the following
> command:
> /./configure --enable-e1000 --disable-8139too --enable-cycles/
>
> This gave me the output:
> /checking for Linux kernel sources...
> /usr/src/kernels/2.6.31.12-174.2.3.fc12.i686 (Kernel
> 2.6.31.12-174.2.3.fc12.i686)
> checking for kernel for e1000 driver... configure: error: kernel 2.6.31
> not available for e1000 driver!/
>
> The command /lsmod | grep e1000/, gives me this output:
> /e1000e                133776  0
>
> /When checking the web page i found that version 1.4.0 only supports the
> driver up until kernel 2.6.24.
>
> *THE QUESTION:* Should I somehow install kernel 2.6.24 on my system, or
> try using the 1.5 master with kernel 2.6.29?
>
> Appreciate any help...
>
> //John
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>


-- 




More information about the Etherlab-users mailing list