Can't find the kernel header on Jetson orin NX

Hi, I’m trying to build a driver module for a WiFi adapter. It requires the kernel header file but I can find the kernel header as below:

$ sudo  dkms build -m rtl8821au -v 5.12.5.2 
Error! Your kernel headers for kernel 5.10.120-rt70 cannot be found.
Please install the linux-headers-5.10.120-rt70 package,
or use the --kernelsourcedir option to tell DKMS where it's located

$ uname -a
Linux mirle-test 5.10.120-rt70 #1 SMP PREEMPT RT Wed Feb 7 18:39:56 CST 2024 aarch64 aarch64 aarch64 GNU/Linux

Can I get the kernel header from somewhere even though I flashed RT-patched kernel?
Or can I get the header from kernel source?

Thank you!

Hello,

Welcome to the NVIDIA Developer forums! Your topic will be best served in the Jetson category.

I will move this post over for visibility.

Cheers,
Tom

Hi,

Does manually downloading the kernel source help?
https://developer.nvidia.com/downloads/embedded/l4t/r35_release_v5.0/release/jetson_linux_r35.5.0_aarch64.tbz2

Thank you for your response.

I think you intend to let me know that I should be able to get kernel headers from this kernel source.
I think I can get the kernel header source when I extract ‘…/kernel/kernel_headers.tbz2’ file. Am I right?
So I tried to copy the result of the extraction (linux-headers-5.10.120-tegra-ubuntu20.04_aarch64) to /usr/src/linux-headers-5.10.120-rt70/.

/usr/src/linux-headers-5.10.120-rt70$ ls -la
total 1332
drwxr-xr-x  22 root root    4096 Jun  5 18:08 .
drwxr-xr-x  10 root root    4096 Jun  5 18:00 ..
-rw-r--r--   1 root root    1327 Jun  5 18:08 Kbuild
-rw-r--r--   1 root root     555 Jun  5 18:08 Kconfig
-rw-r--r--   1 root root   66728 Jun  5 18:08 Makefile
-rw-r--r--   1 root root 1186531 Jun  5 18:08 Module.symvers
drwxr-xr-x  26 root root    4096 Jun  5 18:08 arch
drwxr-xr-x   3 root root    4096 Jun  5 18:08 block
drwxr-xr-x   2 root root    4096 Jun  5 18:08 certs
drwxr-xr-x   4 root root    4096 Jun  5 18:08 crypto
drwxr-xr-x 139 root root    4096 Jun  5 18:08 drivers
drwxr-xr-x  79 root root    4096 Jun  5 18:08 fs
drwxr-xr-x  31 root root    4096 Jun  5 18:08 include
drwxr-xr-x   2 root root    4096 Jun  5 18:08 init
drwxr-xr-x   2 root root    4096 Jun  5 18:08 ipc
drwxr-xr-x  19 root root    4096 Jun  5 18:08 kernel
-rw-r--r--   1 root root      43 Jun  5 18:08 kernel-int-overlays.txt
-rw-r--r--   1 root root      20 Jun  5 18:08 kernel-overlays.txt
drwxr-xr-x  21 root root    4096 Jun  5 18:08 lib
drwxr-xr-x   3 root root    4096 Jun  5 18:08 mm
drwxr-xr-x  72 root root    4096 Jun  5 18:08 net
drwxr-xr-x  32 root root    4096 Jun  5 18:08 samples
drwxr-xr-x  17 root root    4096 Jun  5 18:08 scripts
drwxr-xr-x  13 root root    4096 Jun  5 18:08 security
drwxr-xr-x  26 root root    4096 Jun  5 18:08 sound
drwxr-xr-x  34 root root    4096 Jun  5 18:08 tools
drwxr-xr-x   3 root root    4096 Jun  5 18:08 usr
drwxr-xr-x   4 root root    4096 Jun  5 18:08 virt

And tried to build the driver. (GitHub - aircrack-ng/rtl8812au: RTL8812AU/21AU and RTL8814AU driver with monitor mode and frame injection)

/usr/src/rtl8812au$ sudo make dkms_install                                                                                                                                       
cp -r * /usr/src/8812au-5.6.4.2_35491.20191025                                                                                                                                                             
dkms add -m 8812au -v 5.6.4.2_35491.20191025                                                                                                                                                               
                                                                                                                                                                                                           
Creating symlink /var/lib/dkms/8812au/5.6.4.2_35491.20191025/source ->                                                                                                                                     
                 /usr/src/8812au-5.6.4.2_35491.20191025                                                                                                                                                    
                                                                                                                                                                                                           
DKMS: add completed.                                                                                                                                                                                       
dkms build -m 8812au -v 5.6.4.2_35491.20191025                                                                                                                                                             
                                                                                                                                                                                                           
Kernel preparation unnecessary for this kernel.  Skipping...                                                                                                                                               
                                                                                                                                                                                                           
Building module:                                                                                                                                                                                           
cleaning build area...
'make' -j4 KVER=5.10.120-rt70 KSRC=/lib/modules/5.10.120-rt70/build.............................................................................
cleaning build area...

DKMS: build completed.
dkms install -m 8812au -v 5.6.4.2_35491.20191025

88XXau.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.120-rt70/updates/dkms/

depmod.....

DKMS: install completed.
dkms status -m 8812au
8812au, 5.6.4.2_35491.20191025, 5.10.120-rt70, aarch64: installed

usr/src/rtl8812au$ sudo dkms status
8812au, 5.6.4.2_35491.20191025, 5.10.120-rt70, aarch64: installed


It succeed… but when I do ‘modprobe’, Error occurs.

/usr/src/rtl8812au$sudo modprobe 8812au
modprobe: ERROR: could not insert '8812au': Exec format error

Did I do this in the wrong way?

Thank you!

What does modinfo 8812au show?
Will it work if you compile it manually without DKMS?

Thank you for your answer.

Here is the output of modinfo 8812au:

filename:       /lib/modules/5.10.120-rt70/kernel/drivers/net/wireless/8812au.ko
import_ns:      VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver
version:        v5.6.4.2_35491.20191025
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
import_ns:      VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver
srcversion:     4BB9D2BDAFDF2EFEDC69D20
alias:          usb:v7392pA833d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA834d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0106d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p809Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p809Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p331Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0026d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9054d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1853d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1852d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1817d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8813d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pB611d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA813d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA812d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v3823p6249d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0120d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p011Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p011Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB32d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3318d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3314d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0023d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9052d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4010d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4007d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0953d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p029Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p0242d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0823d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp0820d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDApA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0821d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2604p0012d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0122d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0103d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0101d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p805Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB30d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3316d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3315d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3313d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p330Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1740p0100d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v148Fp9097d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v13B1p003Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1058p0632d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0022d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0074d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p17D2d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9051d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07B8p8812d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0789p016Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0586p3426d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1106d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0952d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p025Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0409p0408d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8812d*dc*dsc*dp*ic*isc*ip*in*
depends:        cfg80211
name:           88XXau
vermagic:       5.10.120-tegra SMP preempt mod_unload modversions aarch64
parm:           rtw_wireless_mode:int
parm:           rtw_monitor_overwrite_seqnum:Overwrite the sequence number of injected frames (int)
parm:           rtw_monitor_retransmit:Retransmit injected frames (int)
parm:           rtw_monitor_disable_1m:Disable default 1Mbps rate for monitor injected frames (int)
parm:           rtw_ips_mode:The default IPS mode (int)
parm:           rtw_lps_level:The default LPS level (int)
parm:           rtw_lps_chk_by_tp:int
parm:           rtw_max_bss_cnt:int
parm:           rtw_usb_rxagg_mode:int
parm:           rtw_dynamic_agg_enable:int
parm:           rtw_tx_bw_mode:The max tx bw for 2.4G and 5G. format is the same as rtw_bw_mode (uint)
parm:           rtw_rx_ampdu_sz_limit_1ss:RX AMPDU size limit for 1SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_2ss:RX AMPDU size limit for 2SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_3ss:RX AMPDU size limit for 3SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_4ss:RX AMPDU size limit for 4SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_vht_enable:int
parm:           rtw_vht_rx_mcs_map:VHT RX MCS map (uint)
parm:           rtw_rf_config:int
parm:           rtw_country_code:The default country code (in alpha2) (charp)
parm:           rtw_channel_plan:The default chplan ID when rtw_alpha2 is not specified or valid (int)
parm:           rtw_excl_chs:exclusive channel array (array of uint)
parm:           rtw_qos_opt_enable: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_wowlan_sta_mix_mode:int
parm:           rtw_pwrtrim_enable:int
parm:           rtw_initmac:charp
parm:           rtw_special_rf_path: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_ht_enable:int
parm:           rtw_bw_mode:int
parm:           rtw_ampdu_enable:int
parm:           rtw_rx_stbc:int
parm:           rtw_rx_ampdu_amsdu:int
parm:           rtw_tx_ampdu_amsdu:int
parm:           rtw_beamform_cap:int
parm:           rtw_lowrate_two_xmit:int
parm:           rtw_power_mgnt:int
parm:           rtw_smart_ps:int
parm:           rtw_low_power:int
parm:           rtw_wifi_spec:int
parm:           rtw_full_ch_in_p2p_handshake:int
parm:           rtw_antdiv_cfg:int
parm:           rtw_antdiv_type:int
parm:           rtw_drv_ant_band_switch:int
parm:           rtw_single_ant_path:int
parm:           rtw_switch_usb_mode:int
parm:           rtw_enusbss:int
parm:           rtw_hwpdn_mode:int
parm:           rtw_hwpwrp_detect:int
parm:           rtw_hw_wps_pbc:int
parm:           rtw_check_hw_status:int
parm:           rtw_led_ctrl:Led Control: 0=Always off, 1=Normal blink, 2=Always on (int)
parm:           rtw_max_roaming_times:The max roaming times to try (uint)
parm:           rtw_mc2u_disable:int
parm:           rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)
parm:           rtw_hiq_filter:0:allow all, 1:allow special, 2:deny all (uint)
parm:           rtw_adaptivity_en:0:disable, 1:enable (uint)
parm:           rtw_adaptivity_mode:0:normal, 1:carrier sense (uint)
parm:           rtw_adaptivity_th_l2h_ini:th_l2h_ini for Adaptivity (int)
parm:           rtw_adaptivity_th_edcca_hl_diff:th_edcca_hl_diff for Adaptivity (int)
parm:           rtw_amplifier_type_2g:BIT3:2G ext-PA, BIT4:2G ext-LNA (uint)
parm:           rtw_amplifier_type_5g:BIT6:5G ext-PA, BIT7:5G ext-LNA (uint)
parm:           rtw_RFE_type:default init value:64 (uint)
parm:           rtw_powertracking_type:default init value:64 (uint)
parm:           rtw_GLNA_type:default init value:0 (uint)
parm:           rtw_TxBBSwing_2G:default init value:0xFF (uint)
parm:           rtw_TxBBSwing_5G:default init value:0xFF (uint)
parm:           rtw_OffEfuseMask:default open Efuse Mask value:0 (uint)
parm:           rtw_FileMaskEfuse:default drv Mask Efuse value:0 (uint)
parm:           rtw_rxgain_offset_2g:default RF Gain 2G Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gl:default RF Gain 5GL Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gh:uint
parm:           rtw_rxgain_offset_5gm:default RF Gain 5GM Offset value:0 (uint)
parm:           rtw_pll_ref_clk_sel:force pll_ref_clk_sel, 0xF:use autoload value (uint)
parm:           rtw_tx_pwr_by_rate:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_tx_pwr_lmt_enable:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_target_tx_pwr_2g_a:2.4G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_b:2.4G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_c:2.4G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_d:2.4G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_a:5G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_b:5G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_c:5G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_d:5G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_tsf_update_pause_factor:num of bcn intervals to stay TSF update pause status (int)
parm:           rtw_tsf_update_restore_factor:num of bcn intervals to stay TSF update restore status (int)
parm:           rtw_phy_file_path:The path of phy parameter (charp)
parm:           rtw_load_phy_file:PHY File Bit Map (int)
parm:           rtw_decrypt_phy_file:Enable Decrypt PHY File (int)
parm:           rtw_en_napi:int
parm:           rtw_en_gro:int
parm:           rtw_iqk_fw_offload:int
parm:           rtw_ch_switch_offload:int

