Cross Compile compat-drivers

Материал из Toshiba AC100 wiki
Перейти к навигации Перейти к поиску

How to cross-compile compat-drivers package to use with arm android/linux/etc

Wget latest compat-drivers, unpack.

  • Select rt2x00 drivers with command
cd compat-drivers-folder
./scripts/driver-select rt2x00
  • Prepare your kernel
cd kernel-folder
make ARCH=arm CROSS_COMPILE=arm-eabi- paz00_android_defconfig
make ARCH=arm CROSS_COMPILE=arm-eabi- -j20
  • Now compile compat-drivers
cd compat-drivers-folder
make ARCH=arm CROSS_COMPILE=arm-eabi- -j20 KLIB=path-to-kernel-forlder KLIB_BUILD=path-to-kernel-forlder
  • If compilation fails with error like this
include/linux/device.h: In function 'root_device_register':
include/linux/device.h:724: error: 'THIS_MODULE' undeclared (first use in this function)
include/linux/device.h:724: error: (Each undeclared identifier is reported only once
include/linux/device.h:724: error: for each function it appears in.)

Insert your kernel export.h to compat-drivers includes (normal for downstream kernels problem, because of various backported subsys), like made in this patch:

diff --git a/include/linux/compat-2.6.h b/include/linux/compat-2.6.h
index 1e9effb..47f7434 100644
--- a/include/linux/compat-2.6.h
+++ b/include/linux/compat-2.6.h
 <at>  <at>  -43,6 +43,7  <at>  <at>  void backport_dependency_symbol(void);
  * Each compat file represents compatibility code for new kernel
  * code introduced for *that* kernel revision.
  */
+#include </cyanogenmod/kernel/sony/msm8x60/include/linux/export.h>

 #include <linux/compat-2.6.22.h>
 #include <linux/compat-2.6.23.h>

Changes for backports

  • To fix includes
backport-include/linux/module.h:38:#include </home/zombah/src/cm-10/kernel/toshiba/ac100/include/linux/export.h>
  • Backports defconfig draft
CPTCFG_CFG80211=m
CPTCFG_CFG80211_DEFAULT_PS=y
CPTCFG_CFG80211_DEBUGFS=y
CPTCFG_CFG80211_WEXT=y
CPTCFG_MAC80211=m
# CPTCFG_MAC80211_RC_PID is not set
# CPTCFG_MAC80211_RC_MINSTREL is not set
# CPTCFG_MAC80211_RC_DEFAULT_MINSTREL is not set
CPTCFG_MAC80211_DEBUGFS=y
CPTCFG_MAC80211_MESSAGE_TRACING=y
CPTCFG_WLAN=y
CPTCFG_USB_NET_RNDIS_WLAN=m
CPTCFG_RT2X00=m
# CPTCFG_RT2500USB is not set
# CPTCFG_RT73USB is not set
CPTCFG_RT2800USB=m
# CPTCFG_RT2800USB_RT33XX is not set
# CPTCFG_RT2800USB_RT35XX is not set
# CPTCFG_RT2800USB_RT3573 is not set
# CPTCFG_RT2800USB_RT53XX is not set
# CPTCFG_RT2800USB_RT55XX is not set
# CPTCFG_RT2800USB_UNKNOWN is not set
CPTCFG_RT2800_LIB=m
CPTCFG_RT2X00_LIB_USB=m
CPTCFG_RT2X00_LIB=m
CPTCFG_RT2X00_LIB_FIRMWARE=y
CPTCFG_RT2X00_LIB_CRYPTO=y
CPTCFG_RT2X00_LIB_LEDS=y
# CPTCFG_RT2X00_DEBUG is not set

#
# USB Network Adapters
#
CPTCFG_USB_USBNET=m
CPTCFG_USB_NET_CDCETHER=m
CPTCFG_USB_NET_CDC_NCM=m
CPTCFG_USB_NET_CDC_MBIM=m
CPTCFG_USB_NET_RNDIS_HOST=m
CPTCFG_USB_NET_QMI_WWAN=m
CPTCFG_USB_SIERRA_NET=m
CPTCFG_SSB_POSSIBLE=y
  • Compiled modules locations
path/backports-20131011/compat/compat.ko 
path/backports-20131011/drivers/net/usb/cdc_mbim.ko 
path/backports-20131011/drivers/net/usb/cdc_ncm.ko 
path/backports-20131011/drivers/net/usb/qmi_wwan.ko 
path/backports-20131011/drivers/net/usb/rndis_host.ko 
path/backports-20131011/drivers/net/usb/sierra_net.ko 
path/backports-20131011/drivers/net/usb/usbnet.ko 
path/backports-20131011/drivers/net/wireless/rndis_wlan.ko  
path/backports-20131011/drivers/net/wireless/rt2x00/rt2800lib.ko 
path/backports-20131011/drivers/net/wireless/rt2x00/rt2800usb.ko 
path/backports-20131011/drivers/net/wireless/rt2x00/rt2x00lib.ko  
path/backports-20131011/drivers/net/wireless/rt2x00/rt2x00usb.ko  
path/backports-20131011/drivers/usb/class/cdc-wdm.ko 
path/backports-20131011/net/mac80211/mac80211.ko  
path/backports-20131011/net/wireless/cfg80211.ko

Which versions work

compat-wireless-3.4-rc3-1 first version in which timeout loop problem noticed.

looks best for now compat-wireless-3.2.5-1

Fix timeouts