remarkable-linux/include
Matt Domsch c988d2b284 [PATCH] modules: add version and srcversion to sysfs
This patch adds version and srcversion files to
/sys/module/${modulename} containing the version and srcversion fields
of the module's modinfo section (if present).

/sys/module/e1000
|-- srcversion
`-- version

This patch differs slightly from the version posted in January, as it
now uses the new kstrdup() call in -mm.

Why put this in sysfs?

a) Tools like DKMS, which deal with changing out individual kernel
   modules without replacing the whole kernel, can behave smarter if they
   can tell the version of a given module.  The autoinstaller feature, for
   example, which determines if your system has a "good" version of a
   driver (i.e.  if the one provided by DKMS has a newer verson than that
   provided by the kernel package installed), and to automatically compile
   and install a newer version if DKMS has it but your kernel doesn't yet
   have that version.

b) Because sysadmins manually, or with tools like DKMS, can switch out
   modules on the file system, you can't count on 'modinfo foo.ko', which
   looks at /lib/modules/${kernelver}/...  actually matching what is loaded
   into the kernel already.  Hence asking sysfs for this.

c) as the unbind-driver-from-device work takes shape, it will be
   possible to rebind a driver that's built-in (no .ko to modinfo for the
   version) to a newly loaded module.  sysfs will have the
   currently-built-in version info, for comparison.

d) tech support scripts can then easily grab the version info for what's
   running presently - a question I get often.

There has been renewed interest in this patch on linux-scsi by driver
authors.

As the idea originated from GregKH, I leave his Signed-off-by: intact,
though the implementation is nearly completely new.  Compiled and run on
x86 and x86_64.

From: Matthew Dobson <colpatch@us.ibm.com>

      build fix

From: Thierry Vignaud <tvignaud@mandriva.com>

      build fix

From: Matthew Dobson <colpatch@us.ibm.com>

      warning fix

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-24 00:06:40 -07:00
..
acpi
asm-alpha [PATCH] remove non-DISCONTIG use of pgdat->node_mem_map 2005-06-23 09:45:00 -07:00
asm-arm [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-arm26 [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-cris [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-frv [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-generic [PATCH] adjust per_cpu definition in non-SMP case 2005-06-23 09:45:28 -07:00
asm-h8300 [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-i386 [PATCH] kprobes: function-return probes 2005-06-23 09:45:21 -07:00
asm-ia64 [IA64] Fix pfn_to_nid() so the kernel compiles again for !CONFIG_DISCONTIGMEM. 2005-06-23 14:52:51 -07:00
asm-m32r [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-m68k [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-m68knommu [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-mips [PATCH] compat: introduce compat_time_t 2005-06-23 09:45:32 -07:00
asm-parisc [PATCH] compat: introduce compat_time_t 2005-06-23 09:45:32 -07:00
asm-ppc [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-ppc64 Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/paulus/ppc64-2.6 2005-06-23 09:49:55 -07:00
asm-s390 [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-sh [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-sh64 [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-sparc [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-sparc64 [PATCH] compat: introduce compat_time_t 2005-06-23 09:45:32 -07:00
asm-um [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-v850 [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
asm-x86_64 [PATCH] compat: introduce compat_time_t 2005-06-23 09:45:32 -07:00
asm-xtensa [PATCH] xtensa: Architecture support for Tensilica Xtensa Part 8 2005-06-24 00:05:22 -07:00
linux [PATCH] modules: add version and srcversion to sysfs 2005-06-24 00:06:40 -07:00
math-emu
media [PATCH] v4l: update for SAA7134 cards 2005-06-24 00:06:39 -07:00
mtd
net [TCP]: Add pluggable congestion control algorithm infrastructure. 2005-06-23 12:19:55 -07:00
pcmcia [PATCH] yenta TI: turn off interrupts during card power-on #2 2005-06-23 09:45:31 -07:00
rxrpc
scsi [PATCH] I2O: Adaptec specific SG_IO access, firmware access through sysfs and 2400A workaround 2005-06-24 00:05:28 -07:00
sound [PATCH] create a kstrdup library function 2005-06-23 09:45:18 -07:00
video