When I do make:

/usr/src/rtl8812au$ sudo make                                                                                                                                                         
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.120-rt70/build M=/usr/src/rtl8812au  modules                                                                                                           
make[1]: Entering directory '/usr/src/linux-headers-5.10.120-rt70'                                                                                                                                         
  CC [M]  /usr/src/rtl8812au/core/rtw_cmd.o                                                                                                                                                                
  CC [M]  /usr/src/rtl8812au/core/rtw_security.o                                                                                                                                                           
  CC [M]  /usr/src/rtl8812au/core/rtw_debug.o                                                                                                                                                              
  CC [M]  /usr/src/rtl8812au/core/rtw_io.o                                                                                                                                                                 
  CC [M]  /usr/src/rtl8812au/core/rtw_ioctl_query.o                                                                                                                                                        
  CC [M]  /usr/src/rtl8812au/core/rtw_ioctl_set.o                                                                                                                                                          
  CC [M]  /usr/src/rtl8812au/core/rtw_ieee80211.o                                                                                                                                                          
  CC [M]  /usr/src/rtl8812au/core/rtw_mlme.o                                                                                                                                                               
  CC [M]  /usr/src/rtl8812au/core/rtw_mlme_ext.o                                                                                                                                                           
  CC [M]  /usr/src/rtl8812au/core/rtw_mi.o                                                                                                                                                                 
  CC [M]  /usr/src/rtl8812au/core/rtw_wlan_util.o                                                                                                                                                          
  CC [M]  /usr/src/rtl8812au/core/rtw_vht.o                                                                                                                                                                
  CC [M]  /usr/src/rtl8812au/core/rtw_pwrctrl.o                                                                                                                                                            
  CC [M]  /usr/src/rtl8812au/core/rtw_rf.o                                                                                                                                                                 
  CC [M]  /usr/src/rtl8812au/core/rtw_chplan.o                                                                                                                                                             
  CC [M]  /usr/src/rtl8812au/core/rtw_recv.o                                                                                                                                                               
  CC [M]  /usr/src/rtl8812au/core/rtw_sta_mgt.o                                                                                                                                                            
  CC [M]  /usr/src/rtl8812au/core/rtw_ap.o               
.
.
.
.

  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_adc_sampling.o                                                                                                                                       [16/1993]
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_ccx.o                                                                                                                                                         
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_psd.o                                                                                                                                                         
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_primary_cca.o                                                                                                                                                 
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_cck_pd.o                                                                                                                                                      
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_rssi_monitor.o                                                                                                                                                
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_auto_dbg.o                                                                                                                                                    
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_math_lib.o                                                                                                                                                    
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_api.o                                                                                                                                                         
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_pow_train.o                                                                                                                                                   
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_lna_sat.o                                                                                                                                                     
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_pmac_tx_setting.o                                                                                                                                             
  CC [M]  /usr/src/rtl8812au/hal/phydm/phydm_mp.o                                                                                                                                                          
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/halrf.o                                                                                                                                                       
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/halrf_debug.o                                                                                                                                                 
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/halphyrf_ce.o                                                                                                                                                 
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/halrf_powertracking_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/halrf_powertracking.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/halrf_kfree.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8812a/halhwimg8812a_mac.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8812a/halhwimg8812a_bb.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8812a/halhwimg8812a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8812a/halrf_8812a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8812a/phydm_regconfig8812a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8812a/phydm_rtl8812a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/txbf/haltxbfjaguar.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_mac.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_bb.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8821a/halrf_8821a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/phydm_regconfig8821a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/phydm_rtl8821a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8821a/halrf_iqk_8821a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_bb.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_mac.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8814a/halrf_iqk_8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/phydm_regconfig8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8814a/halrf_8814a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/phydm_rtl8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/txbf/haltxbf8814a.o
  CC [M]  /usr/src/rtl8812au/platform/platform_ops.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mp.o
  LD [M]  /usr/src/rtl8812au/88XXau.o
  MODPOST /usr/src/rtl8812au/Module.symvers
  CC [M]  /usr/src/rtl8812au/88XXau.mod.o
  LD [M]  /usr/src/rtl8812au/88XXau.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.10.120-rt70'
---------------------------------------------------------------------------
Visit https://github.com/aircrack-ng/rtl8812au for support/reporting issues
or check for newer versions (branches) of these drivers.                   
---------------------------------------------------------------------------
/usr/src/rtl8812au$ ll
total 9124
drwxr-xr-x 12 root root    4096 Jun  7 08:18 ./
drwxr-xr-x 11 root root    4096 Jun  7 07:14 ../
-rw-r--r--  1 root root     200 Jun  7 08:18 .88XXau.ko.cmd
-rw-r--r--  1 root root    7682 Jun  7 08:18 .88XXau.mod.cmd
-rw-r--r--  1 root root   36563 Jun  7 08:18 .88XXau.mod.o.cmd
-rw-r--r--  1 root root    7556 Jun  7 08:18 .88XXau.o.cmd
-rw-r--r--  1 root root     185 Jun  7 08:18 .Module.symvers.cmd
drwxr-xr-x  8 root root    4096 Jun  5 17:59 .git/
drwxr-xr-x  3 root root    4096 Jun  5 17:59 .github/
-rw-r--r--  1 root root     103 Jun  5 17:59 .gitignore
-rw-r--r--  1 root root     139 Jun  7 08:18 .modules.order.cmd
-rw-r--r--  1 root root 4489696 Jun  7 08:18 88XXau.ko
-rw-r--r--  1 root root    7596 Jun  7 08:18 88XXau.mod
-rw-r--r--  1 root root   12243 Jun  7 08:18 88XXau.mod.c
-rw-r--r--  1 root root  178072 Jun  7 08:18 88XXau.mod.o
-rw-r--r--  1 root root 4312136 Jun  7 08:18 88XXau.o
-rw-r--r--  1 root root      99 Jun  5 17:59 Kconfig
-rw-r--r--  1 root root   18092 Jun  5 17:59 LICENSE
-rwxr-xr-x  1 root root   58371 Jun  5 17:59 Makefile*
-rw-r--r--  1 root root       0 Jun  7 08:18 Module.symvers
-rw-r--r--  1 root root    8413 Jun  5 17:59 README.md
-rw-r--r--  1 root root  105853 Jun  5 17:59 ReleaseNotes.pdf
drwxr-xr-x 12 root root    4096 Jun  5 17:59 android/
drwxr-xr-x  4 root root    4096 Jun  7 08:18 core/
-rw-r--r--  1 root root     308 Jun  5 17:59 dkms.conf
drwxr-xr-x  2 root root    4096 Jun  5 17:59 docs/
drwxr-xr-x  8 root root    4096 Jun  7 08:13 hal/
drwxr-xr-x  5 root root    4096 Jun  5 17:59 include/
-rw-r--r--  1 root root      29 Jun  7 08:18 modules.order
drwxr-xr-x  3 root root    4096 Jun  7 08:11 os_dep/
drwxr-xr-x  2 root root    4096 Jun  7 08:17 platform/
-rwxr-xr-x  1 root root     710 Jun  5 17:59 save-log.sh*
drwxr-xr-x  3 root root    4096 Jun  5 17:59 tools/

