Kernel Modules Build failed

Hi all !
For I couldn’t get any results with ndiswrapper for my Netgear WG111 v1 I browsed the web for updated drivers. I found compat-wireless on wireless.kernel.org, an awesome work has been done there for the WiFi Dongles on Linux. I got with the p54usb drivers everything fine on openSUSE 11.1.
Then the installation process has spent a long time on building the modules and since I recently have suscribed for a Build Service it’s been obviously a good reason to open a compat-wireless package.

Build such modules requires some knowledge, which I’ve been correctly guided through the openSUSE tutorials. here I list them :

  1. Kernel Module Packages - openSUSE
  2. http://developer.novell.com/wiki/images/8/80/Kmpm-code11.pdf

Then my .spec file comes from the Code11 pdf sample.
It’s short but wise, indeed.
Now here’s what OBS log returns (with openSUSE Factory repo) from %build before to exit :

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.22550
+ umask 022
+ cd /usr/src/packages/BUILD
+ /bin/rm -rf /var/tmp/compat-wireless-2.6.30-build
++ dirname /var/tmp/compat-wireless-2.6.30-build
+ /bin/mkdir -p /var/tmp
+ /bin/mkdir /var/tmp/compat-wireless-2.6.30-build
+ cd compat-wireless-2.6.30
+ for flavor in default desktop pae xen
+ rm -rf obj/default
+ cp -r source obj/default
+ make -C /usr/src/linux-obj/i586/default modules M=/usr/src/packages/BUILD/compat-

wireless-2.6.30/obj/default
make: Entering directory `/usr/src/linux-2.6.31-rc6-3-obj/i386/default'
make -C ../../../linux-2.6.31-rc6-3 O=/usr/src/linux-2.6.31-rc6-3-obj/i386/default/. 

modules
make[3]: *** /usr/src/packages/BUILD/compat-wireless-2.6.30/obj/default/: Is a directory. 

Stop.
make[2]: *** [_module_/usr/src/packages/BUILD/compat-wireless-2.6.30/obj/default] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
make: Leaving directory `/usr/src/linux-2.6.31-rc6-3-obj/i386/default'
error: Bad exit status from /var/tmp/rpm-tmp.22550 (%build)


RPM build errors:
cannot open Pubkeys index using db3 - No such file or directory (2)
Bad exit status from /var/tmp/rpm-tmp.22550 (%build)
System halted.

Someone ever used OBS for kernel modules here ?:expressionless:
It seems the kernel source is not linked at all.

Hi
I’ve built a few, but the first step is to see if someone else hasn’t
built it, so search here;
http://software.opensuse.org/search?

If you grab an existing kmp src rpm to look at and see where your going
wrong. Not sure what desktop your using in Gnome you can right click
and extract to see all the files. Also things are a little different in
11.2, so when you searching for compat-wireless, have a search for
au0282 in Factory and grab the au0828-2-12.1.src.rpm one and look at
the spec file.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 14 days 18:49, 2 users, load average: 2.00, 2.05, 2.07
GPU GeForce 8600 GTS Silent - Driver Version: 190.18

broumbroum23, where is your spec-file?

I built kmp package successfully on openSUSE 11.1 but it failed on Factory.

thank you malcolm, google did not found any rpm, or at least I was not able to catch it up.
So compat-wireless is already available in openSUSE Update…

Kent I might try again if the error could be found.

# # norootforbuild  
# Name:                  compat-wireless  
# BuildRequires:         %kernel_module_package_buildreqs  
# License:               GPL  
# Group:                 System/Kernel  
# Summary:               Linux Wireless compatibility package  
# Version:               2.6.30  
# Release:               0  
# Source0:               %name-%version.tar.bz2  
# BuildRoot:             %{_tmppath}/%{name}-%{version}-build  
# %kernel_module_package -x debug -x trace  
# %description  
# Compat-wireless was designed to allow you to install the latest  
# bleeding edge Linux wireless drivers on older kernels. Sometimes you  
# don't want to run bleeding edge wireless and but compat-wireless gives  
# you no other option, that's where the compat-wireless stable snapshots  
# come in.  
#   
# This package allows you install the 2.6.30 Linux wireless  
# drivers on kernels >= 2.6.27.  
#   
# For more information please see:  
#   
# http://wireless.kernel.org/en/users/Download  
# http://wireless.kernel.org/en/users/Download/stable  
# %prep  
# %setup  
# set -- *  
# mkdir source  
# mv "$@" source/  
# mkdir obj  
# %build  
# for flavor in %flavors_to_build; do  
#        rm -rf obj/$flavor  
#        cp -r source obj/$flavor  
#        make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor  
# done  
# %install  
# export INSTALL_MOD_PATH=$RPM_BUILD_ROOT  
# export INSTALL_MOD_DIR=updates  
# for flavor in %flavors_to_build; do  
#        make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor  
# done  
# %changelog  

