Re: Building external module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 28, 2008 at 03:33:30AM +0500, Shahbaz Khan wrote:
> On Sat, Jun 28, 2008 at 3:14 AM, Adrian Bunk <bunk@xxxxxxxxxx> wrote:
> > On Sat, Jun 28, 2008 at 02:51:51AM +0500, Shahbaz Khan wrote:
> >> On Sat, Jun 28, 2008 at 2:32 AM, Adrian Bunk <bunk@xxxxxxxxxx> wrote:
> >> > On Sat, Jun 28, 2008 at 02:16:14AM +0500, Shahbaz Khan wrote:
> >> >> Hi,
> >> >>
> >> >> Need to compile an external module as a kernel built-in module. Its
> >> >> Makefile is set as obj-m meaning as a loadable module so it will be
> >> >> kept on filesystem separately. This means I have to do obj-y to make
> >> >> it built-in. But I wanted to know, before I just try it out, that the
> >> >> Makefile of the kernel module is way too complex for me and there was
> >> >> an install target which is creating files for miscilleneous functions
> >> >> of the module and it had a /dev/<module-name>, which means its a
> >> >> device driver.
> >> >>
> >> >> So what do I need to consider apart from the change obj-m to obj-y?
> >> >
> >> > It does not work this way.
> >>
> >> Are you sure because in kernel top-level Makefile contains SUBDIRS
> >> symbol for external modules and if it contains a path then target all
> >> becomes _all else _all becomes modules. Personally, I am not sure of
> >> this behavior but I think if we can do obj-y instead of obj-m than
> >> maybe this module is built-in. Sorry you already said it's not
> >> possible but I am still curious why it doesn't in the light of
> >> SUBDIRS.
> >
> > The reason is simple:
> > When an external module gets built the kernel image is not rebuilt.
> 
> Thats what I am trying to say. I am newbie but the following makes sense to me:
> 
> If the SUBDIRS will take "make" to the external module by setting its
> value to KBUILD_EXTMOD. Consider the following lines from kernel
> Makefile:
> 
> # If building an external module we do not care about the all: rule
> # but instead _all depend on modules
> PHONY += all
> ifeq ($(KBUILD_EXTMOD),)
> _all: all
> else
> _all: modules
> endif
> 
> If the module's Makefile consists of obj-y instead of obj-y then its
> should work. ...?

You can either trust me that it doesn't work or try it yourself.

And what is the actual problem why you can't simply use it as a module?

> >> By the way can you suggest how do I workout getting the code inside
> >> the kernel source.
> >>
> >> Analyzing the following from module's Makefile:
> >>
> >> all:  $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
> >>       @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
> >>
> >> I thought maybe if i replace "modules" with "all", it might have the
> >> same effect as what I suggested in case of SUBDIRS for kernel
> >> Makefile.
> >
> > Where can I find the source for this module?
> 
> I am not sure what you mean by the source of the module? If you mean
> source to the module Makefile then here it is:
>...
> # module settings
> MODULE_NAME    := <MODULE_NAME>
>...

Why are you obfuscating the fact that you are trying to build the 
tpm_emulator module?

> Shaz

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux