how to make kernel module binary blob

萝らか妹 提交于 2020-01-02 15:04:52

问题


I want to distribute proprietary Linux module for various distros without pre-building the module for all of them. For example I have the following files:

wrapp.c
mod.c
fops.c

All wrapp.c is wrapper for all kernel functions I'm using:

unsigned int wrap_ioread8(void *addr)
{
    return ioread8(addr);
}

What I want to do is to give the customer mod.o and fops.o + the wrapp.c.

So I build the mod/fops.o on kernel 3.2 then tried to use them on kernel 2.6.32. The module builds without a problem but when I try ioctl() to the module I'm getting "invalid parameter". The ioctl interface is not changed between 3.2 and 2.6.32! so I'm stuck understanding what is wrong. If I build the module from source it works without a problem.

I was reading about binary blobs, o_shipped, etc. but so far I can't make it work. What am I missing?

Tried renaming the mod/fops.o to mod/fops.o_shipped but as long as I understand this it's only related to "make clean"...

来源:https://stackoverflow.com/questions/21680391/how-to-make-kernel-module-binary-blob

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!