Well I’m also looking forward to build a .deb modules pkg.
Today I did manage to build my own java project for .deb within the OBS, how an amazing thing to dig… but really a terrific service from SUSE !! Thks

EDIT : compat-wireless build was “expansion error - nothing provides %kernel_module_package_buildreqs” from opensuse 11.1 oss and failed for the mentioned reason with Factory.

from the drivers:wireless area I found the spec.
Added this to the line # BuildRequires:
kernel-source kernel-syms module-init-tools %kernel_module_package_buildreqs

I use %kernel_module_package_buildreq (w/o s at the end).
My package is here.

Now, now… here’s my definite line :

BuildRequires : %kernel_module_package_buildreqs
# kernel-source kernel-syms module-init-tools

Factory has found the macro
and OSS runs without macro and uncommenting the next line :

BuildRequires : 
# kernel_module_package_buildreqs
 kernel-source kernel-syms module-init-tools

Anyway, that issue stays unsolved :

Error 2 make[1]: *** [sub-make] Error 2 make: *** [all] Error 2
make: Leaving directory `/usr/src/linux-2.6.31-rc6-3-obj/i386/default'
error: Bad exit status from /var/tmp/rpm-tmp.22550 (%build)

Hi
But you haven’t defined any %flavors_to_build??

Have a look at my spec file for an au0828 here;
http://www.nopaste.com/p/aj1PG4kOG


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
up 20:49, 2 users, load average: 3.76, 3.00, 2.47
GPU GeForce 8600 GTS Silent - Driver Version: 190.18

Then it looks like this :
https://build.opensuse.org/project/show?project=home%3Abroumbroum23

# norootforbuild
Name:                  compat-wireless
BuildRequires:         %kernel_module_package_buildreqs
# kernel-source kernel-syms module-init-tools
License:               GPL
Group:                 System/Kernel
Summary:               Linux Wireless compatibility package
Version:               2.6.30
Release:               1
Source0:               %name-%version.tar.gz
BuildRoot:             %{_tmppath}/%{name}-%{version}-build
%kernel_module_package -x debug -x trace
%description
Compat-wireless was designed to allow you to install the latest
bleeding edge Linux wireless drivers on older kernels. Sometimes you
don't want to run bleeding edge wireless and but compat-wireless gives
you no other option, that's where the compat-wireless stable snapshots
come in.

This package allows you install the 2.6.30 Linux wireless
drivers on kernels >= 2.6.27.

For more information please see:

http://wireless.kernel.org/en/users/Download
http://wireless.kernel.org/en/users/Download/stable
%prep
%setup
set -- *
mkdir source
mv "$@" source/
mkdir obj
%build
# Set build to default kernel
%if 0%{?suse_version} == 1120
export flavors to build=desktop pae default
%else
export flavors to build=default pae
%endif
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
for flavor in %flavors_to_build; do
       rm -rf obj/$flavor
       cp -r source obj/$flavor
       make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
done
%install
%if 0%{?suse_version} == 1120
export flavor=desktop pae default
%else
export flavor=default pae
%endif
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
       make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor
done
%changelog

Im no C or shell script programmer, I know about PHP and Java much better.
BTW Im wondering how to do the same with debian package, how to define and find the uname -r in the debian/control and debian/dsc file.

I missed the macro

%if 0%{?suse_version} == 1120
%suse_kernel_module_package -x desktop pae default
%else
%suse_kernel_module_package -x default pae
%endif

in the place of %kernel_module_package -x debug -x trace
hope this helps. building’s been scheduled…

Hi
Lets see (crossing fingers) By adding the suse_version it means you can
use one spec file for other releases, arches, distros with one spec
file.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.2 Milestone 5 (i586) Kernel 2.6.31-rc6-3-desktop
up 1 day 5:22, 2 users, load average: 0.17, 0.19, 0.15
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

make[3]:
*** /usr/src/packages/BUILD/compat-wireless-2.6.30/obj/default/: Is a
directory. Stop.

Help please, What does this paragraph do?

%setup
set -- *
mkdir source
mv "$@" source/ # <-- this mv what?

Then this might not work with the source dir :

for flavor in %flavors_to_build; do
       rm -rf obj/$flavor
       cp -r source obj/$flavor
       make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
done

and hence I changed it to :

for flavor in %flavors_to_build; do
       rm -rf obj/$flavor
       cp -r . obj/$flavor <-- here we should cp all compat-wireless dir files, don't we?
       make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
done

Hi
The $@ is just the glob created by the set command to copy all the
files in one hit to source directory.

This spec file is just for building individual modules, so I think your
better having a look at this compat-wireless src rpm located here
http://download.opensuse.org/repositories/home:/Akoellh:/compat-wireless_STABLE/openSUSE_11.1/src/


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
up 1 day 21:57, 2 users, load average: 0.19, 0.12, 0.09
GPU GeForce 8600 GTS Silent - Driver Version: 190.18

hi again!
Well I managed to make the build occur, compilation goes well (and fast!!) . What I did realize, is to stick on the readme.file from compat-wireless

  1. make
  2. make install
  3. make unload

:

# norootforbuild
Name:                  compat-wireless
BuildRequires:       kernel-source kernel-syms module-init-tools
 # %kernel_module_package_buildreqs
License:               GPL
Group:                 System/Kernel
Summary:               Linux Wireless compatibility package
Version:               2.6.30
Release:               1
Source0:               %name-%version.tar.gz
BuildRoot:             %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} == 1120
%suse_kernel_module_package -x desktop pae default
%else
%suse_kernel_module_package -x default pae
%endif
%description
Compat-wireless was designed to allow you to install the latest
bleeding edge Linux wireless drivers on older kernels. Sometimes you
don't want to run bleeding edge wireless and but compat-wireless gives
you no other option, that's where the compat-wireless stable snapshots
come in.

This package allows you install the 2.6.30 Linux wireless
drivers on kernels >= 2.6.27.

For more information please see:

http://wireless.kernel.org/en/users/Download
http://wireless.kernel.org/en/users/Download/stable
%prep
%setup
set -- *
mkdir source
mv "$@" source/
mkdir obj
/sbin/depmod -a
%build
# Set build to default kernel
%if 0%{?suse_version} == 1120
export flavors to build=desktop pae default
%elsea
export flavors to build=default pae
%endif
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
for flavor in %flavors_to_build; do
       rm -rf obj/$flavor
       cp -r source obj/$flavor
       cd obj/$flavor
	make KLIB=%{kernel_source $flavor} \
	   KLIB_BUILD=%{kernel_source $flavor}
	# make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
       cd ../../.
done
%install
%if 0%{?suse_version} == 1120
export flavor=desktop pae default
%else
export flavor=default pae
%endif
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
        cd obj/$flavor
	make KLIB=%{kernel_source $flavor} \
	   KLIB_BUILD=%{kernel_source $flavor} install
       # make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor
        cd ../../.
done
%changelog

see that make -C %{kersrc} modules … was not correct.anyway compile is done but then installing faild because modules.dep wasn’t found; then I added a call to depmod which fails :

+ /sbin/depmod -a
WARNING: Couldn't open directory /lib/modules/2.6.27.29-0.1-xen: No such file or directory
FATAL: Could not open /lib/modules/2.6.27.29-0.1-xen/modules.dep.temp for writing: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.31341 (%prep)

KLIB var were got from Download - Linux Wireless

thank you
just found compat-wireless in OBS https://build.opensuse.org/package/show?package=compat-wireless&project=home%3AAkoellh%3Acompat-wireless_STABLE . I see the spec has a bunch of adds… :sarcastic: