Im trying to install drivers for a rosewill RNX-N600UBE wireless card (Ralink RT2870 chipset) on Kali Linux. I downloaded the drivers form their website and unpacked/unzipped them, but now when i try to run the 'make' command i get this error.

/home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.c:1156:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’
/home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.c:1157:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’
make[4]: *** [/home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.o] Error 1
make[3]: *** [_module_/home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
  • I think you might need a different version of something, maybe the compiler? – PlasmaPower Apr 16 '14 at 13:43
  • As a side-note, why would someone new to Linux fiddle with Kali? Thats a distro for security tests and attacks, packed with low level tools. Surely not meant for an unexperienced linux user – MestreLion Oct 19 '18 at 5:05

The issue is that one of the kernel headers / interfaces changed in a recent 3.x kernel. Where a UID / GID values were originally referred to as regular integers, they are now structs with a single element. Any code relying on the older definition now will fail to compile until updated to match the new kernel headers.

I'm currently experimenting with patching a similar error in virtualbox-guest-utils for my Ubuntu install; in theory locating and replacing instances of ->i_uid = with ->i_uid.val = or ->i_gid = with ->i_gid.val = on the line numbers reported in the error should fix the problem (but I can't guarantee that at this time as compilation is now failing on a different, unrelated, error for me).

Your best bet is contacting the original author of your code for an updated version of the source that works with the newer kernels.

| improve this answer | |
  • 7
    Tested! This DOES work! I changed current_fsuid() to current_fsuid().val – Jonathan Apr 27 '15 at 0:09
  • 1
    For me, I also had to change current_fsgid() to current_fsgid().val – I like to code Oct 14 '15 at 11:22
  • @JonathanLeaders touché Thanks. However, the patch converting int to kuid_t also seems to do the trick. – enthusiasticgeek Oct 16 '15 at 16:00

I found a fix to the compilation errors in another driver on this website: http://www.arnelborja.com/compiling-rt2870-wifi-driver-in-fedora/

below is the patch content:

--- include/os/rt_linux.h   2013-09-12 13:27:14.000000000 +0800
+++ include/os/rt_linux.h.patched   2014-03-23 11:45:03.907628847 +0800
@@ -279,8 +279,8 @@ typedef struct file* RTMP_OS_FD;

 typedef struct _OS_FS_INFO_
-   int             fsuid;
-   int             fsgid;
+   kuid_t              fsuid;
+   kgid_t              fsgid;
    mm_segment_t    fs;
| improve this answer | |
  • 1
    This is a good, working solution for the MT7601U driver, used for the Mediatek/Ralink 148F:7601 chipset, as well. (Yes, I'm just adding these keywords for SEO reasons.) – billyjmc Mar 30 '15 at 3:29
  • for my kernel 4.13.16-302.fc27.x86_64 on Fedora 27, this don't work anymore. Fails with compiling error. – kmonsoor Dec 9 '17 at 12:27
  • @billyjmc: just note that, as-is, this solution does not work for kernels < 3.5, where kuid_t and kgid_t were introduced. For those, k must be dropped, as in uid_t fsuid; and gid_t fsgid; – MestreLion Oct 19 '18 at 5:10
  • Confirmed works on Centos 7.11 (3.10.0-1127.8.2.el7.x86_64) – Ron May 29 at 17:04

make only reports the errors but they are in fact errors from your compiler (probably gcc):

error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’ 

Basically, your code is buggy or inappropriate for your platform but make functions correctly.

| improve this answer | |

This solution worked for me. The procedure I followed was:

  1. I followed the steps for my distribution (Debian Jessie) from here.

  2. I saved de driver for Linux of the manufacturer (which comes with the equipment in the CDROM), and I unzipped it to a folder.

  3. In the folder, I typed make (as root), and I got an error. So, I did the modification above, and it worked.

  4. I typed make install (as root), I rebooted the computer, and the wireless interface was recognized. I configured it and it worked. ;)

My system is: Debian Jessie, kernel 3.16.0-4-amd64, using gnome.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.