我需要构建这个无线网络驱动程序适用于 Apine 3.12 x86_64。我通过以下命令安装 gcc 和 linux 标头:
apk add --update alpine-sdk linux-headers
但是当我尝试构建模块时失败并返回此错误:
localhost:~/rtl8188eus# make all
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.4.43-1-lts/build M=/root/rtl8188eus modules
make[1]: *** /lib/modules/5.4.43-1-lts/build: No such file or directory. Stop.
make: *** [Makefile:1911: modules] Error 2
Alpine 中的接缝内核头具有与其他 dsitros 完全不同的结构。我搜索了另一个内核头文件包,但除了linux-headers
.
如果有人有在 Alpine Linux 中编译 mod(特别是驱动程序)的经验,请逐步描述。
答案1
构建无法正常工作,因为您只安装了标头而不是内核源代码。查看输出,您正在使用 linux-lts 内核,那么您需要安装 linux-lts-dev。
您可以遵循一个简单的“操作方法”:
- 安装所需的软件包:
~# apk add alpine-sdk linux-lts-dev
- 克隆存储库并开始构建:
~# git clone https://github.com/lwfinger/rtl8188eu.git
~# cd rtl8188eu
~# make all
~/rtl8188eu# make all
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.4.43-1-lts/build M=/root/rtl8188eu modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.43-1-lts'
CC [M] /root/rtl8188eu/core/rtw_ap.o
CC [M] /root/rtl8188eu/core/rtw_br_ext.o
CC [M] /root/rtl8188eu/core/rtw_cmd.o
CC [M] /root/rtl8188eu/core/rtw_debug.o
CC [M] /root/rtl8188eu/core/rtw_efuse.o
...
...
LD [M] /root/rtl8188eu/8188eu.o
Building modules, stage 2.
MODPOST 1 modules
CC [M] /root/rtl8188eu/8188eu.mod.o
LD [M] /root/rtl8188eu/8188eu.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.43-1-lts'
- 安装模块:
~# make install
install -p -m 644 8188eu.ko /lib/modules/5.4.43-1-lts/kernel/drivers/net/wireless
cp rtl8188eufw.bin /lib/firmware/.
/sbin/depmod -a 5.4.43-1-lts
mkdir -p /lib/firmware/rtlwifi
cp rtl8188eufw.bin /lib/firmware/rtlwifi/.
这是 modinfo 的输出
# modinfo 8188eu
filename: /lib/modules/5.4.43-1-lts/kernel/drivers/net/wireless/8188eu.ko
version: v4.1.4_6773.20130222
author: Realtek Semiconductor Corp.
description: Realtek Wireless Lan Driver
license: GPL
srcversion: 8F9A46E87B6F34EB9DB744D
alias: usb:v0B05p18F0d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2C4Ep0102d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2357p0111d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2357p010Cd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v056Ep4008d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2001p331Bd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2001p3311d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2001p3310d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2001p330Fd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0DF6p0076d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v07B8p8179d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDApF179d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0179d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp8179d*dc*dsc*dp*ic*isc*ip*in*
depends: usbcore
retpoline: Y
name: 8188eu
vermagic: 5.4.43-1-lts SMP mod_unload modversions
parm: rtw_ips_mode:The default IPS mode (int)
parm: ifname:The default name to allocate for first interface (charp)
parm: if2name:The default name to allocate for second interface (charp)
parm: rtw_initmac:charp
parm: rtw_channel_plan:int
parm: rtw_chip_version:int
parm: rtw_rfintfs:int
parm: rtw_lbkmode:int
parm: rtw_network_mode:int
parm: rtw_channel:int
parm: rtw_mp_mode:int
parm: rtw_wmm_enable:int
parm: rtw_vrtl_carrier_sense:int
parm: rtw_vcs_type:int
parm: rtw_busy_thresh:int
parm: rtw_led_enable:int
parm: rtw_ht_enable:int
parm: rtw_cbw40_enable:int
parm: rtw_ampdu_enable:int
parm: rtw_rx_stbc:int
parm: rtw_ampdu_amsdu:int
parm: rtw_lowrate_two_xmit:int
parm: rtw_rf_config:int
parm: rtw_power_mgnt:int
parm: rtw_smart_ps:int
parm: rtw_low_power:int
parm: rtw_wifi_spec:int
parm: rtw_antdiv_cfg:int
parm: rtw_antdiv_type:int
parm: rtw_enusbss:int
parm: rtw_hwpdn_mode:int
parm: rtw_hwpwrp_detect:int
parm: rtw_hw_wps_pbc:int
parm: rtw_max_roaming_times:The max roaming times to try (uint)
parm: rtw_fw_iol:FW IOL (int)
parm: rtw_mc2u_disable:int
parm: rtw_80211d:Enable 802.11d mechanism (int)
parm: rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)
parm: debug:Set debug level (1-9) (default 1) (int)
希望能帮助到你。
.: 弗朗西斯科