Submitted by Herton Ronaldo Krzesinski on Feb. 1, 2013, 7:52 p.m.


Message ID 20130201195239.GA3322@herton-Z68MA-D2H-B3
State New
Headers show

Commit Message

Herton Ronaldo Krzesinski Feb. 1, 2013, 7:52 p.m.
On Fri, Feb 01, 2013 at 11:36:11AM -0500, Joseph Salisbury wrote:
> Hey Guys,
> I have a quick question about bug 1112442[0].  The bug reports that
> the source symbolic link uses a path of /build/buildd.  I also
> confirmed this is the same behaviour in the latest raring release.
> Under /usr/src/linux-headers-3.8.0-2-generic, I see:
> lrwxrwxrwx 1 root root     25 Jan 25 17:28 source ->
> /build/buildd/linux-3.8.0
> Is this expected behaviour?  Would one just remove and re-create
> this link to point to wherever they have the actual source tree
> installed?

First, it doesn't seem useful or needed to have this source symlink
in the headers package. I did a bit of debugging and the source symlink
appears to be created by the kernel itself, when we run make
to populate the headers directory for the package, from the kernel

# outputmakefile generates a Makefile in the output directory, if using a
# separate output directory. This allows convenient use of make in the
# output directory.
ifneq ($(KBUILD_SRC),)
        $(Q)ln -fsn $(srctree) source
        $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
            $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)

So probably we may want this patch for our package (untested):

Cc'ing our kernel ML so everyone can take a look and confirm/review

> Thanks,
> Joe
> [0] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1112442


Tim Gardner Feb. 5, 2013, 5:13 p.m.

Patch hide | download patch | download mbox

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 07584ad..3600fe1 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -219,6 +219,8 @@  endif
 	# We'll symlink this stuff
 	rm -f $(hdrdir)/Makefile
 	rm -rf $(hdrdir)/include2
+	# Remove bogus source symlink
+	rm -f $(hdrdir)/source
 	# Copy over the compilation version.
 	cp "$(builddir)/build-$*/include/generated/compile.h" \