From rmh@io.debian.net  Thu Apr 27 19:24:28 2006
Return-Path: <rmh@io.debian.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C35AE16A403
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Apr 2006 19:24:28 +0000 (UTC)
	(envelope-from rmh@io.debian.net)
Received: from io.debian.net (io.ethz.ch [129.132.80.17])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 359B043D48
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Apr 2006 19:24:28 +0000 (GMT)
	(envelope-from rmh@io.debian.net)
Received: from rmh by io.debian.net with local (Exim 4.61)
	(envelope-from <rmh@io.debian.net>)
	id 1FZC6E-0002QD-KA
	for FreeBSD-gnats-submit@freebsd.org; Thu, 27 Apr 2006 21:24:26 +0200
Message-Id: <E1FZC6E-0002QD-KA@io.debian.net>
Date: Thu, 27 Apr 2006 21:24:26 +0200
From: Robert Millan <rmh@aybabtu.com>
Reply-To: Robert Millan <rmh@aybabtu.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: kern_linker.c hardcodes "/boot/kernel" instead of using KODIR
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         96429
>Category:       kern
>Synopsis:       [kernel] [patch] kern_linker.c hardcodes "/boot/kernel" instead of using KODIR
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 27 19:30:11 GMT 2006
>Closed-Date:    
>Last-Modified:  Thu Apr 27 21:31:54 GMT 2006
>Originator:     Robert Millan
>Release:        GNU/kFreeBSD 5.4-1-586 i586
>Organization:
>Environment:
System: GNU/kFreeBSD io.debian.net 5.4-1-586 #0 Mon Dec 5 19:45:10 CET 2005 i586 i386 AMD-K6(tm) 3D processor GNU/kFreeBSD
Architecture: i586

	
>Description:
	KODIR can be used to override the directory in which modules are installed,
	but the kernel will always look for them in /boot/kernel/ no matter what.

	I think it should look in the same dir where they were installed.
>How-To-Repeat:
	
>Fix:

diff -ur sys.old/conf/kern.pre.mk sys/conf/kern.pre.mk
--- sys.old/conf/kern.pre.mk	2006-04-27 11:12:03.000000000 +0200
+++ sys/conf/kern.pre.mk	2006-04-27 13:04:47.000000000 +0200
@@ -68,7 +68,7 @@
 INCLUDES+= -I$S/dev/twa
 
 CFLAGS=	${COPTFLAGS} ${CWARNFLAGS} ${DEBUG}
-CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
+CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -DKODIR=\"${KODIR}\" -include opt_global.h
 .if ${CC} != "icc"
 CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT}
 CFLAGS+= --param inline-unit-growth=100
diff -ur sys.old/kern/kern_linker.c sys/kern/kern_linker.c
--- sys.old/kern/kern_linker.c	2006-04-27 11:10:52.000000000 +0200
+++ sys/kern/kern_linker.c	2006-04-27 13:05:50.000000000 +0200
@@ -1383,7 +1383,7 @@
  */
 
 static char linker_hintfile[] = "linker.hints";
-static char linker_path[MAXPATHLEN] = "/boot/kernel;/boot/modules";
+static char linker_path[MAXPATHLEN] = KODIR ";/boot/modules";
 
 SYSCTL_STRING(_kern, OID_AUTO, module_path, CTLFLAG_RW, linker_path,
     sizeof(linker_path), "module load search path");


>Release-Note:
>Audit-Trail:
>Unformatted:
