How to make his own kernel flavor ?

Hi,

I successfully compiled my own kernel for my machine (almost no module to load ^_^) : 2.6.37.6-0.7-hpmini
But there are some proprietary drivers : nvidia and broadcom-wl.
For nvidia, the driver installer automatically detect the kernel, compile the nvidia module and install it.
For broadcom : how to I compile it with my kernel and install it ?? I tried :


rpmbuild --rebuild broadcom-wl-5.100.82.38-7.pm.9.7.src.rpm

But I get only kernel module for opensuse flavor (broadcom-wl-kmp-default-5.100.82.38_k2.6.37.6_0.7-7.pm.9.7.i586.rpm , broadcom-wl-kmp-desktop-5.100.82.38_k2.6.37.6_0.7-7.pm.9.7.i586.rpm , etc …).

What can I do to have my own broadcom-wl-kmp-hpmini-5.100.82.38_k2.6.37.6_0.7-7.pm.9.7.i586.rpm ?? I supposed that it is related to how I can get may own kernel-desktop-hpmini-2.6.37.6-0.7.1.rpm ??

Regards.

Hi
You need to modify the spec file to include your ‘flavor’ unpack the
rpm and copy the files to /usr/src/packages/SOURCES and use rpmbuild
-ba <spec_file> to build the new rpm.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 1:47, 4 users, load average: 0.03, 0.24, 0.29
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

Is there a cleaner way ? Because I don’t want to hack each .spec file of kernel related packages (even that won’t be more than the number of finger in the hand, I know) ?
I ssaw in the spec file :

for flavor in %flavors_to_build; do
    rm -rf obj/$flavor
    cp -r source obj/$flavor
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
       M=$PWD/obj/$flavor V=1
done

I suppose that “%flavors_to_build” is defined somehow in OpenSuse and rpmbuild use it ?
I created a link from my kernel build folder to /usr/src/linux-obj/%_target_cpu/myflavor but when I rebuild the broadcom rpm, it doesn’t seems to care :frowning:

Hi
Further up the spec file before %prep there should be a line like;


%suse_kernel_module_package -x desktop default pae -p %_sourcedir/preamble

There is probably an rpm option you can use (have no idea as I use the
build service and osc for rpms) to pass when rebuilding to add the
flavor.

There is nothing to stop you creating an account on OBS, create a
package and just only build locally.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 4:03, 4 users, load average: 0.08, 0.32, 0.32
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

There is a “%suse_kernel_module_package” but without any flavor, desktop, default, xen, … :frowning:
Here is the complete .spec file :


# vim: set ts=4 sw=4 et:

%ifarch x86_64
%define driverarch 64
%else
%define driverarch 32
%endif
%define underversion 5_100_82_38

Name:           broadcom-wl
BuildRequires:  kernel-source kernel-syms module-init-tools
License:        Proprietary
Group:          System/Kernel
Summary:        Wireless driver for Broadcom 43xx series of chips
Version:        5.100.82.38
Release:        7.pm.9.7
Source0:        hybrid-portsrc_x86_%{driverarch}-v%{underversion}.tar.gz
Source1:        README.SuSE
Source2:        broadcom-wl-blacklist
Patch0:         broadcom-wl-5.100.82.38-fix-linux-2.6.37.patch
BuildRoot:      %{_tmppath}/%{name}-%version-build
URL:            http://www.broadcom.com/support/802.11/linux_sta.php
Provides:       wl-kmod-common = %{version}
Requires:       broadcom-wl-kmp
ExclusiveArch:  %ix86 x86_64

%suse_kernel_module_package kdump um ec2

%description
These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux®
device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4321-,
and BCM4322-based hardware.

NOTE:           You must read the LICENSE.TXT file  before using this software.

%package KMP
Group:          System/Kernel
Summary:        Wireless driver for Broadcom 43xx series of chips

%description KMP
These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux®
device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4321-,
and BCM4322-based hardware.

NOTE:           You must read the LICENSE.TXT file  before using this software.

%prep
%setup -q -c hybrid-portsrc-x86_%driverarch-v%{underversion}
%patch0 -p1

set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
for flavor in hpmini; do
    rm -rf obj/$flavor
    cp -r source obj/$flavor
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
       M=$PWD/obj/$flavor V=1
done

%install
# blacklist
mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d/
mkdir -p %{buildroot}%{_docdir}/%{name}/
install -p -m0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/modprobe.d/
install -p -m0644 %{SOURCE1} %{buildroot}%{_docdir}/%{name}/
install -p -m0644 source/lib/LICENSE.txt %{buildroot}%{_docdir}/%{name}/

%__sed 's/\r$//' %{buildroot}%{_docdir}/%{name}/LICENSE.txt

%if %suse_version >= 1120
mv %buildroot/%{_sysconfdir}/modprobe.d/broadcom-wl-blacklist %buildroot/%{_sysconfdir}/modprobe.d/50-broadcom-wl-blacklist.conf
%endif


# Kernel module
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
     make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
        M=$PWD/obj/$flavor
done

%clean
%{?buildroot:%__rm -rf "%{buildroot}"}

%files
%defattr(-,root,root)
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/LICENSE.txt
%{_docdir}/%{name}/README.SuSE
%if %suse_version >= 1120
%config(noreplace) %{_sysconfdir}/modprobe.d/50-broadcom-wl-blacklist.conf
%else
%config(noreplace) %{_sysconfdir}/modprobe.d/broadcom-wl-blacklist
%endif

%changelog
...]

I don’t know OBS. As you said, it is possible for me to make package online ? It will support the kernel that I have locally ? If that the case, I will try it. Thanks.

Hi
Just add a -x option with your ‘flavor’ to the macro;


%suse_kernel_module_package -x hpmini kdump um ec2

Change the other line back to what it was not hpmini

It can’t be built on OBS, only locally.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 13:02, 6 users, load average: 0.05, 0.05, 0.13
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

Hi,

I get it work by faking a flavor :
I create a folder /usr/src/linux-obj/i386/hpmini
I compile and install my kernel from there
Reboot (seems to be important)
Then “rpmbuild --rebuild broadcom-wl-5.100.82.38-7.pm.9.7.src.rpm” create a -kmp-hpmini-

I will try your advice when I got sometime. For now I’m stuck with another problem :-p :
modprobe: FATAL: Could not load /lib/modules…/modules.dep