Linux: modpost does not build anything

前端 未结 12 1131
-上瘾入骨i
-上瘾入骨i 2020-12-20 14:58

I am having problems getting any kernel modules to build on my machine. Whenever I build a module, modpost always says there are zero modules:

MODPOST 0 modu         


        
12条回答
  •  甜味超标
    2020-12-20 15:20

    I spent all day glued to my computer fighting this precise problem..which ended up mysteriously disappearing like for OP.

    I can at least offer this meager detail from my experience: I was getting the same output as OP (for make V=1) and putting print statements in ${kernel_directory}/scripts/makefile.build showed that obj-m was strangely NOT being set after including my makefile, even though it was clearly typed as above.

    I did a bunch of fooling around with the line "obj-m += hello.o" and the ones around it. Eventually it magically worked..although it looked exactly the same as before in the end. Maybe I had copied those lines from a tutorial online and it contained some sort of invalid/incorrect character?

    For anyone experiencing this, verify that obj-m is in fact getting set to hello.o
    If it mysteriously isn't, delete the line, hell the whole Makefile, and retype it.

    I know that's not much help; I wish I could reproduce what happened!

提交回复
热议问题