.ko文件未创建

时间:2017-07-15 03:46:43

标签: linux linux-kernel kernel openwrt

我正在尝试为openwrt内核编译模块。这是模块的Makefile:

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=mt7628
PKG_REV:=5
PKG_TYPE:=p4rev
PKG_FIX:=113862
PKG_VERSION:=$(PKG_TYPE)-$(PKG_FIX)
PKG_RELEASE:=20150605

PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/i80s/mtk-sources/releases/download/v1.0-vanilla
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2

PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

PKG_KCONFIG:=RALINK_MT7628 \
    MT_WIFI MT_WIFI_PATH FIRST_IF_EEPROM_PROM FIRST_IF_EEPROM_EFUSE \
    FIRST_IF_EEPROM_FLASH RT_FIRST_CARD_EEPROM RT_SECOND_CARD_EEPROM \
    MULTI_INF_SUPPORT WIFI_BASIC_FUNC WSC_INCLUDED WSC_V2_SUPPORT \
    DOT11N_DRAFT3 DOT11W_PMF_SUPPORT LLTD_SUPPORT QOS_DLS_SUPPORT \
    WAPI_SUPPORT IGMP_SNOOP_SUPPORT BLOCK_NET_IF RATE_ADAPTION \
    NEW_RATE_ADAPT_SUPPORT AGS_SUPPORT IDS_SUPPORT WIFI_WORKQUEUE \
    WIFI_SKB_RECYCLE LED_CONTROL_SUPPORT ATE_SUPPORT MEMORY_OPTIMIZATION \
    UAPSD RLT_MAC RLT_BBP RLT_RF RTMP_MAC RTMP_BBP RTMP_RF RTMP_PCI_SUPPORT \
    RTMP_USB_SUPPORT RTMP_RBUS_SUPPORT WIFI_MODE_AP WIFI_MODE_STA \
    WIFI_MODE_BOTH  MT_AP_SUPPORT WDS_SUPPORT MBSS_SUPPORT \
    NEW_MBSSID_MODE ENHANCE_NEW_MBSSID_MODE APCLI_SUPPORT \
    MAC_REPEATER_SUPPORT LLTD_SUPPORT COC_SUPPORT MT_MAC SNIFFER_SUPPORT 
PKG_CONFIG_DEPENDS:=$(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),CONFIG_$(c)))

include $(INCLUDE_DIR)/package.mk

define KernelPackage/mt7628
  CATEGORY:=Ralink Properties
  TITLE:=Ralink mt7628 wifi AP driver
  FILES:=$(PKG_BUILD_DIR)/build/mt7628.ko
  AUTOLOAD:=$(call AutoLoad,91,mt7628)
  SUBMENU:=Drivers
  DEPENDS:=+uci2dat +8021xd
  MENU:=1
endef

define KernelPackage/mt7628/config
    source "$(SOURCE)/config.in"
endef

define P4/Info
  P4URL:=//Embedded_WIFI/MP/MT7628/rlt_wifi/
endef

define P4/Release
  make -C embedded release CHIPSET=mt7628 MODE=AP RELEASE=DPA
  mkdir -p build
  cp embedded/mt_wifi_ap/Makefile build/Makefile
  cp embedded/mt_wifi_ap/Kconfig build/Kconfig
  mv embedded/DPA src
  tar cjf mt7628.tar.bz2 build src
endef

define Build/Compile
    $(MAKE) -C "$(LINUX_DIR)" \
        CROSS_COMPILE="$(TARGET_CROSS)" \
        ARCH="$(LINUX_KARCH)" \
        SUBDIRS="$(PKG_BUILD_DIR)/build" \
        $(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),CONFIG_$(c)=$(CONFIG_$(c))))\
        CONFIG_SUPPORT_OPENWRT=y \
        modules
endef

define KernelPackage/mt7628/install
    $(INSTALL_DIR) $(1)/lib/wifi/
    $(INSTALL_BIN) ./files/mt7628.sh ./files/ralink_common.sh $(1)/lib/wifi/
    $(INSTALL_DIR) $(1)/etc/wireless/mt7628/
    $(INSTALL_BIN) ./files/mt7628.dat $(1)/etc/wireless/mt7628/
    -$(INSTALL_BIN) ./files/mt7628.eeprom.bin $(1)/etc/wireless/mt7628/ 
    echo p$(P4REV) > $(1)/etc/wireless/mt7628/version
endef

$(eval $(call KernelPackage,mt7628))

我认为Makefile没有任何问题。这是错误日志:

Pastebin URL

我不知道出了什么问题,我对Linux内核和模块了解不多,但我知道没有名字的文件夹:

  

.pkgdir

帮帮我们。我被卡住了。我真的需要这个工作。谢谢。

1 个答案:

答案 0 :(得分:1)

您遇到安装错误。也许一个将被复制的文件不存在。 检查是否所有文件都将复制到以下部分:

define KernelPackage/mt7628/install
    $(INSTALL_DIR) $(1)/lib/wifi/
    $(INSTALL_BIN) ./files/mt7628.sh ./files/ralink_common.sh $(1)/lib/wifi/
    $(INSTALL_DIR) $(1)/etc/wireless/mt7628/
    $(INSTALL_BIN) ./files/mt7628.dat $(1)/etc/wireless/mt7628/
    $(INSTALL_BIN) ./files/mt7628.eeprom.bin $(1)/etc/wireless/mt7628/ 
    echo p$(P4REV) > $(1)/etc/wireless/mt7628/version
endef

存在。