[openib-general] OFED 1.1 Build Issue

Moni Shoua monis at voltaire.com
Wed Nov 1 04:54:17 PST 2006


Vladimir Sokolovsky wrote:

>
> Ramachandra K wrote:
>
>> Moni Shoua wrote:
>>
>>> We already tried to go this way and found that a local 
>>> Module.symvers is not always generated (but we might have missed 
>>> something though).
>>> I suggest that you check that this alternative way works under all 
>>> OSs compilation (SuSE and RedHat to be precise)...
>>>  
>>>
>> I think Module.symvers generation for external modules was added 
>> sometime
>> around 2.6.16, so its not generated on the older kernels (for eg 
>> 2.6.9 kernels
>> on RHEL)
>>
>> In this scenario, when there is no Module.symvers file, I guess the 
>> other
>> option is to use a single Kbuild file to build both modules,
>> as explained in section 7.3 of Documentation/kbuild/modules.txt.
>>
>> But this may not be feasible always. Come to think of it, why does the
>> OFED installation procedure not update the kernel Module.symvers file
>> when it replaces the old kernel modules present in /lib/modules/
>> with the new ones ?
>>
>>> BTW, Why not updating the kernel Module.symvers when kernel-ib-devel 
>>> is installed? This will free the developer from copying it to 
>>> his/hers private directory.
>>>  
>>>
>> It might be a good idea to update the Module.symvers file as part of the
>> normal installation and not only kernel-ib-devel. Because if the kernel
>> modules are being replaced (or new modules are being added), shouldn't
>> the Module.symvers file also be updated ?
>> Regards,
>> Ram
>
> Agree,
> Module.symvers should be updated by kernel-ib RPM.
> So, need to implement Moni's suggestion with light changes: update 
> kernel-ib RPM %post and %preun sections instead of kernel-ib-devel RPM 
> %pre and %postun.
>
> Regards,
> Vladimir
>
I agree although there is no use in updated Module.symvers when the 
devel RPM is not installed.

This is a part of the shell script that updates Module.symvers which you 
can use if you don't find a way how to generate Module.symvers in 2.4 
kernels

    *    for mod in $(find -name *.ko) ; do*
    *        nm -o $mod |grep __crc >> /tmp/syms*
    *        n_mods=$((n_mods+1))*
    *    done*

    *    n_syms=$(wc -l /tmp/syms |cut -f1 -d" ")*
    *    echo found $n_syms InfiniBand symbols in $n_mods InfiniBand
    modules*
    *    n=1*

    *    MOD_SYMVERS_IB=./Module.symvers.ib*
    *    MOD_SYMVERS_PATCH=./Module.symvers.patch*
    *    if [ -f /lib/modules/$K_VER/source/Module.symvers ] ; then*
    *        MOD_SYMVERS_KERNEL=/lib/modules/$K_VER/source/Module.symvers*
    *    elif [ -f /lib/modules/$K_VER/build/Module.symvers ] ; then*
    *        MOD_SYMVERS_KERNEL=/lib/modules/$K_VER/build/Module.symvers*
    *    else*
    *        echo file Module.symvers not found*
    *    fi*
    *    if [ ! -z $MOD_SYMVERS_KERNEL ] ; then *
    *        *
    *        rm -f $MOD_SYMVERS_IB*

    *        while [ $n -le $n_syms ] ; do*
    *            line=$(head -$n /tmp/syms|tail -1)*
    *                        line1=$(echo $line|cut -f1 -d:)*
    *                        line2=$(echo $line|cut -f2 -d:)*
    *                        file=$(echo $line1|cut -f6- -d/)*
    *                        file=$(echo $file|cut -f1 -d.)*

    *            crc=$(echo $line2|cut -f1 -d" ")*
    *            crc=${crc:8}*
    *            sym=$(echo $line2|cut -f3 -d" ")*
    *            sym=${sym:6}*
    *            echo -e  "0x$crc\t$sym\t$file" >> $MOD_SYMVERS_IB*
    *            if [ -z $allsyms ] ; then*
    *                allsyms=$sym*
    *            else*
    *                allsyms="$allsyms|$sym"*
    *            fi*
    *            n=$((n+1))*
    *        done*
    *        egrep -v "$allsyms" $MOD_SYMVERS_KERNEL >> $MOD_SYMVERS_IB*
    *        diff -u $MOD_SYMVERS_KERNEL $MOD_SYMVERS_IB >
    $MOD_SYMVERS_PATCH*
    *        patch -d $(dirname $MOD_SYMVERS_KERNEL)  < $MOD_SYMVERS_PATCH*
    *        mkdir -p /usr/voltaire/backup*
    *        cp $MOD_SYMVERS_PATCH /usr/voltaire/backup*
    *    fi*







More information about the general mailing list