[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#757632: kfreebsd-10: crazy long paths used during build



Package: src:kfreebsd-10
Version: 10.0-6
Severity: wishlist
Tags: patch

Hi,

Suppose I extracted a kfreebsd source package to:
/home/foo/bar/kfreebsd-10-10.0-1

The source code would be extracted to and patched in:
/home/foo/bar/kfreebsd-10-10.0-1/sys

A copy of it is made to build each flavour, such as to:
/home/foo/bar/kfreebsd-10-10.0-1/flavor-10.0-1-amd64/sys

The top-level make is done from this working directory:
/home/foo/bar/kfreebsd-10-10.0-1/flavor-10.0-1-amd64/sys/amd64/compile/DEBCUSTOM

But to compile the modules, it creates a full tree of output directories
for each of the modules' object and .ko output files -- here!:
/home/foo/bar/kfreebsd-10-10.0-1/flavor-10.0-1-amd64/sys/amd64/compile/DEBCUSTOM/modules/home/foo/bar/kfreebsd-10-10.0-1/flavor-10.0-1-amd64/sys/modules/

The latter is of course crazy, and seemingly unnecessary for us -- since
we already work with a copy of the source tree, I wouldn't be worried
about cluttering it with the output files.

A later `make install` step already copies the .ko files to another
location before the Debian binary package is assembled from them.

There seems to be a trivial way to avoid this (though it took a long
time to figure it out, obviously):

--- a/sys/conf/kern.pre.mk	2014-08-07 22:53:08.000000000 +0100
+++ b/sys/conf/kern.pre.mk	2014-08-10 01:16:41.735384899 +0100
@@ -182,7 +182,7 @@
 # MKMODULESENV is set here so that port makefiles can augment
 # them.
 
-MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
+MKMODULESENV+= MAKEOBJDIRPREFIX=/ KMODDIR=${KODIR}
 MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH}
 .if (${KERN_IDENT} == LINT)
 MKMODULESENV+= ALL_MODULES=LINT

That avoids prefixing the output directory 'twice', leaving us with
only this (and its subdirectories), which exist(s) already:
/home/foo/bar/kfreebsd-10-10.0-1/flavor-10.1-1-amd64/sys/modules/

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-2-amd64-xenhvm-ipsec
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash


Reply to: