Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't compile kernel subdirectories
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
quykfox
n00b
n00b


Joined: 25 Jul 2016
Posts: 21
Location: USA

PostPosted: Wed Jan 17, 2018 5:58 am    Post subject: Can't compile kernel subdirectories Reply with quote

When I compile my kernel source tree in full using make -j5, it compiles fine with no errors. However, I'm only trying to edit specific kernel drivers in the staging area of the source tree to try and make some patches.
Lets say for instance that I modify /drivers/staging/comedi/comedidev.h and fix some stuff; according to several tutorials I've been reading, I should be able to compile just that comedi module by running:
Code:
make M=drivers/staging/comedi/


However, if I do that I just get the following output:
Code:

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
  MODPOST 0 modules
/bin/sh: scripts/mod/modpost: No such file or directory
make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 127
make: *** [Makefile:1512: modules] Error 2


How can I just build this module?
Back to top
View user's profile Send private message
blopsalot
Apprentice
Apprentice


Joined: 28 Jan 2017
Posts: 231

PostPosted: Wed Jan 17, 2018 3:12 pm    Post subject: Re: Can't compile kernel subdirectories Reply with quote

quykfox wrote:
When I compile my kernel source tree in full using make -j5, it compiles fine with no errors. However, I'm only trying to edit specific kernel drivers in the staging area of the source tree to try and make some patches.
Lets say for instance that I modify /drivers/staging/comedi/comedidev.h and fix some stuff; according to several tutorials I've been reading, I should be able to compile just that comedi module by running:
Code:
make M=drivers/staging/comedi/


However, if I do that I just get the following output:
Code:

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
  MODPOST 0 modules
/bin/sh: scripts/mod/modpost: No such file or directory
make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 127
make: *** [Makefile:1512: modules] Error 2


How can I just build this module?


u still need to run
Code:
make modules_prepare
at the top and possibly set EXTRAVERSION depending on sources.
Back to top
View user's profile Send private message
quykfox
n00b
n00b


Joined: 25 Jul 2016
Posts: 21
Location: USA

PostPosted: Thu Jan 18, 2018 1:38 am    Post subject: Re: Can't compile kernel subdirectories Reply with quote

blopsalot wrote:


u still need to run
Code:
make modules_prepare
at the top and possibly set EXTRAVERSION depending on sources.


So I ran
Code:
make prepare && make modules_prepare
, but it still doesn't seem to be compiling any modules.
Code:
 
$ make M=drivers/staging/comedi

WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
  MODPOST 0 modules

$


Even if I just type garbage into some of the files, the result is the same.
Back to top
View user's profile Send private message
quykfox
n00b
n00b


Joined: 25 Jul 2016
Posts: 21
Location: USA

PostPosted: Thu Jan 18, 2018 5:43 am    Post subject: Extra Debugging Information Reply with quote

I ran my module compilation attempt with V=1 (
Code:
make V=1 M=drivers/staging/comedi
) and got the following output:
Code:

test -e include/generatest -e include/generated/autoconf.h -a -e include/config/auto.conf || (      \
echo >&2;                     \
echo >&2 "  ERROR: Kernel configuration is invalid.";      \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";   \
echo >&2 ;                     \
/bin/false)
mkdir -p drivers/staging/comedi/.tmp_versions ; rm -f drivers/staging/comedi/.tmp_versions/*
make -f ./scripts/Makefile.build obj=drivers/staging/comedi
(cat /dev/null; ) > drivers/staging/comedi/modules.order
make -f ./scripts/Makefile.modpost
  find drivers/staging/comedi/.tmp_versions -name '*.mod' | xargs -r grep -h '\.ko$' | sort -u | sed 's/\.ko$/.o/' | scripts/mod/modpost   -i ./Module.symvers -I drivers/staging/comedi/Module.symvers  -o drivers/staging/comedi/Module.symvers -S  -w  -s -T -
ted/autoconf.h -a -e include/config/auto.conf || (      \
echo >&2;                     \
echo >&2 "  ERROR: Kernel configuration is invalid.";      \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";   \
echo >&2 ;                     \
/bin/false)
mkdir -p drivers/staging/comedi/.tmp_versions ; rm -f drivers/staging/comedi/.tmp_versions/*
make -f ./scripts/Makefile.build obj=drivers/staging/comedi
(cat /dev/null; ) > drivers/staging/comedi/modules.order
make -f ./scripts/Makefile.modpost
  find drivers/staging/comedi/.tmp_versions -name '*.mod' | xargs -r grep -h '\.ko$' | sort -u | sed 's/\.ko$/.o/' | scripts/mod/modpost   -i ./Module.symvers -I drivers/staging/comedi/Module.symvers  -o drivers/staging/comedi/Module.symvers -S  -w  -s -T -


Following these exact same steps on a different computer works perfectly. I have no idea what is wrong here.
Back to top
View user's profile Send private message
blopsalot
Apprentice
Apprentice


Joined: 28 Jan 2017
Posts: 231

PostPosted: Sun Jan 21, 2018 1:09 am    Post subject: Reply with quote

have you tried starting with a fresh tarball or reverting or whatever? sometimes I move too fast and do not keep track of everything i did and end up with a pile of crap lol. the point of no return. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum