• T
    kbuild: implement modules.order · 551559e1
    Tejun Heo 提交于
    When multiple built-in modules (especially drivers) provide the same
    capability, they're prioritized by link order specified by the order
    listed in Makefile.  This implicit ordering is lost for loadable
    modules.
    
    When driver modules are loaded by udev, what comes first in
    modules.alias file is selected.  However, the order in this file is
    indeterministic (depends on filesystem listing order of installed
    modules).  This causes confusion.
    
    The solution is two-parted.  This patch updates kbuild such that it
    generates and installs modules.order which contains the name of
    modules ordered according to Makefile.  The second part is update to
    depmod such that it generates output files according to this file.
    
    Note that both obj-y and obj-m subdirs can contain modules and
    ordering information between those two are lost from beginning.
    Currently obj-y subdirs are put before obj-m subdirs.
    
    Sam Ravnborg cleaned up Makefile modifications and suggested using awk
    to remove duplicate lines from modules.order instead of using separate
    C program.
    Signed-off-by: NTejun Heo <htejun@gmail.com>
    Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
    Cc: Bill Nottingham <notting@redhat.com>
    Cc: Rusty Russell <rusty@rustcorp.com.au>
    Cc: Kay Sievers <kay.sievers@vrfy.org>
    Cc: Jon Masters <jonathan@jonmasters.org>
    Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
    551559e1
Makefile 52.4 KB