I need to build this wifi driver for Apine 3.12 x86_64. I install gcc and linux headers by this commands:

apk add --update alpine-sdk linux-headers

But when I tried to build the module it was failed and returned this error:

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

It seams kernel headers in Alpine has completely different structure with other dsitros. I searched to find a another package for kernel headers but I couldn't found any install-able package except linux-headers.

If anybody has experience in compiling mods (specially drivers) in Alpine Linux please describe it step by step.

1 Answer 1


The build is not working because you have installed only the headers and not the kernel source. Looking at your output, you are using linux-lts kernel, then you need to install linux-lts-dev.

A simple "how to" you can follow:

  1. Install the needed packages:
~# apk add alpine-sdk linux-lts-dev
  1. Clone the repository and start the build:
~# 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'
  1. Install the module:
~# 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/.

This is the output of 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)

Hope it helps.

.: Francesco

  • This is helpful, but linux-lts-dev is not the kernel source package. It only provides /usr/src/linux-headers-<version>-lts/ Commented Jun 21 at 1:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .