中缺少Ubuntu proc_root_driver

时间:2021-11-27 23:49:04

I am trying to compile a kernel module in Ubuntu 10.04 with kernel 2.6.35-22 and it is complaining about proc_root_driver missing. I did some searching and I found that is supposed to define this but in my version of the linux-headers, it isn't defined. Is there another global variable I am supposed to use in its place or is there a way that I can define it somewhere so that the kernel module can compile?

我试图在内核2.6.35-22的Ubuntu 10.04中编译内核模块,它抱怨proc_root_driver缺失。我做了一些搜索,我发现应该定义这个,但在我的linux-headers版本中,它没有定义。是否有我应该在其中使用的另一个全局变量,或者有一种方法可以在某处定义它以便内核模块可以编译?

1 个解决方案

#1


2  

proc_root_driver used to be a pointer to a proc_dir_entry created as proc_mkdir("driver", NULL);. It was removed in April 2008 in this commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=928b4d8c8963e75bdb133f562b03b07f9aa4844a

proc_root_driver曾经是一个指向proc_dir_entry的指针,创建为proc_mkdir(“driver”,NULL);.它于2008年4月在此提交中删除:http://git.kernel.org/?p = linux / kernel / git / torvalds / linux-2.6.git; a = commit; h = 928b4d8c8963e75bdb133f562b03b07f9aa4844a

Also, I don't think it was ever supposed to be part of the kernel API, AFAIK it was an internal thing.

此外,我认为它不应该是内核API的一部分,AFAIK它是内部的东西。

It doesn't do much, really. All you need to do is use the full path under /proc, i.e. replace code that looks like

它确实做得不多。您需要做的就是使用/ proc下的完整路径,即替换看起来像的代码

proc_array = proc_mkdir("drvnamehere", proc_root_driver);

with code that looks like

代码看起来像

proc_array = proc_mkdir("driver/drvnamehere", NULL);

and you should be fine.

你会没事的

#1


2  

proc_root_driver used to be a pointer to a proc_dir_entry created as proc_mkdir("driver", NULL);. It was removed in April 2008 in this commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=928b4d8c8963e75bdb133f562b03b07f9aa4844a

proc_root_driver曾经是一个指向proc_dir_entry的指针,创建为proc_mkdir(“driver”,NULL);.它于2008年4月在此提交中删除:http://git.kernel.org/?p = linux / kernel / git / torvalds / linux-2.6.git; a = commit; h = 928b4d8c8963e75bdb133f562b03b07f9aa4844a

Also, I don't think it was ever supposed to be part of the kernel API, AFAIK it was an internal thing.

此外,我认为它不应该是内核API的一部分,AFAIK它是内部的东西。

It doesn't do much, really. All you need to do is use the full path under /proc, i.e. replace code that looks like

它确实做得不多。您需要做的就是使用/ proc下的完整路径,即替换看起来像的代码

proc_array = proc_mkdir("drvnamehere", proc_root_driver);

with code that looks like

代码看起来像

proc_array = proc_mkdir("driver/drvnamehere", NULL);

and you should be fine.

你会没事的