It’s all conducted on Jetson orin nx.
Maybe I should do something on the make file?

Thank you.

Why are you getting 5.6.4 here?
Then can the one built manually with make be loaded?

I have used this driver version ‘v5.6.4.2_35491.20191025’ on Jetson orin nano and orin NX. At that time, I haven’t RT-patch and there was kernel headers so I just cloned the driver and make with dkms, and used it successfully. Naturally, I thought this diver version would be working.

I loaded the one built manually with make and I got the same result with the one made with dkms_install.

/lib/modules/5.10.120-rt70/kernel$ sudo modprobe 88XXau 
modprobe: ERROR: could not insert '88XXau': Exec format error

I’m a newbie of building modules.
I have searched for this issue and I saw some information. Should I do something with ‘make menuconfig’? As I described, I just extracted kernel_headers.tbz2 file and copy the files in ‘linux-headers-5.10.120-tegra-ubuntu20.04_aarch64’ to /usr/src/linux-headers-5.10.120-rt70/ that I created manually.

Please ignore this.
It is the vermagic string that really matters.

This driver is not packed into the upstream kernel source so menuconfig makes no help.

NO.
You should untar the entire kernel source on your device and also apply the RT patch on them.

5.10.120-tegra means the driver is built against a different kernel version, so it fails to be loaded.

Thanks!
I followed this steps:

  1. I tried to extract the entire kernel source and move them to the directory ‘/usr/src/linux-headers-5.10.120-rt70/’. (the output of uname -r is 5.10.120-rt70)

  2. Link the /lib/modules/5.10.120-rt70/build to /usr/src/linux-headers-5.10.120-rt70/kernel-5.10/

  3. sudo make the driver:

/usr/src/rtl8812au$ sudo make V=1
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.120-rt70/build M=/usr/src/rtl8812au  modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)
make -f ./scripts/Makefile.build obj=/usr/src/rtl8812au \
single-build= \
need-builtin=1 need-modorder=1
  gcc -Wp,-MMD,/usr/src/rtl8812au/core/.rtw_cmd.o.d  -nostdinc -isystem /usr/lib/gcc/aarch64-linux-gnu/9/include -I./arch/arm64/include -I./arch/arm64/include/generated  -I./include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mlittle-endian -DKASAN_SHADOW_SCALE_SHIFT=3 -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mgeneral-regs-only -DCONFIG_CC_HAS_K_CONSTRAINT=1 -Wno-psabi -mabi=lp64 -fno-asynchronous-unwind-tables -fno-unwind-tables -mbranch-protection=none -DKASAN_SHADOW_SCALE_SHIFT=3 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 --param=allow-store-data-races=0 -Wframe-larger-than=4096 -fstack-protector-strong -Wimplicit-fallthrough -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=1312 -fno-pie -O3 -Wno-unused-variable -Wno-unused-value -Wno-unused-label -Wno-unused-parameter -Wno-cast-function-type -Wno-missing-declarations -Wno-missing-prototypes -Wno-error=cast-function-type -Wno-stringop-overread -Wno-unknown-pragmas -Wno-address -Wno-vla -g -I/usr/src/rtl8812au/include -I.//usr/src/rtl8812au/include -I/usr/src/rtl8812au/hal/phydm -I.//usr/src/rtl8812au/hal/phydm -DDRV_NAME=\"rtl88XXau\" -I/usr/src/rtl8812au/platform -I.//usr/src/rtl8812au/platform -I/usr/src/rtl8812au/hal/btc -I.//usr/src/rtl8812au/hal/btc -DCONFIG_RTL8812A -DCONFIG_RTL8821A -DCONFIG_RTL8814A -DCONFIG_MP_INCLUDED -DCONFIG_EFUSE_CONFIG_FILE -DEFUSE_MAP_PATH=\"/system/etc/wifi/wifi_efuse_8814au.map\" -DWIFIMAC_PATH=\"/data/wifimac.txt\" -DCONFIG_LOAD_PHY_PARA_FROM_FILE -DREALTEK_CONFIG_PATH=\"/lib/firmware/\" -DCONFIG_TXPWR_BY_RATE=1 -DCONFIG_TXPWR_BY_RATE_EN=0 -DCONFIG_TXPWR_LIMIT=1 -DCONFIG_TXPWR_LIMIT_EN=0 -DCONFIG_RTW_ADAPTIVITY_EN=0 -DCONFIG_RTW_ADAPTIVITY_MODE=0 -DCONFIG_IEEE80211W -DHIGH_ACTIVE_HST2DEV=0 -DCONFIG_BR_EXT '-DCONFIG_BR_EXT_BRNAME="'br0'"' -DCONFIG_WIFI_MONITOR -DCONFIG_RTW_NAPI -DCONFIG_RTW_GRO -DCONFIG_RTW_NETIF_SG -DDM_ODM_SUPPORT_TYPE=0x04 -DCONFIG_LITTLE_ENDIAN -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -I/usr/src/rtl8812au/hal/phydm -I/usr/src/linux-headers-5.10.120-rt70/nvidia/include -I/usr/src/linux-headers-5.10.120-rt70/nvlink/include -I/usr/src/linux-headers-5.10.120-rt70/nvgpu/include -I/usr/src/linux-headers-5.10.120-rt70/nvgpu-next/include -I/usr/src/linux-headers-5.10.120-rt70/nvidia-t239/include  -DMODULE  -DKBUILD_BASENAME='"rtw_cmd"' -DKBUILD_MODNAME='"88XXau"' -c -o /usr/src/rtl8812au/core/rtw_cmd.o /usr/src/rtl8812au/core/rtw_cmd.c
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[2]: *** [scripts/Makefile.build:281: /usr/src/rtl8812au/core/rtw_cmd.o] Error 2
make[2]: *** Deleting file '/usr/src/rtl8812au/core/rtw_cmd.o'
make[1]: *** [Makefile:1854: /usr/src/rtl8812au] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
make: *** [Makefile:1730: modules] Error 2

  1. It complains include/generated/autoconf.h or include/config/auto.conf are missing. To resolve this, I tried sudo make mrproper(before this I backup the .config file) and got the .config file back from backup and sudo make prepare :
/usr/src/linux-headers-5.10.120-rt70/kernel-5.10$ sudo make prepare
  SYNC    include/config/auto.conf.cmd
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.[ch]
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/genksyms/genksyms.o
  YACC    scripts/genksyms/parse.tab.[ch]
  HOSTCC  scripts/genksyms/parse.tab.o
  LEX     scripts/genksyms/lex.lex.c
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/selinux/genheaders/genheaders
  HOSTCC  scripts/selinux/mdp/mdp
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/sign-file
  HOSTCC  scripts/extract-cert
  WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h
  WRAP    arch/arm64/include/generated/uapi/asm/errno.h
  WRAP    arch/arm64/include/generated/uapi/asm/ioctl.h
  WRAP    arch/arm64/include/generated/uapi/asm/ioctls.h
  WRAP    arch/arm64/include/generated/uapi/asm/ipcbuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/msgbuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/poll.h
  WRAP    arch/arm64/include/generated/uapi/asm/resource.h
.
.
.
  WRAP    arch/arm64/include/generated/asm/hw_irq.h
  WRAP    arch/arm64/include/generated/asm/irq_regs.h
  WRAP    arch/arm64/include/generated/asm/kdebug.h
  WRAP    arch/arm64/include/generated/asm/kmap_size.h
  WRAP    arch/arm64/include/generated/asm/local.h
  WRAP    arch/arm64/include/generated/asm/local64.h
  WRAP    arch/arm64/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm64/include/generated/asm/mmiowb.h
  WRAP    arch/arm64/include/generated/asm/msi.h
  WRAP    arch/arm64/include/generated/asm/rwonce.h
  WRAP    arch/arm64/include/generated/asm/serial.h
  WRAP    arch/arm64/include/generated/asm/switch_to.h
  WRAP    arch/arm64/include/generated/asm/unaligned.h
  WRAP    arch/arm64/include/generated/asm/vga.h
  UPD     include/config/kernel.release
  UPD     include/generated/uapi/linux/version.h
  UPD     include/generated/utsrelease.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CC      kernel/bounds.s
  UPD     include/generated/bounds.h
  UPD     include/generated/timeconst.h
  CC      arch/arm64/kernel/asm-offsets.s
  UPD     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  LDS     arch/arm64/kernel/vdso/vdso.lds
  CC      arch/arm64/kernel/vdso/vgettimeofday.o
  AS      arch/arm64/kernel/vdso/note.o
  AS      arch/arm64/kernel/vdso/sigreturn.o
  LD      arch/arm64/kernel/vdso/vdso.so.dbg
  VDSOSYM include/generated/vdso-offsets.h

  1. retry sudo make for building the driver
