Bug 2869

Summary: Do not erase source and build directories from the linux kernel build.
Product: buildroot Reporter: Marcelo Roberto Jimenez <mroberto>
Component: OtherAssignee: unassigned
Status: RESOLVED INVALID    
Severity: major CC: buildroot, mroberto
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: Patch to keep the "source" and "build" directories in the linux tree.

Description Marcelo Roberto Jimenez 2010-11-30 19:53:02 UTC
Created attachment 2743 [details]
Patch to keep the "source" and "build" directories in the linux tree.

When buiding and installing a package that compiles an out-of-the-tree
kernel module, it is necessary to have the "source" and "build"
directories on the linux kernel tree. This patch avoids the deletion
of these directories in linux.mk.
Comment 1 Thomas Petazzoni 2010-12-22 09:18:36 UTC
I think I see the problem, but I don't think it is the correct fix: those two symbolic links are intentionally being removed, because they point to directories that are outside of the target root filesystem, so on the target they do not make sense at all.

The current solution to build an out-of-tree kernel module is to use directly the kernel source directory, whose location is in $(LINUX26_DIR). An example of an out-of-tree kernel module packaged in Buildroot is package/linux-fusion/.

Another solution could be to do a "make modules_install" to the $(STAGING_DIR), but keeping the symbolic links in that case. But I'm not sure it gives a huge benefit compared to just using the kernel source code in $(LINUX26_DIR).

What do you think ?

Could you point us to the source code of the kernel module your are trying to build ?
Comment 2 Marcelo Roberto Jimenez 2011-01-07 17:36:56 UTC
I agree, although this is a method suggested in various places, those links are just a convenient way to find where are both the source and build directories given just the target directory. In buildroot we know those in advance, so there is really no need for the links.

The kernel module is a piece of software made in my work, so there is no big deal changing it.

With the help of the linux-fusion example, it was really easy to set up things. Maybe I didn't look at the right places, but I have missed this example completely.

Thanks for your reply, it did help a lot. Please disregard my patch, I consider the issue closed.
Comment 3 Peter Korsgaard 2011-01-10 23:14:36 UTC
Close issue.