help compiling a driver

I have a couple errors that I can not figure out when trying to compile a driver for a raid card. I have all the needed packages for C and kernel development (make, kernel-headers, etc).

Out put below

jason@D610:~/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux> make
make[1]: Entering directory `/usr/src/linux-2.6.31.5-0.1-obj/i386/default'
make -C ../../../linux-2.6.31.5-0.1 O=/usr/src/linux-2.6.31.5-0.1-obj/i386/default/. modules
  CC [M]  /home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/os_linux.o
  CC [M]  /home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/osm_linux.o
  CC [M]  /home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/div64.o
  CC [M]  /home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/hptinfo.o
  CC [M]  /home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/config.o
  LD [M]  /home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/rr26xx.o
ld: Relocatable linking with relocations from format elf64-x86-64 (/home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/him_odin.o) to format elf32-i386 (/home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/rr26xx.o) is not supported
make[4]: *** [/home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/rr26xx.o] Error 1
make[3]: *** [_module_/home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.31.5-0.1-obj/i386/default'
make: *** [rr26xx.ko] Error 2
jason@D610:~/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux>

What is error 2?

when I run

make install

I get a a few errors but the driver is built and installed. Using the card and have a raid 5 volume set up in but CPU usage is at 100% when do heavy read/write. Maybe if I figure out the errors in the make process I could get better performance?

Thanks for any help…

On 12/06/2009 09:56 PM, mejason69 wrote:
> ld: Relocatable linking with relocations from format elf64-x86-64 (/home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/him_odin.o) to format elf32-i386 (/home/jason/Download/Opensource/rr2640-linux-src-v1.2/product/rr2640/linux/.build/rr26xx.o) is not supported

The Error 2 just comes from Make. The critical error is noted above.
From what I see, this driver includes a binary blob. You are starting
with the x86_64 version of the blob and trying to make a driver for
i386. Grab the i386 version and all should be OK.

Thanks for the help…

The driver I downloaded claims to be for both i386 and x86_64.

http://www.support-highpoint-tech.com/Main/rr26xx/264x/Linux/opensrc/rr2640-linux-src-v1.2-090925-0932.tar.gz

if I run

make ARCH=i386  

or 

make ARCH=x86_64

I get the same results as above.

Like I said the driver works, after a reboot I can see the card and the array but CPU usage is rather high when writing to and from the array. Not sure if that is normal or not.

On 12/07/2009 03:26 PM, mejason69 wrote:
> Like I said the driver works, after a reboot I can see the card and the
> array but CPU usage is rather high when writing to and from the array.
> Not sure if that is normal or not.

That may be the nature of the beast, or you may have the array
misconfigured. If there is a discussion group for that device, you
should probably ask about CPU usage there.

I downloaded the code from the URL you posted and did not get the
error you mentioned. BTW, when you try to go to a newer release, the
driver is unlikely to build at all. I’m running a 2.6.32 kernel and I
get this error

“FATAL: modpost: GPL-incompatible module rr26xx.ko uses GPL-only
symbol ‘mutex_lock_nested’”. The reason for this error is that the
kernel developers have made the routine “mutex_lock_nested” not be
available for drivers that are not released under the GPL. That
situation has changed since your kernel version.

I don’t have the box in front me to check the kernel version, but I am running the stock opensuse 11.2 kernel. When I get back to that box I will fiddle a little more and post if I have any progress or questions…

High Point does not have forums but I opened a ticket with their support. Will ask them about both the compile error and the cpu usage. They provide pre-compiled versions of the driver for opensuse but have not yet updated their site for 11.2.

thanks for the help lwfinger

OK, I reinstalled to the x86_64 version of opensuse 11.2 and the driver compile went much better, no errors. Still have heavy cpu usage but I am starting to think that is normal since this is not a really a true hardware raid card its what is known as a “host controller”.

Now that I have a have a driver, how to do I get the installer to use the driver and install the OS on the array. I have attempted to put it on a usb drive and floppy drive and not look when pressing F6 at install to have it load a driver. Something special I should be doing other than just putting in on the removable media? Config file of some sort maybe?

thanks again for any help

On 12/08/2009 09:36 PM, mejason69 wrote:
>
> OK, I reinstalled to the x86_64 version of opensuse 11.2 and the driver
> compile went much better, no errors. Still have heavy cpu usage but I am
> starting to think that is normal since this is not a really a true
> hardware raid card its what is known as a “host controller”.
>
> Now that I have a have a driver, how to do I get the installer to use
> the driver and install the OS on the array. I have attempted to put it
> on a usb drive and floppy drive and not look when pressing F6 at install
> to have it load a driver. Something special I should be doing other than
> just putting in on the removable media? Config file of some sort maybe?

Getting the installer to put the OS on the array would be a problem as
the driver module you built will not work with the kernel on the CD or
DVD. You can, however, move the existing OS to the raid array. You
will need a separate partition for /boot as GRUB will not be able to
read the array. In addition, you will need to add your driver to the
initrd. You can do that with YaST. The final problem is that whenever
openSUSE issues a new kernel, your system would fail to boot!

As you can see, putting / on the array is not easy. There are very few
files in any file tree other than /home that you would want to have
the protection of raid. If I were setting up the system, I would mount
/home on the array and leave everything else on a non-raid disk. To do
this, make your driver module load on boot (YaST => System =>
/etc/sysconfig Editor). Click on the + next to System and Kernel and
add the module name to the MODULES_LOADED_ON_BOOT. To copy the user
files to the array, log in as root, mount the array (I will use /mnt
as the mount point - substitute accordingly.), create a directory
/mnt/home and copy all the user files with the command

cp -a /home /mnt/home

You should then change the entry in /etc/fstab to mount home in its
new place. Reboot and it should work. One other thing - keep the
sources for the raid driver on a non-raid disk. You will need them to
rebuild the driver when your kernel is updated.

I figured I would end up adding a 4th drive just for booting, was trying to avoid that. Somehow this just seems like something that linux would have covered by now. With Windows Server all i have to do is give it the driver and everything will load on the array.

The updating of kernel issues is one I have worked with before, just need to make sure the system does not auto update and when you manually update look to see if there is a kernel update. If there is a kernel update then I build the driver for it and install before rebooting. But of a pain.

Now my question is, why is the kernel on the installer different from what gets installed? They are both opensuse 11.2 64bit.

How about if I were to build a custom setup in susestudio? Add the drivers there and then install on the array??

On 12/09/2009 10:36 AM, mejason69 wrote:
>
> How about if I were to build a custom setup in susestudio? Add the
> drivers there and then install on the array??

I don’t know anything about susestudio. After doing some reading, it
seems that GRUB can read from the first disk of the array, but only
that one. If it is not available, then the system will not boot. The
article I read was old (2003) and things might have changed.

The reason that the kernel on the installer disk is different than the
current kernel is due to updates/bug fixes for the current one. The
2.6 kernels are very fussy about loading modules that were built for
only a specific version. In 2.4 times, loading was not as restrictive;
however, the feature was abused leading to crashes where a module
problem masqueraded as a problem in the kernel. Similarly, loading a
module that is not GPL taints the kernel. Most kernel developers will
not look at a kernel oops for a tainted kernel. The user must
reproduce the problem without loading non-GPL modules.

Susestuido lets you build custom opensuse appliances, you can add/remove packages, and even virtually test the build before even downloading the image/iso. The technology is really impressive. I posted on the susestudio forum, asking if it was possible to inject the driver some how.

If it seems like its more trouble that its worth I will just throw in the 4th drive and stop wasting time. Still bugs me that this is so inconvenient to get done.

Thanks again for all the help…