Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build process does not match instructions, built modules have unknown symbols #10

Open
TheOneWhoseUsernameWasTaken opened this issue Sep 21, 2020 · 2 comments

Comments

@TheOneWhoseUsernameWasTaken

I was trying to use this module for my Logilink WL0238 USB adapter (see aircrack-ng/rtl8812au#721).

According to the README, and ignoring the firmware for a moment, I'm supposed to do:

make
insmod rtw.ko
insmod rtwusb.ko

The result of that process is:

# LC_ALL=C make
make -C /lib/modules/5.4.51-v7l+/build M=/root/rtw88-usb-development-chipset-rtl8822cu
make[1]: Entering directory '/usr/src/linux-headers-5.4.51-v7l+'
  AR      /root/rtw88-usb-development-chipset-rtl8822cu/built-in.a
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/main.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/mac80211.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/util.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/debug.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/tx.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rx.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/mac.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/phy.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/coex.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/efuse.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/fw.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/ps.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/sec.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/bf.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/wow.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/regd.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_core.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8822b.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8822b_table.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822b.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8822be.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822be.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8822bu.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822bu.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8822c.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8822c_table.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822c.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8822ce.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822ce.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8822cu.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822cu.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8723d.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8723d_table.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8723d.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw8723de.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8723de.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/pci.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_pci.o
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/usb.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_usb.o
  Building modules, stage 2.
  MODPOST 11 modules
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8723d.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8723d.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8723de.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8723de.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822b.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822b.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822be.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822be.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822bu.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822bu.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822c.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822c.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822ce.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822ce.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822cu.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_8822cu.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_core.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_core.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_pci.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_pci.ko
  CC [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_usb.mod.o
  LD [M]  /root/rtw88-usb-development-chipset-rtl8822cu/rtw88_usb.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.51-v7l+'

As you can see, no rtw.ko or rtwusb.ko are ever built. And sure enough:

# insmod rtw88.ko
insmod: ERROR: could not load module rtw88.ko: No such file or directory
# insmod rtw88usb.ko
insmod: ERROR: could not load module rtw88usb.ko: No such file or directory

There are other modules (e.g. rtw88_usb.ko, rtw88_8822cu.ko, rtw88_core.ko, etc.). But trying to load them leads to the dreaded "unknown symbols in module" error:

# find -iname '*.ko'
./rtw88_8822be.ko
./rtw88_8822bu.ko
./rtw88_8822c.ko
./rtw88_core.ko
./rtw88_8822cu.ko
./rtw88_8822b.ko
./rtw88_8723d.ko
./rtw88_pci.ko
./rtw88_8723de.ko
./rtw88_usb.ko
./rtw88_8822ce.ko

# insmod rtw88_core.ko
insmod: ERROR: could not insert module rtw88_core.ko: Unknown symbol in module

# dmesg | grep rtw88_core
[ 1388.927009] rtw88_core: Unknown symbol ieee80211_start_tx_ba_cb_irqsafe (err -2)
[ 1388.927073] rtw88_core: Unknown symbol ieee80211_txq_get_depth (err -2)
[ 1388.927195] rtw88_core: Unknown symbol ieee80211_probereq_get (err -2)
[ 1388.927249] rtw88_core: Unknown symbol ieee80211_iterate_stations_atomic (err -2)
[ 1388.927293] rtw88_core: Unknown symbol ieee80211_start_tx_ba_session (err -2)
[ 1388.927377] rtw88_core: Unknown symbol ieee80211_nullfunc_get (err -2)
[ 1388.927429] rtw88_core: Unknown symbol ieee80211_pspoll_get (err -2)
[ 1388.927481] rtw88_core: Unknown symbol ieee80211_register_hw (err -2)
[ 1388.927572] rtw88_core: Unknown symbol ieee80211_find_sta (err -2)
[ 1388.927616] rtw88_core: Unknown symbol ieee80211_iter_keys (err -2)
[ 1388.927673] rtw88_core: Unknown symbol ieee80211_tx_status_irqsafe (err -2)
[ 1388.927757] rtw88_core: Unknown symbol ieee80211_stop_tx_ba_cb_irqsafe (err -2)
[ 1388.927813] rtw88_core: Unknown symbol wiphy_to_ieee80211_hw (err -2)
[ 1388.927863] rtw88_core: Unknown symbol ieee80211_queue_delayed_work (err -2)
[ 1388.927906] rtw88_core: Unknown symbol ieee80211_proberesp_get (err -2)
[ 1388.927993] rtw88_core: Unknown symbol ieee80211_find_sta_by_ifaddr (err -2)
[ 1388.928075] rtw88_core: Unknown symbol ieee80211_free_txskb (err -2)
[ 1388.928146] rtw88_core: Unknown symbol ieee80211_tx_dequeue (err -2)
[ 1388.928270] rtw88_core: Unknown symbol ieee80211_iterate_active_interfaces_atomic (err -2)
[ 1388.928342] rtw88_core: Unknown symbol ieee80211_unregister_hw (err -2)
[ 1388.928412] rtw88_core: Unknown symbol ieee80211_beacon_get_tim (err -2)
[ 1388.928478] rtw88_core: Unknown symbol ieee80211_queue_work (err -2)

# insmod rtw88_usb.ko
insmod: ERROR: could not insert module rtw88_usb.ko: Unknown symbol in module

# dmesg | grep rtw88_usb
[ 1774.897279] rtw88_usb: Unknown symbol rtw_tx_report_enqueue (err -2)
[ 1774.897394] rtw88_usb: Unknown symbol ieee80211_free_hw (err -2)
[ 1774.897464] rtw88_usb: Unknown symbol ieee80211_tx_status_irqsafe (err -2)
[ 1774.897540] rtw88_usb: Unknown symbol rtw_chip_info_setup (err -2)
[ 1774.897590] rtw88_usb: Unknown symbol rtw_unregister_hw (err -2)
[ 1774.897640] rtw88_usb: Unknown symbol rtw_tx_fill_tx_desc (err -2)
[ 1774.897694] rtw88_usb: Unknown symbol rtw_core_init (err -2)
[ 1774.897740] rtw88_usb: Unknown symbol ieee80211_alloc_hw_nm (err -2)
[ 1774.897796] rtw88_usb: Unknown symbol rtw_register_hw (err -2)
[ 1774.897859] rtw88_usb: Unknown symbol rtw_core_deinit (err -2)
[ 1774.897899] rtw88_usb: Unknown symbol rtw_ops (err -2)
[ 1774.897943] rtw88_usb: Unknown symbol rtw_fw_c2h_cmd_rx_irqsafe (err -2)
[ 1774.897988] rtw88_usb: Unknown symbol ieee80211_rx_irqsafe (err -2)

# insmod rtw88_8822cu.ko
insmod: ERROR: could not insert module rtw88_8822cu.ko: Unknown symbol in module

# dmesg | grep rtw88_8822cu
[ 1827.473718] rtw88_8822cu: Unknown symbol rtw_usb_disconnect (err -2)
[ 1827.473779] rtw88_8822cu: Unknown symbol rtw8822c_hw_spec (err -2)
[ 1827.473834] rtw88_8822cu: Unknown symbol rtw_usb_probe (err -2)
@ulli-kroll
Copy link
Owner

For README.md
This is the old one form @neojou
I will do rewrite ...
most things are changed due a logical change in upstream
they split the hardware specific driver to

  • hardware specific core driver without binding, i.e rtw8822c.c
  • and specific bindings for PCI and possible USB.
modprobe mac80211
insmod rtw88_core.ko 
insmod rtw88_usb.ko 
insmod rtw88_8822b.ko
insmod rtw88_8822bu.ko
insmod rtw88_8822c.ko
insmod rtw88_8822cu.ko

The mac80211 module is needed for nl80211/cfg80211 the newer better API
i.e. with
modinfo rtw88-core
will tell you the dependencies.

DONT MIX rtw88* in upstream linux with the driver(s) here
This will not work.
I should also add this to the README.md

Also I might should automate this via make ...
because this code is bleeding edge

As a side note.
if possible don't run the compiler as root

@lassade
Copy link

lassade commented Sep 28, 2021

I had problems with kernel 5.13.19, I had to downgraded to my previous installation 5.13.12 which works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants