Проблема при попытке кросс-скомпилировать драйвер Ethernet на старом ядре Linux

Я в настоящее время пытаюсь кросс-скомпилировать сетевой драйвер против старого ядра Linux в версии 2.6.27.7, но сбоях компиляции и печати:

make[1]: entering directory « /home/johann/Desktop/linux-2.6.27.7 »
Building modules, stage 2.
MODPOST 0 modules
make[1]: leaving directory « /home/johann/Desktop/linux-2.6.27.7 »

Управление, которое я выполнил для получения этого, было принято от readme, найденного с источниками:

make KSRC=<source> KDIR=<build>

Вот то, как это похоже:

#
# Makefile to build the be2net network driver
#

# find a source path that exists among the possible paths
ver = $(shell uname -r)
paths := /lib/modules/$(ver)/source /lib/modules/$(ver)/build
exists = $(shell [ -e $(path)/include/linux ] && echo $(path))
paths := $(foreach path, $(paths), $(exists))
ifeq (,$(KSRC))
    KSRC := $(firstword $(paths))
endif

# ************** Header checks ********************
ifneq (,$(shell grep -o alloc_etherdev_mqs $(KSRC)/include/linux/etherdevice.h))
    EXTRA_CFLAGS += -DALLOC_ETHDEV_MQS_defined
endif

ifneq (,$(shell grep -o alloc_etherdev_mq $(KSRC)/include/linux/etherdevice.h))
    EXTRA_CFLAGS += -DALLOC_ETHDEV_MQ_defined
endif

ifneq (,$(shell grep -o netif_set_real_num_rx_queues $(KSRC)/include/linux/netdevice.h))
    EXTRA_CFLAGS += -DNETIF_SET_REAL_NUM_RX_QS_defined
endif

ifneq (,$(shell grep -o PCI_DEV_FLAGS_ASSIGNED $(KSRC)/include/linux/pci.h))
    EXTRA_CFLAGS += -DPCI_FLAGS_ASSIGNED_defined
endif

ifneq (,$(shell grep -o skb_frag_set_page $(KSRC)/include/linux/skbuff.h))
    EXTRA_CFLAGS += -DSKB_FRAG_API_defined
endif

ifneq (,$(shell grep -o skb_frag_size $(KSRC)/include/linux/skbuff.h))
    EXTRA_CFLAGS += -DSKB_FRAG_SIZE_defined
endif

ifneq (,$(shell grep -o netdev_alloc_skb_ip_align $(KSRC)/include/linux/skbuff.h))
    EXTRA_CFLAGS += -DALLOC_SKB_IP_ALIGN_defined
endif

ifneq (,$(shell grep -o skb_record_rx_queue $(KSRC)/include/linux/skbuff.h))
    EXTRA_CFLAGS += -DSKB_RECORD_RX_QUEUE_defined
endif

ifneq (,$(shell grep -o rxhash $(KSRC)/include/linux/skbuff.h))
    EXTRA_CFLAGS += -DRXHASH_defined
endif

#GRO is usable only when full implementation is available
ifneq (,$(shell grep -o napi_get_frags $(KSRC)/include/linux/netdevice.h))
    EXTRA_CFLAGS += -DGRO_defined
endif

ifneq (,$(shell grep -o netdev_alloc_skb $(KSRC)/include/linux/skbuff.h))
    EXTRA_CFLAGS += -DALLOC_SKB_defined
endif

ifneq (,$(shell grep -o dev_mc_list $(KSRC)/include/linux/netdevice.h))
    EXTRA_CFLAGS += -DDEV_MC_LIST_defined
endif

ifneq (,$(shell grep -o pcie_set_readrq $(KSRC)/include/linux/pci.h))
    EXTRA_CFLAGS += -DPCIE_SET_READRQ_defined
endif

ifneq (,$(shell grep -so vlan_group_set_device $(KSRC)/include/linux/if_vlan.h $(KSRC)/net/8021q/vlan.h))
    EXTRA_CFLAGS += -DVLAN_GRP_SET_DEV_defined
endif

ifneq (,$(shell grep -o "struct vlan_group" $(KSRC)/include/linux/if_vlan.h))
    EXTRA_CFLAGS += -DVLAN_GRP_defined
endif

ifeq (,$(shell grep -o "vlan_hwaccel_receive_skb" $(KSRC)/include/linux/if_vlan.h))
    EXTRA_CFLAGS += -DUSE_NEW_VLAN_MODEL
endif

ifneq (,$(shell grep -o ndo_set_vf_mac $(KSRC)/include/linux/netdevice.h))
    EXTRA_CFLAGS += -DNDO_VF_CFG_defined
endif

ifneq (,$(shell grep -o ndo_set_features $(KSRC)/include/linux/netdevice.h))
    EXTRA_CFLAGS += -DNDO_SET_FEATURES_defined
endif

ifneq (,$(shell grep -so "ethtool_cmd_speed_set" $(KSRC)/include/linux/ethtool.h \
                        $(KSRC)/include/uapi/linux/ethtool.h))
    EXTRA_CFLAGS += -DETHTOOL_CMD_SPEED_SET_defined
endif

ifneq (,$(shell grep -so "ethtool_cmd_speed" $(KSRC)/include/linux/ethtool.h \
                    $(KSRC)/include/uapi/linux/ethtool.h))
    EXTRA_CFLAGS += -DETHTOOL_CMD_SPEED_defined
endif

ifneq (,$(shell grep -o "ethtool_phys_id_state" $(KSRC)/include/linux/ethtool.h))
    EXTRA_CFLAGS += -DPHYS_ID_STATE_defined
endif

ifneq (,$(shell grep -o "flash_device" $(KSRC)/include/linux/ethtool.h))
    EXTRA_CFLAGS += -DETHTOOL_FLASH_defined
endif

ifneq (,$(shell grep -o "get_sset_count" $(KSRC)/include/linux/ethtool.h))
    EXTRA_CFLAGS += -DETHTOOL_SSET_COUNT_defined
endif

ifneq (,$(shell grep -o "set_dump" $(KSRC)/include/linux/ethtool.h))
    EXTRA_CFLAGS += -DETHTOOL_SET_DUMP_defined
endif

ifneq (,$(shell grep -o "ethtool_ops_ext" $(KSRC)/include/linux/ethtool.h))
    EXTRA_CFLAGS += -DETHTOOL_OPS_EXT_defined
endif

ifneq (,$(shell grep -o "pci_enable_pcie_error_reporting" $(KSRC)/include/linux/aer.h))
    EXTRA_CFLAGS += -DAER_REPORTING_defined
endif

ifneq (,$(shell grep -o "pci_physfn" $(KSRC)/include/linux/pci.h))
    EXTRA_CFLAGS += -DPCI_PHYSFN_defined
endif

ifneq (,$(shell grep -o "set_rxnfc" $(KSRC)/include/linux/ethtool.h))
    EXTRA_CFLAGS += -DETHTOOL_RXNFC_OPS_defined
endif

ifneq (,$(shell grep -o ndo_get_stats64 $(KSRC)/include/linux/netdevice.h))
    EXTRA_CFLAGS += -DNDO_GET_STATS64_defined
endif

ifneq (,$(shell grep -o txq_trans_update $(KSRC)/include/linux/netdevice.h))
    EXTRA_CFLAGS += -DTXQ_TRANS_UPDATE_defined
endif
# ************* End header checks *****************

# ************* Targets ***************************
ifeq ($(KERNELRELEASE),)
ifeq ($(KDIR),)
    KDIR ?= /lib/modules/`uname -r`/build
endif   
default:
    @$(MAKE) -C$(KDIR) M=$$PWD
clean:
    @$(MAKE) -C$(KDIR) M=$$PWD clean
else
obj-$(CONFIG_BE2NET) += be2net.o
be2net-y :=  be_main.o be_cmds.o be_ethtool.o be_compat.o be_misc.o inet_lro.o
endif
# ************* End Targets ************************

Я не видел $ (CONFIG_BE2NET) переменная, объявленная до ее использования, например.

5
04.01.2020, 13:25
1 ответ

Одно возможное обходное решение - Вы, заменяют obj-$ (CONFIG_BE2NET) + = be2net.o с obj-m + = be2net.o

0
27.01.2020, 20:44

Теги

Похожие вопросы