[PATCH] Symlinks for building external modules

From: Andreas Gruenbacher
Date: Thu Jun 03 2004 - 12:03:06 EST


Hi Sam,

modules not in the kernel source tree need to locate both the source tree and
the object tree (O=). Currently, the /lib/modules/$(uname -r)/build symlink
is the only reference we have; it historically points to the source tree from
2.4 times. The following patch changes this as follows (this is what we have
in the current SUSE tree now):

/lib/modules/$(uname -r)/source ==> source tree
/lib/modules/$(uname -r)/build ==> object tree

Both links are required for building external modules with:

make -C /lib/modules/$(uname -r)/source \
O=/lib/modules/$(uname -r)/build \
M=$(pwd)


Index: linux-2.6.7-rc2/Makefile
===================================================================
--- linux-2.6.7-rc2.orig/Makefile
+++ linux-2.6.7-rc2/Makefile
@@ -732,9 +732,10 @@ _modinst_:
sleep 1; \
fi
@rm -rf $(MODLIB)/kernel
- @rm -f $(MODLIB)/build
+ @rm -f $(MODLIB)/{source,build}
@mkdir -p $(MODLIB)/kernel
- @ln -s $(TOPDIR) $(MODLIB)/build
+ @ln -s $(srctree) $(MODLIB)/source
+ @ln -s $(objtree) $(MODLIB)/build
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst

# If System.map exists, run depmod. This deliberately does not have a


Thanks,
--
Andreas Gruenbacher <agruen@xxxxxxx>
SUSE Labs, SUSE LINUX AG
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/