Xserver 模块的版本信息
我正在尝试找到一个工具,可以从 Xserver 模块中提取模块版本信息(模块记录的一部分)。例如,在 Xorg 日志中,我可以在 Xorg.0.log 文件中看到 librecord 模块的以下信息...
[ 39.892] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
[ 39.905] (II) Module record: vendor="X.Org Foundation"
[ 39.905] compiled for 1.9.0, module version = 1.13.0
[ 39.905] Module class: X.Org Server Extension
[ 39.905] ABI class: X.Org Server Extension, version 4.0
是否有工具可以让我轻松提取上述信息。有时您可以在模块上使用 modinfo,它将包含版本信息,但这并不总是有效。我现在知道的唯一一致的方法是解析 xorg 日志文件。谢谢。
I am trying to find a tool that will extract the module version information (a part of the module record) fron an Xserver module. For example, in the Xorg logs I can see the following information for the librecord module in my Xorg.0.log file...
[ 39.892] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
[ 39.905] (II) Module record: vendor="X.Org Foundation"
[ 39.905] compiled for 1.9.0, module version = 1.13.0
[ 39.905] Module class: X.Org Server Extension
[ 39.905] ABI class: X.Org Server Extension, version 4.0
Is there a tools that would allow me to easily extract the aforementioned information. Sometimes you can use modinfo on the module and that will have version information, but that does not always work. The only consistent way I know of now is to parse the xorg log file. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,有,你也可以尝试写一个小的。
http://gitorious.org/xdriverprobe
问题是 xdriverprobe 无法在较新的服务器上编译,因为我没有'不要将其更新到最新的 ABI。此外,xdriverprobe 仅用于视频驱动程序,但它可以改编用于其他模块。主要源代码文件(xdriverprobe.c)只有不到500行,因此您可以通过阅读轻松学习。
它适用于 Ubuntu 11.10...
./xdriverprobe -o moduledata
提供您想要的信息。看一下它的源代码。它的作用是:
modulenameModuleData
的符号(如果您的模块名为modulename
),XF86ModuleData*
请参阅 < code>/usr/include/xorg/xf86Module.hvers
的成员花几个小时,您将能够编写一个非常小的代码来完成您想要的操作。
更多信息:http://www.xfree86.org/current/DESIGN17.html#65< /a> (非常古老的文档,但其中大部分内容今天仍然适用)。如果您对该文档不满意,则必须阅读 Xorg 源代码。
快乐黑客!
Yes, there is and you can also try to write a small one.
http://gitorious.org/xdriverprobe
The problem is that xdriverprobe won't compile on newer servers since I didn't update it to the newest ABIs. Also, xdriverprobe is only used for video drivers, but it can be adapted to be used on other modules. The main source code file (xdriverprobe.c) has less than 500 lines, so you can easily learn by reading it.
It works in Ubuntu 11.10...
./xdriverprobe -o moduledata
gives the information you want.Look at its source code. It does:
modulenameModuleData
(if your module is calledmodulename
)XF86ModuleData*
See/usr/include/xorg/xf86Module.h
vers
Spend a few hours and you'll be able to write a very tiny code that does what you want.
More information: http://www.xfree86.org/current/DESIGN17.html#65 (very old document, but most of what's written there is still true today). If you're not happy with that document, you have to read the Xorg source code.
Happy hacking!