/usr/src/rtl8812au$ sudo make
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.120-rt70/build M=/usr/src/rtl8812au  modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
  CC [M]  /usr/src/rtl8812au/core/rtw_cmd.o
  CC [M]  /usr/src/rtl8812au/core/rtw_security.o
  CC [M]  /usr/src/rtl8812au/core/rtw_debug.o
  CC [M]  /usr/src/rtl8812au/core/rtw_io.o
  CC [M]  /usr/src/rtl8812au/core/rtw_ioctl_query.o
  CC [M]  /usr/src/rtl8812au/core/rtw_ioctl_set.o
  CC [M]  /usr/src/rtl8812au/core/rtw_ieee80211.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mlme.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mlme_ext.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mi.o
  CC [M]  /usr/src/rtl8812au/core/rtw_wlan_util.o
  CC [M]  /usr/src/rtl8812au/core/rtw_vht.o
  CC [M]  /usr/src/rtl8812au/core/rtw_pwrctrl.o
  CC [M]  /usr/src/rtl8812au/core/rtw_rf.o
  CC [M]  /usr/src/rtl8812au/core/rtw_chplan.o
  CC [M]  /usr/src/rtl8812au/core/rtw_recv.o
  CC [M]  /usr/src/rtl8812au/core/rtw_sta_mgt.o
  CC [M]  /usr/src/rtl8812au/core/rtw_ap.o
/usr/src/rtl8812au/core/rtw_ap.c:313:12: warning: ‘issue_aka_chk_frame’ defined but not used [-Wunused-function]
  313 | static int issue_aka_chk_frame(_adapter *adapter, struct sta_info *psta)
      |            ^~~~~~~~~~~~~~~~~~~
cc1: warning: unrecognized command line option ‘-Wno-stringop-overread’
  CC [M]  /usr/src/rtl8812au/core/mesh/rtw_mesh.o
  CC [M]  /usr/src/rtl8812au/core/mesh/rtw_mesh_pathtbl.o
  CC [M]  /usr/src/rtl8812au/core/mesh/rtw_mesh_hwmp.o
  CC [M]  /usr/src/rtl8812au/core/rtw_xmit.o
  CC [M]  /usr/src/rtl8812au/core/rtw_p2p.o
  CC [M]  /usr/src/rtl8812au/core/rtw_rson.o
  CC [M]  /usr/src/rtl8812au/core/rtw_tdls.o
  CC [M]  /usr/src/rtl8812au/core/rtw_br_ext.o
  CC [M]  /usr/src/rtl8812au/core/rtw_iol.o
  CC [M]  /usr/src/rtl8812au/core/rtw_sreset.o
  CC [M]  /usr/src/rtl8812au/core/rtw_btcoex_wifionly.o
  CC [M]  /usr/src/rtl8812au/core/rtw_btcoex.o
  CC [M]  /usr/src/rtl8812au/core/rtw_beamforming.o
  CC [M]  /usr/src/rtl8812au/core/rtw_odm.o
  CC [M]  /usr/src/rtl8812au/core/rtw_rm.o
  CC [M]  /usr/src/rtl8812au/core/rtw_rm_fsm.o
  CC [M]  /usr/src/rtl8812au/core/efuse/rtw_efuse.o
  CC [M]  /usr/src/rtl8812au/os_dep/osdep_service.o
  CC [M]  /usr/src/rtl8812au/os_dep/linux/os_intfs.o
  CC [M]  /usr/src/rtl8812au/os_dep/linux/usb_intf.o
  CC [M]  /usr/src/rtl8812au/os_dep/linux/usb_ops_linux.o
.
.
.
  CC [M]  /usr/src/rtl8812au/hal/phydm/txbf/haltxbfjaguar.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_mac.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_bb.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8821a/halrf_8821a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/phydm_regconfig8821a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/phydm_rtl8821a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8821a/halrf_iqk_8821a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_bb.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_mac.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8814a/halrf_iqk_8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/phydm_regconfig8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8814a/halrf_8814a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/phydm_rtl8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/txbf/haltxbf8814a.o
  CC [M]  /usr/src/rtl8812au/platform/platform_ops.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mp.o
  LD [M]  /usr/src/rtl8812au/88XXau.o
WARNING: Symbol version dump "Module.symvers" is missing.
         Modules may not have dependencies or modversions.
  MODPOST /usr/src/rtl8812au/Module.symvers
WARNING: modpost: Symbol info of vmlinux is missing. Unresolved symbol check will be entirely skipped.
  CC [M]  /usr/src/rtl8812au/88XXau.mod.o
make[3]: *** No rule to make target 'scripts/module.lds', needed by '/usr/src/rtl8812au/88XXau.ko'.  Stop.
make[2]: *** [scripts/Makefile.modpost:130: __modpost] Error 2
make[1]: *** [Makefile:1758: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
make: *** [Makefile:1730: modules] Error 2

  1. It complains “Module.symvers” is missing. So, I did sudo make modules_prepare
/usr/src/linux-headers-5.10.120-rt70/kernel-5.10$ sudo make modules_prepare
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  LDS     scripts/module.lds

  1. Retry to make the driver
:/usr/src/rtl8812au$ sudo make
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.120-rt70/build M=/usr/src/rtl8812au  modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
WARNING: Symbol version dump "Module.symvers" is missing.
         Modules may not have dependencies or modversions.
  LD [M]  /usr/src/rtl8812au/88XXau.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
---------------------------------------------------------------------------
Visit https://github.com/aircrack-ng/rtl8812au for support/reporting issues
or check for newer versions (branches) of these drivers.                   
---------------------------------------------------------------------------

  1. It looks the driver is successfully made. I loaded the driver built.
/usr/src/rtl8812au$ sudo modprobe 88XXau 
modprobe: ERROR: could not insert '88XXau': Exec format error
  1. It has the same issue. I checked the vermagic
/usr/src/rtl8812au$ sudo modinfo 88XXau 
filename:       /lib/modules/5.10.120-rt70/kernel/88XXau.ko
import_ns:      VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver
version:        v5.6.4.2_35491.20191025
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
import_ns:      VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver
srcversion:     4BB9D2BDAFDF2EFEDC69D20
alias:          usb:v7392pA833d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA834d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0106d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p809Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p809Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p331Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0026d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9054d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1853d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1852d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1817d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8813d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pB611d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA813d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA812d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v3823p6249d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0120d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p011Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p011Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB32d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3318d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3314d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0023d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9052d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4010d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4007d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0953d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p029Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p0242d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0823d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp0820d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDApA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0821d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2604p0012d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0122d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0103d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0101d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p805Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB30d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3316d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3315d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3313d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p330Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1740p0100d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v148Fp9097d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v13B1p003Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1058p0632d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0022d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0074d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p17D2d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9051d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07B8p8812d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0789p016Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0586p3426d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1106d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0952d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p025Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0409p0408d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8812d*dc*dsc*dp*ic*isc*ip*in*
depends:        cfg80211
name:           88XXau
vermagic:       5.10.120-tegra SMP preempt mod_unload modversions aarch64
parm:           rtw_wireless_mode:int
parm:           rtw_monitor_overwrite_seqnum:Overwrite the sequence number of injected frames (int)
parm:           rtw_monitor_retransmit:Retransmit injected frames (int)
parm:           rtw_monitor_disable_1m:Disable default 1Mbps rate for monitor injected frames (int)
parm:           rtw_ips_mode:The default IPS mode (int)
parm:           rtw_lps_level:The default LPS level (int)
parm:           rtw_lps_chk_by_tp:int
parm:           rtw_max_bss_cnt:int
parm:           rtw_usb_rxagg_mode:int
parm:           rtw_dynamic_agg_enable:int
parm:           rtw_tx_bw_mode:The max tx bw for 2.4G and 5G. format is the same as rtw_bw_mode (uint)
parm:           rtw_rx_ampdu_sz_limit_1ss:RX AMPDU size limit for 1SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_2ss:RX AMPDU size limit for 2SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_3ss:RX AMPDU size limit for 3SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_4ss:RX AMPDU size limit for 4SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_vht_enable:int
parm:           rtw_vht_rx_mcs_map:VHT RX MCS map (uint)
parm:           rtw_rf_config:int
parm:           rtw_country_code:The default country code (in alpha2) (charp)
parm:           rtw_channel_plan:The default chplan ID when rtw_alpha2 is not specified or valid (int)
parm:           rtw_excl_chs:exclusive channel array (array of uint)
parm:           rtw_qos_opt_enable: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_wowlan_sta_mix_mode:int
parm:           rtw_pwrtrim_enable:int
parm:           rtw_initmac:charp
parm:           rtw_special_rf_path: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_ht_enable:int
parm:           rtw_bw_mode:int
parm:           rtw_ampdu_enable:int
parm:           rtw_rx_stbc:int
parm:           rtw_rx_ampdu_amsdu:int
parm:           rtw_tx_ampdu_amsdu:int
parm:           rtw_beamform_cap:int
parm:           rtw_lowrate_two_xmit:int
parm:           rtw_power_mgnt:int
parm:           rtw_smart_ps:int
parm:           rtw_low_power:int
parm:           rtw_wifi_spec:int
parm:           rtw_full_ch_in_p2p_handshake:int
parm:           rtw_antdiv_cfg:int
parm:           rtw_antdiv_type:int
parm:           rtw_drv_ant_band_switch:int
parm:           rtw_single_ant_path:int
parm:           rtw_switch_usb_mode:int
parm:           rtw_enusbss:int
parm:           rtw_hwpdn_mode:int
parm:           rtw_hwpwrp_detect:int
parm:           rtw_hw_wps_pbc:int
parm:           rtw_check_hw_status:int
parm:           rtw_led_ctrl:Led Control: 0=Always off, 1=Normal blink, 2=Always on (int)
parm:           rtw_max_roaming_times:The max roaming times to try (uint)
parm:           rtw_mc2u_disable:int
parm:           rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)
parm:           rtw_hiq_filter:0:allow all, 1:allow special, 2:deny all (uint)
parm:           rtw_adaptivity_en:0:disable, 1:enable (uint)
parm:           rtw_adaptivity_mode:0:normal, 1:carrier sense (uint)
parm:           rtw_adaptivity_th_l2h_ini:th_l2h_ini for Adaptivity (int)
parm:           rtw_adaptivity_th_edcca_hl_diff:th_edcca_hl_diff for Adaptivity (int)
parm:           rtw_amplifier_type_2g:BIT3:2G ext-PA, BIT4:2G ext-LNA (uint)
parm:           rtw_amplifier_type_5g:BIT6:5G ext-PA, BIT7:5G ext-LNA (uint)
parm:           rtw_RFE_type:default init value:64 (uint)
parm:           rtw_powertracking_type:default init value:64 (uint)
parm:           rtw_GLNA_type:default init value:0 (uint)
parm:           rtw_TxBBSwing_2G:default init value:0xFF (uint)
parm:           rtw_TxBBSwing_5G:default init value:0xFF (uint)
parm:           rtw_OffEfuseMask:default open Efuse Mask value:0 (uint)
parm:           rtw_FileMaskEfuse:default drv Mask Efuse value:0 (uint)
parm:           rtw_rxgain_offset_2g:default RF Gain 2G Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gl:default RF Gain 5GL Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gh:uint
parm:           rtw_rxgain_offset_5gm:default RF Gain 5GM Offset value:0 (uint)
parm:           rtw_pll_ref_clk_sel:force pll_ref_clk_sel, 0xF:use autoload value (uint)
parm:           rtw_tx_pwr_by_rate:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_tx_pwr_lmt_enable:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_target_tx_pwr_2g_a:2.4G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_b:2.4G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_c:2.4G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_d:2.4G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_a:5G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_b:5G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_c:5G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_d:5G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_tsf_update_pause_factor:num of bcn intervals to stay TSF update pause status (int)
parm:           rtw_tsf_update_restore_factor:num of bcn intervals to stay TSF update restore status (int)
parm:           rtw_phy_file_path:The path of phy parameter (charp)
parm:           rtw_load_phy_file:PHY File Bit Map (int)
parm:           rtw_decrypt_phy_file:Enable Decrypt PHY File (int)
parm:           rtw_en_napi:int
parm:           rtw_en_gro:int
parm:           rtw_iqk_fw_offload:int
parm:           rtw_ch_switch_offload:int

The vermegic still show 5.10.120-tegra.
I added “-rt70” at CONFIG_LOCALVERSION=“-rt70” in .config file expecting the vermegit would be changed to 5.10.120-rt70. Unfortunately, it didn’t happen…

Did I miss something? What should I check and do to resolve this?
Thank you!

This does not make any difference.

Do this instead.

I continuosly followed this steps:

  1. RT-patch executing the rt-patch.sh
/usr/src/linux-headers-5.10.120-rt70/kernel-5.10$ ./scripts/rt-patch.sh apply-patches
The PREEMPT RT patches are already applied to the kernel!
  1. sudo make the driver
/usr/src/rtl8812au$ sudo make
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.120-rt70/build M=/usr/src/rtl8812au  modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
  CC [M]  /usr/src/rtl8812au/core/rtw_cmd.o
  CC [M]  /usr/src/rtl8812au/core/rtw_security.o
  CC [M]  /usr/src/rtl8812au/core/rtw_debug.o
  CC [M]  /usr/src/rtl8812au/core/rtw_io.o
  CC [M]  /usr/src/rtl8812au/core/rtw_ioctl_query.o
  CC [M]  /usr/src/rtl8812au/core/rtw_ioctl_set.o
  CC [M]  /usr/src/rtl8812au/core/rtw_ieee80211.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mlme.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mlme_ext.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mi.o
  CC [M]  /usr/src/rtl8812au/core/rtw_wlan_util.o
  CC [M]  /usr/src/rtl8812au/core/rtw_vht.o
  CC [M]  /usr/src/rtl8812au/core/rtw_pwrctrl.o
  CC [M]  /usr/src/rtl8812au/core/rtw_rf.o
  CC [M]  /usr/src/rtl8812au/core/rtw_chplan.o
  CC [M]  /usr/src/rtl8812au/core/rtw_recv.o
  CC [M]  /usr/src/rtl8812au/core/rtw_sta_mgt.o
  CC [M]  /usr/src/rtl8812au/core/rtw_ap.o
/usr/src/rtl8812au/core/rtw_ap.c:313:12: warning: ‘issue_aka_chk_frame’ defined but not used [-Wunused-function]
  313 | static int issue_aka_chk_frame(_adapter *adapter, struct sta_info *psta)
      |            ^~~~~~~~~~~~~~~~~~~
cc1: warning: unrecognized command line option ‘-Wno-stringop-overread’
  CC [M]  /usr/src/rtl8812au/core/mesh/rtw_mesh.o
  CC [M]  /usr/src/rtl8812au/core/mesh/rtw_mesh_pathtbl.o
  CC [M]  /usr/src/rtl8812au/core/mesh/rtw_mesh_hwmp.o
  CC [M]  /usr/src/rtl8812au/core/rtw_xmit.o
  CC [M]  /usr/src/rtl8812au/core/rtw_p2p.o
  CC [M]  /usr/src/rtl8812au/core/rtw_rson.o
  CC [M]  /usr/src/rtl8812au/core/rtw_tdls.o
  CC [M]  /usr/src/rtl8812au/core/rtw_br_ext.o
  CC [M]  /usr/src/rtl8812au/core/rtw_iol.o
  CC [M]  /usr/src/rtl8812au/core/rtw_sreset.o
  CC [M]  /usr/src/rtl8812au/core/rtw_btcoex_wifionly.o
  CC [M]  /usr/src/rtl8812au/core/rtw_btcoex.o
  CC [M]  /usr/src/rtl8812au/core/rtw_beamforming.o
  CC [M]  /usr/src/rtl8812au/core/rtw_odm.o
  CC [M]  /usr/src/rtl8812au/core/rtw_rm.o
  CC [M]  /usr/src/rtl8812au/core/rtw_rm_fsm.o
  CC [M]  /usr/src/rtl8812au/core/efuse/rtw_efuse.o
.
.
.
 CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8812a/phydm_rtl8812a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/txbf/haltxbfjaguar.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_mac.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_bb.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8821a/halrf_8821a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/phydm_regconfig8821a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/phydm_rtl8821a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8821a/halrf_iqk_8821a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_bb.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_mac.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8814a/halrf_iqk_8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/phydm_regconfig8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8814a/halrf_8814a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/phydm_rtl8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/txbf/haltxbf8814a.o
  CC [M]  /usr/src/rtl8812au/platform/platform_ops.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mp.o
  LD [M]  /usr/src/rtl8812au/88XXau.o
WARNING: Symbol version dump "Module.symvers" is missing.
         Modules may not have dependencies or modversions.
  MODPOST /usr/src/rtl8812au/Module.symvers
WARNING: modpost: Symbol info of vmlinux is missing. Unresolved symbol check will be entirely skipped.
  CC [M]  /usr/src/rtl8812au/88XXau.mod.o
  LD [M]  /usr/src/rtl8812au/88XXau.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
---------------------------------------------------------------------------
Visit https://github.com/aircrack-ng/rtl8812au for support/reporting issues
or check for newer versions (branches) of these drivers.                   
---------------------------------------------------------------------------

  1. Load the driver and check modinfo.
/usr/src/rtl8812au$ sudo modprobe 88XXau 
modprobe: ERROR: could not insert '88XXau': Exec format error

