modprobe: Get module initstate from /proc/modules if not supported via sysfs
commita1babd3e7560d88209367bc7e3daa1cc43c96fcc
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Wed, 30 Sep 2009 16:22:11 +0000 (30 17:22 +0100)
committerAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Thu, 1 Oct 2009 09:15:40 +0000 (1 10:15 +0100)
treea9ec03751cda20c389d831beaf37b9e985422ed4
parent1743de8a7c10c10f9f9e34255bf737515794219c
modprobe: Get module initstate from /proc/modules if not supported via sysfs

Apparently /sys/module/<module>/initstate only appeared in 2.6.20,
which is still in use.

Copy the original module_in_kernel() verbatim from the GIT archives,
and use it as a fallback if module_in_sysfs() doesn't work.

The original patch suggestion was shorter, but less obvious, adding
more untested code, and turned out to be harder to test.

References: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524940

Reported-by: Matthew J. Lockner <mlockner@iastate.edu>
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
modprobe.c