[Q][SOLVED] Kernel Modules: Built-In -> External?
Last night, I built my first Android kernel from source (opensource.samsung.com) - it was a great experience. However, I wasn't able to accomplish my goals.
I'm trying to build a few specific kernel modules, but I need them to be external modules (*.ko). The build works well, but from what I can tell by the modules.builtin file(s), the specific ones I'm trying to get out of this are built-in only. During the compile, it generates *.o files just fine. At the end of the compile, it shows it used MODPOST to create 17 .ko files. All of these are noted in the modules.order file(s).
It seems that no matter what I do, I can't change whether these are built-in or external. I tried modifying the modules.builtin and modules.order files (there's multiple copies of these that reference the specific modules I want), but these just seem to get overwritten at build time.
I've done lots of searching here and abroad, and I can't seem to find the magic I'm looking for. I've tried many things, most notably:
- make <path>/<module>.ko
- make modules
- other various commands
- cd into subdir that contains the modules I want, running make there (no targets)
Doing more research, it seems it might point to the Makefile that's in the subdirectory of the modules I want. I see various "hello world" Makefiles out there, but most of these don't seem to be completely relevant to what I'm trying to do - plus I already have a Makefile for these modules.
I'm assuming that what I probably need to do is modify the Makefile that's specific to these modules, to force it to make .ko files instead of .o files. I'm also assuming that I can't simply change the lines in the Makefile to read "<module>.ko" instead of "<module>.o". I realize that there's a difference in these files.
I also thought the answers might lie in looking at the Makefile of one of the other 17 external modules that get created. However, it appears these are no different than the Makefile of the modules I'm after.
Okay, enough rambling - I'll give some details now, in case they are needed. I've downloaded the I337 source (MF3) from opensource.samsung.com. The three modules I need (so far) are: msm_kgsl_core.o, msm_adreno.o, msm_z180.o. The makefile that includes these three came from <source-root>/drivers/gpu/msm, and it is attached. I may need more than these three files later, but this is a good start.
I don't want to hear a bajillion questions about, "What are you planning to do with these files?" or "Why do you need them anyway?" - the answer is a longer story than this thread. Trust me, I just need these.
So what do I need to do to make these three files? Thank you for your help.
obj-y = built-in module
obj-m = external module
I still can't track down the source of the three variables in the last three lines of this Makefile, but they are obviously returning "y". I changed the last three lines manually to:
obj-m += msm_kgsl_core.o
obj-m += msm_adreno.o
obj-m += msm_z180.o
... and then ran a "make clean" and "make modules" again. Voilą: 20 modules built by MODPOST.