2009-07-15 20:20:37

by Philip Prindeville

[permalink] [raw]
Subject: Build instructions for cross-compilation environment

Hi.

I'm the lead developer for Astlinux.

We're doing a kernel bump from 2.6.26.8 to 2.6.27.26, and wanted to take
the opportunity to start using compat-wireless at the same time, because
we need (amongst other things) better mac80211/cfg80211/nl80211 and
AP-mode for the Ath5k chipset (AR5413, et al).

The README included in the tarball (compat-wireless-2.6.30.tar.bz2)
discusses building replacement drivers on the same system and placing
them into updates/.

I'd like to cross-compile this on a system and replace the drivers that
have been deposited by the plain-vanilla kernel build.

Also, a list of what CONFIG_xxx symbols I need to turn off to ensure
that there is no "residue" left over from the kernel build to interfere
with the compat-wireless build would be helpful (or alternatively,
what's the bare essential list of CONFIG_xxx symbols that need to be
enabled to "hook" compat-wireless into an existing kernel).

Looking at the Makefiles, it doesn't seem that cross-compilation is
ready out-of-the-box:

MADWIFI=$(shell $(MODPROBE) -l ath_pci)
OLD_IWL=$(shell $(MODPROBE) -l iwl4965)


Please reply to me directly (or even on Cc). I tried to join the list a
couple of weeks ago, but my request hasn't yet been processed.

Thanks,

-Philip



2009-07-15 22:41:18

by Philip Prindeville

[permalink] [raw]
Subject: Re: Build instructions for cross-compilation environment

--- compat-wireless-2.6.30/Makefile.orig 2009-06-10 17:24:42.000000000 -0700
+++ compat-wireless-2.6.30/Makefile 2009-07-15 14:13:21.000000000 -0700
@@ -1,6 +1,6 @@
export KMODDIR?= updates
KMODDIR_ARG:= "INSTALL_MOD_DIR=$(KMODDIR)"
-ifneq ($(origin $(KLIB)), undefined)
+ifneq ($(origin KLIB), undefined)
KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)"
else
export KLIB:= /lib/modules/$(shell uname -r)
@@ -11,6 +11,8 @@ MODPROBE := /sbin/modprobe
MADWIFI=$(shell $(MODPROBE) -l ath_pci)
OLD_IWL=$(shell $(MODPROBE) -l iwl4965)

+DESTDIR?=
+
ifneq ($(KERNELRELEASE),)

include $(M)/$(COMPAT_CONFIG)
@@ -58,21 +60,25 @@ $(CREL_CHECK):
@touch $@
@md5sum $(COMPAT_CONFIG) > $(CONFIG_CHECK)

-install: uninstall modules
+install: uninstall install-modules install-scripts
+
+install-modules: modules
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) \
modules_install
+
+install-scripts:
@# All the scripts we can use
- @mkdir -p /usr/lib/compat-wireless/
- @install scripts/modlib.sh /usr/lib/compat-wireless/
- @install scripts/madwifi-unload /usr/sbin/
+ @mkdir -p $(DESTDIR)/usr/lib/compat-wireless/
+ @install scripts/modlib.sh $(DESTDIR)/usr/lib/compat-wireless/
+ @install scripts/madwifi-unload $(DESTDIR)/usr/sbin/
@# This is to allow switching between drivers without blacklisting
- @install scripts/athenable /usr/sbin/
- @install scripts/b43enable /usr/sbin/
- @install scripts/iwl-enable /usr/sbin/
- @install scripts/athload /usr/sbin/
- @install scripts/b43load /usr/sbin/
- @install scripts/iwl-load /usr/sbin/
- @if [ ! -z $(MADWIFI) ]; then \
+ @install scripts/athenable $(DESTDIR)/usr/sbin/
+ @install scripts/b43enable $(DESTDIR)/usr/sbin/
+ @install scripts/iwl-enable $(DESTDIR)/usr/sbin/
+ @install scripts/athload $(DESTDIR)/usr/sbin/
+ @install scripts/b43load $(DESTDIR)/usr/sbin/
+ @install scripts/iwl-load $(DESTDIR)/usr/sbin/
+ @if [ ! -z $(MADWIFI) && -z "$(DESTDIR)" ]; then \
echo ;\
echo -n "Note: madwifi detected, we're going to disable it. " ;\
echo "If you would like to enable it later you can run:" ;\
@@ -81,7 +88,7 @@ install: uninstall modules
echo Running athenable ath5k...;\
/usr/sbin/athenable ath5k ;\
fi
- @if [ ! -z $(OLD_IWL) ]; then \
+ @if [ ! -z $(OLD_IWL) && -z "$(DESTDIR)" ]; then \
echo ;\
echo -n "Note: iwl4965 detected, we're going to disable it. " ;\
echo "If you would like to enable it later you can run:" ;\


Attachments:
compat-wireless-makefile.patch (2.40 kB)

2009-07-15 22:11:56

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Build instructions for cross-compilation environment

On Wed, Jul 15, 2009 at 2:51 PM, Bob Copeland<[email protected]> wrote:
> On Wed, Jul 15, 2009 at 4:09 PM, Philip A.
> Prindeville<[email protected]> wrote:
>> Also, a list of what CONFIG_xxx symbols I need to turn off to ensure
>> that there is no "residue" left over from the kernel build to interfere
>> with the compat-wireless build would be helpful (or alternatively,
>> what's the bare essential list of CONFIG_xxx symbols that need to be
>> enabled to "hook" compat-wireless into an existing kernel).
>
> At least CONFIG_{CFG80211,MAC80211}=m but you'll likely need to experiment.

I take it you mean on your currently running kernel?

Your own kernel requirements aren't dramatic. Its actually very
simple. Enable networking (duh), PCI if you want PCI drivers, USB if
you want USB drivers, etc.

Wext is now optional but IIRC I haven't removed that requirement from
compat-wireless. So for now enable that.

Luis

2009-07-15 21:51:33

by Bob Copeland

[permalink] [raw]
Subject: Re: Build instructions for cross-compilation environment

On Wed, Jul 15, 2009 at 4:09 PM, Philip A.
Prindeville<[email protected]> wrote:
> Also, a list of what CONFIG_xxx symbols I need to turn off to ensure
> that there is no "residue" left over from the kernel build to interfere
> with the compat-wireless build would be helpful (or alternatively,
> what's the bare essential list of CONFIG_xxx symbols that need to be
> enabled to "hook" compat-wireless into an existing kernel).

At least CONFIG_{CFG80211,MAC80211}=m but you'll likely need to experiment.

> Looking at the Makefiles, it doesn't seem that cross-compilation is
> ready out-of-the-box:

Perhaps it isn't for the installation stuff, but I've had no problems
building the modules with a cross compiler. And you said you wanted to
customize installation anyway (just copy the built modules under 'kernel'
if that's what you want. It doesn't matter where they live as long as
depmod finds them;'updates' is nice for rollback, however.)

Here's my dumb cross compilation script, make-arm.sh:

#!/bin/bash

DIR=/home/bob/ext/linux-2.6
XGCC=/home/bob/projects/xgcc
export PATH="$XGCC/arm-2008q3/bin/:$PATH"
make ARCH=arm CROSS_COMPILE=arm-none-eabi- KLIB=$DIR KLIB_BUILD=$DIR "$@"

> Please reply to me directly (or even on Cc). ?I tried to join the list a
> couple of weeks ago, but my request hasn't yet been processed.

Perhaps try again? majordomo can be slow but two weeks slow sounds
off...

--
Bob Copeland %% http://www.bobcopeland.com

2009-07-16 16:20:11

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Build instructions for cross-compilation environment

On Wed, Jul 15, 2009 at 3:40 PM, Philip A.
Prindeville<[email protected]> wrote:

Patch applied, thanks.

Luis