Bug 117645 - external kernel modules can't build as normal user
external kernel modules can't build as normal user
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
rawhide
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks: FC2Target
  Show dependency treegraph
 
Reported: 2004-03-05 22:20 EST by Gary Peck
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-18 23:16:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gary Peck 2004-03-05 22:20:59 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040211 Firefox/0.8

Description of problem:
With the 2.6 kernel, external modules should be buildable using just
the files in the kernel package without kernel-source (as in 2.4).
Doing a "make -C /lib/modules/VER/build SUBDIRS=. modules" in the
module source directory should work. However, some errors prevent this
from being possible unless you build the module as root.

Specifically, intermediate files in scripts/ and scripts/genksyms/
(all directories relative to /lib/modules/VER/build), aren't packaged
in kernel. As a result, the above make command tries to rebuild them
even though the final binary IS in kernel. The make fails because a
regular user doesn't have write access to the /lib/modules/VER/build
directory. The following command provides a workaround for the problem
by commenting out the final product in the Makefile (though a better
solution would probably be good):

sed -ie 's/^always/#always/' \
    /lib/modules/VER/build/scripts/Makefile \
    /lib/modules/VER/build/scripts/genksyms/Makefile

Also, some file timestamps are wrong, causing make once again to try
to rebuild files which are already built. The timestamps for
/lib/modules/VER/build/include/config/MARKER and
/lib/modules/VER/build/include/asm-i386/asm_offsets.h should be
updated using the following commands (though just touching all the
files before packaging would probably be best to avoid these problems
in the future):

touch -r `ls -t /lib/modules/VER/build/scripts/split-include \
    /lib/modules/VER/build/include/linux/autoconf.h \
    /lib/modules/VER/build/include/config/MARKER | head -1` \
    /lib/modules/VER/build/include/config/MARKER
touch -r /lib/modules/VER/build/arch/i386/kernel/asm-offsets.s \
    /lib/modules/VER/build/include/asm-i386/asm_offsets.h

Lastly, module compilation tries to write to
/lib/modules/VER/build/.__modpost.cmd. As far as I can tell, this file
isn't actually needed for the module to function. The following
command fixed this problem for me:

ln -s /dev/null /lib/modules/VER/build/.__modpost.cmd

After the above set of commands, building modules as a normal user is
once again possible. As an example, I'm trying to build the modules
from ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/.


Version-Release number of selected component (if applicable):
kernel-2.6.3-2.1.238

How reproducible:
Always

Steps to Reproduce:
1. Download, untar, and configure the linux-wlan-ng module.
2. Run make on the module
3.
    

Actual Results:  The make fails when it gets to the "make -C
/lib/modules/VER/build
SUBDIRS=.../linux-wlan-ng-0.2.1-pre20/src/p80211 modules" command with
a permission denied error trying to write to
/lib/modules/VER/build/scripts.


Expected Results:  The module should build successfully.

Additional info:

I've seen this problem ever since kernel 2.6 was introduced into
RawHide. The above set of commands has always fixed it.
Comment 1 Gary Peck 2004-03-06 16:39:26 EST
slight mistake in one of the commands above.
sed -ie
should be
sed -i -e
Comment 2 Warren Togami 2004-04-18 23:16:42 EDT
I would let the kernel developers correct me if I am completely
misunderstanding the situation, but I believe this is NOTABUG for
Fedora but rather external Makefiles.  There are also further
complications like Bug #121132 that prevent external module building,
which should be fixed soon in rawhide.

If this is still an issue with 327+ or later kernels please take it up
on fedora-devel-list.
Comment 3 Patrice Dumas 2004-05-05 17:24:56 EDT
it is solved for me in 2.6.5-1.349

Note You need to log in before you can comment on or make changes to this bug.