/usr/src/rtl8812au$ sudo modinfo 88XXau 
filename:       /lib/modules/5.10.120-rt70/kernel/88XXau.ko
import_ns:      VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver
version:        v5.6.4.2_35491.20191025
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
import_ns:      VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver
srcversion:     4BB9D2BDAFDF2EFEDC69D20
alias:          usb:v7392pA833d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA834d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0106d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p809Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p809Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p331Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0026d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9054d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1853d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1852d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p1817d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8813d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pB611d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA813d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA812d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v3823p6249d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0120d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p011Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p011Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB32d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3318d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3314d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0023d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9052d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4010d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4007d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0953d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p029Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p0242d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0823d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp0820d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDApA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0821d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2604p0012d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0122d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0103d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0101d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p805Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB30d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3316d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3315d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3313d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p330Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1740p0100d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v148Fp9097d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v13B1p003Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1058p0632d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0022d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0074d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p17D2d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9051d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07B8p8812d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0789p016Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0586p3426d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1106d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0952d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p025Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0409p0408d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8812d*dc*dsc*dp*ic*isc*ip*in*
depends:        cfg80211
name:           88XXau
vermagic:       5.10.120-tegra SMP preempt mod_unload modversions aarch64
parm:           rtw_wireless_mode:int
parm:           rtw_monitor_overwrite_seqnum:Overwrite the sequence number of injected frames (int)
parm:           rtw_monitor_retransmit:Retransmit injected frames (int)
parm:           rtw_monitor_disable_1m:Disable default 1Mbps rate for monitor injected frames (int)
parm:           rtw_ips_mode:The default IPS mode (int)
parm:           rtw_lps_level:The default LPS level (int)
parm:           rtw_lps_chk_by_tp:int
parm:           rtw_max_bss_cnt:int
parm:           rtw_usb_rxagg_mode:int
parm:           rtw_dynamic_agg_enable:int
parm:           rtw_tx_bw_mode:The max tx bw for 2.4G and 5G. format is the same as rtw_bw_mode (uint)
parm:           rtw_rx_ampdu_sz_limit_1ss:RX AMPDU size limit for 1SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_2ss:RX AMPDU size limit for 2SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_3ss:RX AMPDU size limit for 3SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_rx_ampdu_sz_limit_4ss:RX AMPDU size limit for 4SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_vht_enable:int
parm:           rtw_vht_rx_mcs_map:VHT RX MCS map (uint)
parm:           rtw_rf_config:int
parm:           rtw_country_code:The default country code (in alpha2) (charp)
parm:           rtw_channel_plan:The default chplan ID when rtw_alpha2 is not specified or valid (int)
parm:           rtw_excl_chs:exclusive channel array (array of uint)
parm:           rtw_qos_opt_enable: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_wowlan_sta_mix_mode:int
parm:           rtw_pwrtrim_enable:int
parm:           rtw_initmac:charp
parm:           rtw_special_rf_path: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_ht_enable:int
parm:           rtw_bw_mode:int
parm:           rtw_ampdu_enable:int
parm:           rtw_rx_stbc:int
parm:           rtw_rx_ampdu_amsdu:int
parm:           rtw_tx_ampdu_amsdu:int
parm:           rtw_beamform_cap:int
parm:           rtw_lowrate_two_xmit:int
parm:           rtw_power_mgnt:int
parm:           rtw_smart_ps:int
parm:           rtw_low_power:int
parm:           rtw_wifi_spec:int
parm:           rtw_full_ch_in_p2p_handshake:int
parm:           rtw_antdiv_cfg:int
parm:           rtw_antdiv_type:int
parm:           rtw_drv_ant_band_switch:int
parm:           rtw_single_ant_path:int
parm:           rtw_switch_usb_mode:int
parm:           rtw_enusbss:int
parm:           rtw_hwpdn_mode:int
parm:           rtw_hwpwrp_detect:int
parm:           rtw_hw_wps_pbc:int
parm:           rtw_check_hw_status:int
parm:           rtw_led_ctrl:Led Control: 0=Always off, 1=Normal blink, 2=Always on (int)
parm:           rtw_max_roaming_times:The max roaming times to try (uint)
parm:           rtw_mc2u_disable:int
parm:           rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)
parm:           rtw_hiq_filter:0:allow all, 1:allow special, 2:deny all (uint)
parm:           rtw_adaptivity_en:0:disable, 1:enable (uint)
parm:           rtw_adaptivity_mode:0:normal, 1:carrier sense (uint)
parm:           rtw_adaptivity_th_l2h_ini:th_l2h_ini for Adaptivity (int)
parm:           rtw_adaptivity_th_edcca_hl_diff:th_edcca_hl_diff for Adaptivity (int)
parm:           rtw_amplifier_type_2g:BIT3:2G ext-PA, BIT4:2G ext-LNA (uint)
parm:           rtw_amplifier_type_5g:BIT6:5G ext-PA, BIT7:5G ext-LNA (uint)
parm:           rtw_RFE_type:default init value:64 (uint)
parm:           rtw_powertracking_type:default init value:64 (uint)
parm:           rtw_GLNA_type:default init value:0 (uint)
parm:           rtw_TxBBSwing_2G:default init value:0xFF (uint)
parm:           rtw_TxBBSwing_5G:default init value:0xFF (uint)
parm:           rtw_OffEfuseMask:default open Efuse Mask value:0 (uint)
parm:           rtw_FileMaskEfuse:default drv Mask Efuse value:0 (uint)
parm:           rtw_rxgain_offset_2g:default RF Gain 2G Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gl:default RF Gain 5GL Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gh:uint
parm:           rtw_rxgain_offset_5gm:default RF Gain 5GM Offset value:0 (uint)
parm:           rtw_pll_ref_clk_sel:force pll_ref_clk_sel, 0xF:use autoload value (uint)
parm:           rtw_tx_pwr_by_rate:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_tx_pwr_lmt_enable:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_target_tx_pwr_2g_a:2.4G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_b:2.4G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_c:2.4G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_d:2.4G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_a:5G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_b:5G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_c:5G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_d:5G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_tsf_update_pause_factor:num of bcn intervals to stay TSF update pause status (int)
parm:           rtw_tsf_update_restore_factor:num of bcn intervals to stay TSF update restore status (int)
parm:           rtw_phy_file_path:The path of phy parameter (charp)
parm:           rtw_load_phy_file:PHY File Bit Map (int)
parm:           rtw_decrypt_phy_file:Enable Decrypt PHY File (int)
parm:           rtw_en_napi:int
parm:           rtw_en_gro:int
parm:           rtw_iqk_fw_offload:int
parm:           rtw_ch_switch_offload:int

I did only execute the rt-patch.sh file for rt-patch.
Maybe rt-patch is not finished?

Can you try building the entire RT kernel natively on your device?

Then these errors may be avoided.

After downloading a kernel source newly and started kernel building from beginning.
And I followed this guide.

My step was :

  1. Apply RT patches to the kernel:
    ./kernel-5.10/scripts/rt-patch.sh apply-patches

  2. Create a kernel_out directory.
    mkdir kernel_out

  3. Build the kernel (I skipped set cross-compile environment, because I do this natively)
    ./nvbuild.sh -o $PWD/kernel_out

.
.
.                                                                                                                                                                
                                                                                                                                           
  LD [M]  sound/soc/tegra/snd-soc-tegra210-ope.ko                                                                                                                                                                  
  LD [M]  sound/soc/tegra/snd-soc-tegra210-sfc.ko                                                                                                                                                                  
  LD [M]  virt/lib/irqbypass.ko                                                                                                                                                                                    
  LD [M]  sound/tegra-safety-audio/safety-i2s.ko                                                                                                                                                                   
Kernel sources compiled successfully.                                       
  1. Move the directories hardware, kernel-5.10, nvethernetrm, nvgpu, nvidia to /usr/src/linux-headers-5.10.120-rt70/

  2. sudo make the driver

/usr/src/rtl8812au$ sudo make
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.120-rt70/build M=/usr/src/rtl8812au  modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

Makefile:675: include/config/auto.conf: No such file or directory
make[1]: *** [Makefile:750: include/config/auto.conf] Error 1
make[1]: Leaving directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
make: *** [Makefile:1730: modules] Error 2

Can I just do make prepare like before? or did I miss something?
Thank you!!

Looks like you need make modules_prepare.

I tried to follow the instructions in the reference you shared.

  1. sudo make -j modules_prepare
/usr/src/linux-headers-5.10.120-rt70/kernel-5.10$ sudo make -j modules_prepare       
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make: *** [Makefile:728: .config] Error 1
  1. I also tried sudo make localmodconfig as the instruction described.
/usr/src/linux-headers-5.10.120-rt70/kernel-5.10$ sudo make localmodconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
using config: '/proc/config.gz'
Can't open drivers/video/tegra/Kconfig at ./scripts/kconfig/streamline_config.pl line 173, <$kinfile> line 27.
make[1]: *** [scripts/kconfig/Makefile:46: localmodconfig] Error 2
make: *** [Makefile:633: localmodconfig] Error 2

  1. It looks lack of .config file. so I got the .config file from /proc/config.gz as he said.
