Fox*_*Fox 14 linux compiling wifi drivers
我正在尝试在 Kali Linux 上为 Rosewill RNX-N600UBE 无线卡(Ralink RT2870 芯片组)安装驱动程序。我从他们的网站下载了驱动程序并解压/解压了它们,但是现在当我尝试运行“make”命令时出现此错误。
/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
Run Code Online (Sandbox Code Playgroud)
小智 19
问题是在最近的 3.x 内核中更改了内核头文件/接口之一。UID / GID 值最初被称为常规整数,现在它们是具有单个元素的结构。现在任何依赖于旧定义的代码都将无法编译,直到更新以匹配新的内核头文件。
我目前正在尝试为我的 Ubuntu 安装修补 virtualbox-guest-utils 中的类似错误;理论上,在错误中报告的行号上定位和替换->i_uid =with->i_uid.val =或->i_gid =with 的实例->i_gid.val =应该可以解决问题(但我不能保证此时编译失败,因为我的另一个不相关的错误)。
最好的办法是联系您的代码的原始作者,以获取适用于较新内核的源代码的更新版本。
小智 12
我在这个网站上找到了另一个驱动程序中编译错误的修复:http : //www.arnelborja.com/compiling-rt2870-wifi-driver-in-fedora/
以下是补丁内容:
--- 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;
} OS_FS_INFO;
Run Code Online (Sandbox Code Playgroud)
make只报告错误,但实际上它们是来自编译器(可能是 gcc)的错误:
error: incompatible types when assigning to type \xe2\x80\x98int\xe2\x80\x99 from type \xe2\x80\x98kuid_t\xe2\x80\x99 \nRun Code Online (Sandbox Code Playgroud)\n\n基本上,您的代码有错误或不适合您的平台,但make功能正常。