public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Miller, Brendan" <Brendan.Miller@Dialogic.com>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Re: Proper way to release binary-only driver?
Date: 05 Apr 2001 05:50:55 -0600	[thread overview]
Message-ID: <m1g0fnwoo0.fsf@frodo.biederman.org> (raw)
In-Reply-To: <EFC879D09684D211B9C20060972035B1D46A39@exchange2ca.sv.dialogic.com>
In-Reply-To: "Miller, Brendan"'s message of "Thu, 5 Apr 2001 06:58:34 -0400"

"Miller, Brendan" <Brendan.Miller@Dialogic.com> writes:

> I have the need to distribute a binary-only driver (no flames, please), but
> I am not certain how to build it so that it can be used on multiple kernel
> versions.  (Or is this impossible?)

It's possible but frowned on.  As a general rule any problem that occurs
in a system with a binary only driver, you will be called for support.  Because
there is no easy way for the normal kernel developers to rule out your
code is not doing something nasty.

> I didn't find any "HOWTO (or recommendation) for proper binary-only driver
> release etiquette", so if there are some preferred means, please let me
> know.
> 
> I specifically had issues with the whole MODVERSIONS thing.  I can include
> <linux/verion.h> and <linux/config.h> to get the right CONFIG_MODVERSIONS
> macro definitions, and then include <linux/modversions.h> as appropriate.
> The end result is a driver with symbols whose names are mangled to match the
> modversion-enabled mangling of a modversion-enabled kernel.  This is good if
> I release on the same kernel version.
> 
> Obviously, if I use a different kernel the module refuses to load.  My first
> guess was to get rid of the module-versioning stuff so that the symbols are
> not mangled, and this seems to work, except that I must use insmod -f module
> for kernels with a different version than what I built with.

MODVERSIONS doesn't mangle the structures/functions it includes a
checksum.  If the checksum is the same you are guaranteed the
interface is the same, otherwise something has changed.  So
MODVERSIONS is what you want if you want to go between kernels.

>  So, if there are guides that I didn't find, or ones on this list that
> someone things I should use, please let me know.  Or at least comment on my
> chosen way of doing things.  It's this sort of thing that reinforces a
> source form driver is the way to release stuff--then it can be built
> alongside the user's kernel tree...

The general recommendation (I have heard) is to include a bit of
source that provides a kernel abstraction layer that will stay the
same between kernels that your binary only driver can use, and to let
users compile that with different kernels.

But yes.  The source form driver is the recommended way to release
kernel code.   And I would highly encourage you to figure out how to
do a source release, under the GPL so your driver can be included in
the mainstream kernel. Without that your device will be at best only
semi supported under linux.

Binary only drivers also happen to have another big deficiency that
you haven't mentioned.  They don't have a prayer of working on
multiple cpu architectures.  And with x86-64 and ia64 just around the
corner this is likely to be a practical issue for a lot of people.

If what you are after is a way to release a driver that is not a
hassle to add to an already working system, you will find a more
receptive ear.  I have heard some talk, that it would be a good idea
to figure out how to standardize how to compile a kernel driver
outside the kernel tree, so it could be trivial enough that anyone
could do it.  To date there are enough people around who don't have
problems compiling their own kernel that this hasn't become a major
issue.

Eric

  reply	other threads:[~2001-04-05 11:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-05 10:58 Proper way to release binary-only driver? Miller, Brendan
2001-04-05 11:50 ` Eric W. Biederman [this message]
2001-04-06 15:50   ` Proper way to release binary driver? Christopher Turcksin
2001-04-06 16:09     ` Joel Jaeggli
2001-04-06 16:22     ` J . A . Magallon
2001-04-07  1:24     ` How to build modules outside the kernel tree? [Was: Proper way to release binary driver?] Eric W. Biederman
2001-04-08 13:10       ` Jamie Lokier
2001-04-07  8:18     ` Proper way to release binary driver? Alan Cox
2001-04-09 13:11       ` Henning P. Schmiedehausen
2001-04-07 11:06     ` Christopher Turcksin
2001-04-06  5:33 ` Proper way to release binary-only driver? Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1g0fnwoo0.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=Brendan.Miller@Dialogic.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox