Re: [PATCH 5/5] kbuild: external module build doc

From: Sam Ravnborg (sam_at_ravnborg.org)
Date: 06/15/04

  • Next message: Atul Sabharwal: "[Announce] Non Invasive Kernel Monitor for threads/processes"
    Date:	Tue, 15 Jun 2004 21:55:42 +0200
    To: Jari Ruusu <jariruusu@users.sourceforge.net>
    
    

    On Tue, Jun 15, 2004 at 10:21:44PM +0300, Jari Ruusu wrote:
    > Sam Ravnborg wrote:
    > > --- /dev/null Wed Dec 31 16:00:00 196900
    > > +++ b/Documentation/kbuild/extmodules.txt 2004-06-14 22:25:21 +02:00
    > [snip]
    > > +A more advanced example
    > > +- - - - - - - - - - - -
    > > +This example shows a setup where a distribution has wisely decided
    > > +to separate kernel source and output files:
    > > +
    > > +Kernel src:
    > > +/usr/src/linux-<kernel-version>/
    > > +
    > > +Output from a kernel compile, including .config:
    > > +/lib/modules/linux-<kernel-version>/build/
    > ^^^^^
    > Wrong! The 'build' symlink has always pointed to kernel source dir in
    > separate source and object directory case.

    This document was written before Andreas posted his patch - I just never
    came around updating it.
                                                                ^^^^^^
    > Sam, You don't seem to have any idea how much breakage you introduce if you
    > insist on redirecting the 'build' symlink from source tree to object tree.

    No - and I still do not see it. Please explain how we can be backward
    compatible when vendors start utilising separate directories for src and output.

    Anyway, after I gave it some extra thoughs I concluded that
    /lib/modules/kernel-<version>/ was the wrong place to keep
    info about where to src for a given build is located.
    This information has to stay in the output directory.

    So what I will implement is that during the kernel build process
    (not the install part) a symlink named 'source' is placed
    in the root of the output directory - and links to the root of
    the kernel src used for building the kernel.

    Then /lib/modules/kernel-<version>/build/source will be where
    the source is located.
    And /lib/modules/kernel-<version>/build will point to the output files.

    If the vendor does not utilise separate src and output directories
    they will point to the same directory.
    If the vendor utilises separate output and source directories
    then thay will point in two different places.

    Comments?

            Sam
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Atul Sabharwal: "[Announce] Non Invasive Kernel Monitor for threads/processes"

    Relevant Pages

    • Re: [PATCH 0/2] kbuild updates
      ... it is not any more difficult to compile external modules ... because there is no way the to find the output directory except ... The documented way to build external modules has for a while now been ... iff the kernel were compiled using a separate output directory. ...
      (Linux-Kernel)
    • Re: Attempted summary of "RT patch acceptance" thread
      ... > fusion parts from being built during the same kernel build ... ... So your focus is on system calls that can have totally separate ... > in separate directories within mainline. ...
      (Linux-Kernel)
    • Re: Screw Linux, Im going back to Windows!
      ... >>> But we need some kernel support. ... >>> physical device from the block device even when it is ... fstab configured for another mount point, I get to pick which one to use. ... The symlink was also useful because the automounter doesn't actually create ...
      (comp.os.linux.security)
    • [PATCH] kbuild: Improve Kernel build with separated output
      ... To improve support for kernel build using separate output ... one to execute make in both the source and the output directory. ... Option b) allowed ordinary external modules that did not need ...
      (Linux-Kernel)
    • [PATCH 2/2] kbuild: Improved external module support
      ... # 1) When using a separate output directory create a small ... # in the kernel tree. ... # time recommended way to build an external module to ... prepare1 is updated first, then prepare0. ...
      (Linux-Kernel)