Re: protecting source code in 2.6

From: Sam Ravnborg
Date: Thu May 20 2004 - 08:57:02 EST


> What we intend to do is, distribute the os interface module (osint.c)
> with
> source code and the device interface module as object code or library.
> The
> user will compile the os interface module on the target box and link it
> with the device interface module to generate the .ko (loadable module).
>
> We are not very sure of how to achieve this.
> Please help us address this issue.

Not a popolar topic on this mailing list..

>From a technical point of view what you need to do is simple.

You just need to distribute it as an external module, and provide the
dev.o file as part of this.
The dev.o file must be named 'dev.o_shipped'

Then you need a makefile like this:
obj-m := jinu.o
jinu-y := dev.o osinit.o

You can add a few more trick to enable use of plain make - see
article about external modules on the kernel page on lwn.net a few weeks ago.

What you need to compile the external module is simply:
make -C $KERNELSRC M=$PWD

Where KERNELSRC is a kernel with 'make module_prepare' executed.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/