mkdir -p ~/Jetson/kernel-4.9/archive
mkdir -p ~/Jetson/kernel-4.9/archive/$(uname -r)`
# As an example, you now have directory "~/Jetson/kernel-4.9/archive/4.9.140-tegra/"
cd ~/Jetson/kernel-4.9/archive/$(uname -r)
cp /proc/config.gz .
gunzip config.gz
# This creates a nearly exact replica of the config file for your running Jetson:
mv config config-$(uname -r)
# Now edit config-4.9.140-tegra such that:
CONFIG_LOCALVERSION="-rt70"
# The above makes an exact match of the existing Jetson config, including
# module directory search location...there are times you would change this,
# but this is good most of the time on a Jetson.
# Any time you then use your config-4.9.140-tegra file, but rename it to “.config”, you have a perfect starting config. On the Jetson itself you could put this in “/lib/modules/$(uname -r)/build/.config”
sudo cp config-$(uname -r) /usr/src/linux-headers-5.10.120-rt70/kernel-5.10/.config
  1. Retry sudo make -j modules_prepare
/usr/src/linux-headers-5.10.120-rt70/kernel-5.10$ sudo make -j modules_prepare                                                                                                                
  SYNC    include/config/auto.conf.cmd                                                                                                                                                                             
  WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h                                                                                                                                                         
  WRAP    arch/arm64/include/generated/uapi/asm/errno.h                                                                                                                                                            
  WRAP    arch/arm64/include/generated/uapi/asm/ioctl.h                                                                                                                                                            
  WRAP    arch/arm64/include/generated/uapi/asm/ioctls.h                                                                                                                                                           
  WRAP    arch/arm64/include/generated/uapi/asm/ipcbuf.h                                                                                                                                                           
  WRAP    arch/arm64/include/generated/uapi/asm/msgbuf.h                                                                                                                                                           
  WRAP    arch/arm64/include/generated/uapi/asm/resource.h                                                                                                                                                         
  WRAP    arch/arm64/include/generated/uapi/asm/poll.h                                                                                                                                                             
  WRAP    arch/arm64/include/generated/uapi/asm/sembuf.h                                                                                                                                                           
  WRAP    arch/arm64/include/generated/uapi/asm/shmbuf.h                                                                                                                                                           
  WRAP    arch/arm64/include/generated/uapi/asm/siginfo.h                                                                                                                                                          
  UPD     include/generated/uapi/linux/version.h                                                                                                                                                                   
  WRAP    arch/arm64/include/generated/uapi/asm/sockios.h                                                                                                                                                          
  WRAP    arch/arm64/include/generated/uapi/asm/socket.h                                                                                                                                                           
  WRAP    arch/arm64/include/generated/uapi/asm/stat.h                                                                                                                                                             
  WRAP    arch/arm64/include/generated/uapi/asm/swab.h                                                                                                                                                             
  WRAP    arch/arm64/include/generated/uapi/asm/termbits.h                                                                                                                                                         
  WRAP    arch/arm64/include/generated/uapi/asm/termios.h                                                                                                                                                          
  WRAP    arch/arm64/include/generated/uapi/asm/types.h                                                                                                                                                            
  HOSTCC  scripts/dtc/dtc.o                                                                                                                                                                                        
  WRAP    arch/arm64/include/generated/asm/early_ioremap.h                                                                                                                                                         
  WRAP    arch/arm64/include/generated/asm/mcs_spinlock.h                                                                                                                                                          
  WRAP    arch/arm64/include/generated/asm/qrwlock.h                                                                                                                                                               
  WRAP    arch/arm64/include/generated/asm/qspinlock.h                                                                                                                                                             
  HOSTCC  scripts/dtc/flattree.o                                                                                                                                                                                   
  WRAP    arch/arm64/include/generated/asm/set_memory.h                                                                                                                                                            
  UPD     include/config/kernel.release                                                                                                                                                                            
  HOSTCC  scripts/dtc/fstree.o                                                                                                                                                                                     
  HOSTCC  scripts/dtc/data.o                                                                                                                                                                                       
  WRAP    arch/arm64/include/generated/asm/user.h                                                                                                                                                                  
  WRAP    arch/arm64/include/generated/asm/bugs.h                                                                                                                                                                  
  HOSTCC  scripts/dtc/livetree.o                                                                                                                                                                                   
  HOSTCC  scripts/dtc/treesource.o                                                                                                                                                                                 
  WRAP    arch/arm64/include/generated/asm/delay.h                                                                                                                                                                 
  HOSTCC  scripts/dtc/srcpos.o                                                                                                                                                                                     
  HOSTCC  scripts/dtc/checks.o                                                                                                                                                                                     
  WRAP    arch/arm64/include/generated/asm/div64.h                                                                                                                                                                 
  HOSTCC  scripts/dtc/util.o                                                                                                                                                                                       
  WRAP    arch/arm64/include/generated/asm/dma-mapping.h                                                                                                                                                           
  LEX     scripts/dtc/dtc-lexer.lex.c                                                                                                                                                                              
  WRAP    arch/arm64/include/generated/asm/dma.h                                                                                                                                                                   
  YACC    scripts/dtc/dtc-parser.tab.[ch]
  WRAP    arch/arm64/include/generated/asm/emergency-restart.h
  WRAP    arch/arm64/include/generated/asm/hw_irq.h
.
.
.
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CC      kernel/bounds.s
  CALL    scripts/atomic/check-atomics.sh
  UPD     include/generated/timeconst.h
  UPD     include/generated/bounds.h
  CC      arch/arm64/kernel/asm-offsets.s
  UPD     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  LDS     arch/arm64/kernel/vdso/vdso.lds
  CC      arch/arm64/kernel/vdso/vgettimeofday.o
  AS      arch/arm64/kernel/vdso/note.o
  AS      arch/arm64/kernel/vdso/sigreturn.o
  LD      arch/arm64/kernel/vdso/vdso.so.dbg
  VDSOSYM include/generated/vdso-offsets.h
  LDS     scripts/module.lds

  1. It looks succeeded. Retry sudo make the driver
/usr/src/rtl8812au$ sudo make                                                                                                                                                                 
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.120-rt70/build M=/usr/src/rtl8812au  modules                                                                                                                   
make[1]: Entering directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'                                                                                                                                     
  CC [M]  /usr/src/rtl8812au/core/rtw_cmd.o                                                                                                                                                                        
  CC [M]  /usr/src/rtl8812au/core/rtw_security.o                                                                                                                                                                   
  CC [M]  /usr/src/rtl8812au/core/rtw_debug.o                                                                                                                                                                      
  CC [M]  /usr/src/rtl8812au/core/rtw_io.o                                                                                                                                                                         
  CC [M]  /usr/src/rtl8812au/core/rtw_ioctl_query.o                                                                                                                                                                
  CC [M]  /usr/src/rtl8812au/core/rtw_ioctl_set.o                                                                                                                                                                  
  CC [M]  /usr/src/rtl8812au/core/rtw_ieee80211.o                                                                                                                                                                  
  CC [M]  /usr/src/rtl8812au/core/rtw_mlme.o                                                                                                                                                                       
  CC [M]  /usr/src/rtl8812au/core/rtw_mlme_ext.o                                                                                                                                                                   
  CC [M]  /usr/src/rtl8812au/core/rtw_mi.o                                                                                                                                                                         
  CC [M]  /usr/src/rtl8812au/core/rtw_wlan_util.o                                                                                                                                                                  
  CC [M]  /usr/src/rtl8812au/core/rtw_vht.o                                                                                                                                                                        
  CC [M]  /usr/src/rtl8812au/core/rtw_pwrctrl.o                                                                                                                                                                    
  CC [M]  /usr/src/rtl8812au/core/rtw_rf.o                                                                                                                                                                         
  CC [M]  /usr/src/rtl8812au/core/rtw_chplan.o                                                                                                                                                                     
  CC [M]  /usr/src/rtl8812au/core/rtw_recv.o                                                                                                                                                                       
  CC [M]  /usr/src/rtl8812au/core/rtw_sta_mgt.o         
.
.
.
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/halhwimg8821a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8821a/halrf_8821a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/phydm_regconfig8821a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8821a/phydm_rtl8821a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8821a/halrf_iqk_8821a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_bb.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_mac.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/halhwimg8814a_rf.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8814a/halrf_iqk_8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/phydm_regconfig8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/halrf/rtl8814a/halrf_8814a_ce.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/rtl8814a/phydm_rtl8814a.o
  CC [M]  /usr/src/rtl8812au/hal/phydm/txbf/haltxbf8814a.o
  CC [M]  /usr/src/rtl8812au/platform/platform_ops.o
  CC [M]  /usr/src/rtl8812au/core/rtw_mp.o
  LD [M]  /usr/src/rtl8812au/88XXau.o
WARNING: Symbol version dump "Module.symvers" is missing.
         Modules may not have dependencies or modversions.
  MODPOST /usr/src/rtl8812au/Module.symvers
WARNING: modpost: Symbol info of vmlinux is missing. Unresolved symbol check will be entirely skipped.
  CC [M]  /usr/src/rtl8812au/88XXau.mod.o
  LD [M]  /usr/src/rtl8812au/88XXau.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.10.120-rt70/kernel-5.10'
---------------------------------------------------------------------------
Visit https://github.com/aircrack-ng/rtl8812au for support/reporting issues
or check for newer versions (branches) of these drivers.                   
---------------------------------------------------------------------------

  1. The warning msg is the same as before natively kernel build. Load the driver and Check modinfo.
/usr/src/rtl8812au$ sudo cp 88XXau.ko /usr/src/linux-headers-5.10.120-rt70/kernel-5.10/kernel/                                                                                                
/usr/src/rtl8812au$ sudo modprobe 88XXau                                                                                                                                                      
modprobe: ERROR: could not insert '88XXau': Exec format error    

/usr/src/rtl8812au$ sudo modinfo 88XXau                                                                                                                                                       
filename:       /lib/modules/5.10.120-rt70/kernel/88XXau.ko                                                                                                                                                        
import_ns:      VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver                                                                                                                                          
version:        v5.6.4.2_35491.20191025                                                                                                                                                                            
author:         Realtek Semiconductor Corp.                                                                                                                                                                        
description:    Realtek Wireless Lan Driver                                                                                                                                                                        
license:        GPL                                                                                                                                                                                                
import_ns:      VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver                                                                                                                                          
srcversion:     4BB9D2BDAFDF2EFEDC69D20                                                                                                                                                                            
alias:          usb:v7392pA833d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v7392pA834d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v2357p0106d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v20F4p809Bd*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v20F4p809Ad*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v2001p331Ad*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v0E66p0026d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v0846p9054d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v056Ep400Dd*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v056Ep400Bd*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v0B05p1853d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v0B05p1852d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v0B05p1817d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v0BDAp8813d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v7392pB611d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v7392pA813d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v7392pA812d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v7392pA811d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v3823p6249d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v2357p0120d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v2357p011Fd*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v2357p011Ed*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v2019pAB32d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v2001p3318d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v2001p3314d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v0E66p0023d*dc*dsc*dp*ic*isc*ip*in*                                                                                                                                                            
alias:          usb:v0846p9052d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4010d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep400Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4007d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0953d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p029Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p0242d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0823d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp0820d*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDApA811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0821d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392pA822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2604p0012d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0122d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0103d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0101d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p805Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB30d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3316d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3315d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3313d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p330Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1740p0100d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v148Fp9097d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v13B1p003Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1058p0632d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0022d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0074d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p17D2d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9051d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07B8p8812d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0789p016Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0586p3426d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1106d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BBp0952d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0411p025Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0409p0408d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp881Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8812d*dc*dsc*dp*ic*isc*ip*in*
depends:        cfg80211
name:           88XXau
vermagic:       5.10.120-tegra SMP preempt mod_unload modversions aarch64
parm:           rtw_wireless_mode:int
parm:           rtw_monitor_overwrite_seqnum:Overwrite the sequence number of injected frames (int)
parm:           rtw_monitor_retransmit:Retransmit injected frames (int)
parm:           rtw_monitor_disable_1m:Disable default 1Mbps rate for monitor injected frames (int)
parm:           rtw_ips_mode:The default IPS mode (int)
parm:           rtw_lps_level:The default LPS level (int)
parm:           rtw_lps_chk_by_tp:int
parm:           rtw_max_bss_cnt:int
parm:           rtw_usb_rxagg_mode:int
parm:           rtw_dynamic_agg_enable:int                                                                                                                                                                         
parm:           rtw_tx_bw_mode:The max tx bw for 2.4G and 5G. format is the same as rtw_bw_mode (uint)                                                                                                             
parm:           rtw_rx_ampdu_sz_limit_1ss:RX AMPDU size limit for 1SS link of each BW, 0xFF: no limitation (array of uint)                                                                                         
parm:           rtw_rx_ampdu_sz_limit_2ss:RX AMPDU size limit for 2SS link of each BW, 0xFF: no limitation (array of uint)                                                                                         
parm:           rtw_rx_ampdu_sz_limit_3ss:RX AMPDU size limit for 3SS link of each BW, 0xFF: no limitation (array of uint)                                                                                         
parm:           rtw_rx_ampdu_sz_limit_4ss:RX AMPDU size limit for 4SS link of each BW, 0xFF: no limitation (array of uint)
parm:           rtw_vht_enable:int
parm:           rtw_vht_rx_mcs_map:VHT RX MCS map (uint)
parm:           rtw_rf_config:int
parm:           rtw_country_code:The default country code (in alpha2) (charp)
parm:           rtw_channel_plan:The default chplan ID when rtw_alpha2 is not specified or valid (int)
parm:           rtw_excl_chs:exclusive channel array (array of uint)
parm:           rtw_qos_opt_enable: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_wowlan_sta_mix_mode:int
parm:           rtw_pwrtrim_enable:int
parm:           rtw_initmac:charp
parm:           rtw_special_rf_path: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_ht_enable:int
parm:           rtw_bw_mode:int
parm:           rtw_ampdu_enable:int
parm:           rtw_rx_stbc:int
parm:           rtw_rx_ampdu_amsdu:int
parm:           rtw_tx_ampdu_amsdu:int
parm:           rtw_beamform_cap:int
parm:           rtw_lowrate_two_xmit:int
parm:           rtw_power_mgnt:int
parm:           rtw_smart_ps:int
parm:           rtw_low_power:int
parm:           rtw_wifi_spec:int
parm:           rtw_full_ch_in_p2p_handshake:int
parm:           rtw_antdiv_cfg:int
parm:           rtw_antdiv_type:int
parm:           rtw_drv_ant_band_switch:int
parm:           rtw_single_ant_path:int
parm:           rtw_switch_usb_mode:int
parm:           rtw_enusbss:int
parm:           rtw_hwpdn_mode:int
parm:           rtw_hwpwrp_detect:int
parm:           rtw_hw_wps_pbc:int
parm:           rtw_check_hw_status:int
parm:           rtw_led_ctrl:Led Control: 0=Always off, 1=Normal blink, 2=Always on (int)
parm:           rtw_max_roaming_times:The max roaming times to try (uint)
parm:           rtw_mc2u_disable:int
parm:           rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)
parm:           rtw_hiq_filter:0:allow all, 1:allow special, 2:deny all (uint)
parm:           rtw_adaptivity_en:0:disable, 1:enable (uint)
parm:           rtw_adaptivity_mode:0:normal, 1:carrier sense (uint)
parm:           rtw_adaptivity_th_l2h_ini:th_l2h_ini for Adaptivity (int)
parm:           rtw_adaptivity_th_edcca_hl_diff:th_edcca_hl_diff for Adaptivity (int)
parm:           rtw_amplifier_type_2g:BIT3:2G ext-PA, BIT4:2G ext-LNA (uint)
parm:           rtw_amplifier_type_5g:BIT6:5G ext-PA, BIT7:5G ext-LNA (uint)
parm:           rtw_RFE_type:default init value:64 (uint)
parm:           rtw_powertracking_type:default init value:64 (uint)
parm:           rtw_GLNA_type:default init value:0 (uint)
parm:           rtw_TxBBSwing_2G:default init value:0xFF (uint)
parm:           rtw_TxBBSwing_5G:default init value:0xFF (uint)
parm:           rtw_OffEfuseMask:default open Efuse Mask value:0 (uint)
parm:           rtw_FileMaskEfuse:default drv Mask Efuse value:0 (uint)
parm:           rtw_rxgain_offset_2g:default RF Gain 2G Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gl:default RF Gain 5GL Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gh:uint
parm:           rtw_rxgain_offset_5gm:default RF Gain 5GM Offset value:0 (uint)
parm:           rtw_pll_ref_clk_sel:force pll_ref_clk_sel, 0xF:use autoload value (uint)
parm:           rtw_tx_pwr_by_rate:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_tx_pwr_lmt_enable:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_target_tx_pwr_2g_a:2.4G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_b:2.4G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_c:2.4G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_d:2.4G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_a:5G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_b:5G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_c:5G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_5g_d:5G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_tsf_update_pause_factor:num of bcn intervals to stay TSF update pause status (int)
parm:           rtw_tsf_update_restore_factor:num of bcn intervals to stay TSF update restore status (int)
parm:           rtw_phy_file_path:The path of phy parameter (charp)
parm:           rtw_load_phy_file:PHY File Bit Map (int)
parm:           rtw_decrypt_phy_file:Enable Decrypt PHY File (int)
parm:           rtw_en_napi:int
parm:           rtw_en_gro:int
parm:           rtw_iqk_fw_offload:int
parm:           rtw_ch_switch_offload:int

I can’t understand even I build natively the entire kernel source in Jetson orin NX why the module shows vermagic: 5.10.120-tegra SMP preempt mod_unload modversions aarch64

Did I miss something or make a mistake possibly?
Thank you!

I’m just jumping in, have not followed this in detail. What was the reason for this compile command?
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.120-rt70/build M=/usr/src/rtl8812au modules
…more specifically, why was there no CROSS_COMPILE= listed? Note that if you cross compile, then you need this and you need the ARCH, but you only specified ARCH. If you are natively compiling, then you must not use either of ARCH or CROSS_COMPILE. I mention that due to the exec format error.

Also, if you are using the kernel Image, and not vmlinux, then you probably don’t want to build everything. You would specifically build the Image target.