Bug 164242 - net/openafs port breaks with KERNCONFDIR and include
Summary: net/openafs port breaks with KERNCONFDIR and include
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Benjamin Kaduk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-17 15:00 UTC by cyberleo
Modified: 2016-01-18 06:45 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (757 bytes, patch)
2012-01-17 15:00 UTC, cyberleo
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cyberleo 2012-01-17 15:00:22 UTC
Port installation crashes in post-extract with an out-of-tree configuration file that includes an in-tree configuration file.

Fix: Kernel config step should be executed in the in-tree config directory (KRNLCONFDIR) with an absolute path to the desired config file, as is done in /usr/src/Makefile.inc1 circa line 809 (stage 1: configuring the kernel).

Attached patch applied and tested to compile. Software appears to function properly.

Patch attached with submission follows:
How-To-Repeat: # mkdir /root/CONFIG
# echo "include GENERIC" > /root/CONFIG/TEST
# make -C /usr/ports/net/openafs KERNCONFDIR=/root/CONFIG KERNCONF=TEST post-extract

/bin/mkdir -p /usr/obj/usr/ports/net/openafs/work/conf
cd /root/CONFIG && /usr/sbin/config -d /usr/obj/usr/ports/net/openafs/work/conf TEST >/dev/null
config: TEST:2: cannot open included file
*** Error code 1

Stop in /usr/ports/net/openafs.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-01-17 15:00:30 UTC
Maintainer of net/openafs,

Please note that PR ports/164242 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/164242

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2012-01-17 15:00:33 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Ben Kaduk 2012-01-19 06:39:49 UTC
On Tue, 17 Jan 2012, Edwin Groothuis wrote:

> Maintainer of net/openafs,
>
> Please note that PR ports/164242 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>
> The full text of the PR can be found at:
>    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/164242

The bug is real and I believe the diagnosis basically correct, but the 
proposed fix is incomplete in that it does not fully solve the set of 
issues involving kernel configuration files and source trees living at 
non-default locations (I have upstream bug #130310 to remind me to look at 
these).  I would like to spend some time going through Makefile.inc1 (and 
possibly elsewhere) to get a better sense of what is actually needed. 
For example, we should probably be using some flavor of KERNSRCDIR which 
is related to SYSDIR.  I haven't had a chance to sit down and build a 
picture of how these pieces all fit together.

Alternately, I could backport the patches from upstream's git master to 
use bsd.kmod.mk for the kernel build, which eliminates most of these 
issues.  But I think it is probably simpler to not have to maintain those 
patches until there is a 1.8-series release, which I expect will be 
several years.

-Ben Kaduk
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2012-01-19 06:47:11 UTC
State Changed
From-To: feedback->suspended

Maintainer is looking over possible approaches to fixing the problem.
Comment 5 Martin Wilke freebsd_committer freebsd_triage 2012-04-11 00:24:01 UTC
State Changed
From-To: suspended->closed

feedback timeout.
Comment 6 Benjamin Kaduk freebsd_committer freebsd_triage 2012-04-11 00:25:25 UTC
State Changed
From-To: closed->open

The issue is still present; I have it on my TODO list. 


Comment 7 Benjamin Kaduk freebsd_committer freebsd_triage 2012-04-11 00:25:25 UTC
Responsible Changed
From-To: freebsd-ports-bugs->bjk

The issue is still present; I have it on my TODO list.
Comment 8 Alan Somers freebsd_committer freebsd_triage 2014-03-21 22:25:25 UTC
In revision r263429 I added a "-I" option to config(8), which works
just like cc(1)'s -I option.  This fixes the general case of using
kernel config files in non-default locations that include other config
files.  You should be able to write a patch for net/openafs's Makefile
that passes "-I ${SRC_BASE}/sys/${ARCH}/conf" to config(8) to fix this
bug.