From matusita@jp.FreeBSD.org  Tue Sep 19 19:36:06 2000
Return-Path: <matusita@jp.FreeBSD.org>
Received: from updraft.jp.freebsd.org (updraft.jp.FreeBSD.ORG [210.157.158.42])
	by hub.freebsd.org (Postfix) with ESMTP id C48A837B43F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 19 Sep 2000 19:36:00 -0700 (PDT)
Received: from castle2.jp.FreeBSD.org (castle2.jp.FreeBSD.org [210.226.20.120])
	by updraft.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id LAA89030
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Sep 2000 11:35:59 +0900 (JST)
	(envelope-from matusita@jp.FreeBSD.org)
Received: from localhost (localhost [127.0.0.1])
	by castle2.jp.FreeBSD.org (8.11.0+3.3W/8.11.0) with ESMTP/inet id e8K2ZwX25618
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Sep 2000 11:35:58 +0900 (JST)
	(envelope-from matusita@jp.FreeBSD.org)
Message-Id: <20000920113440T.matusita@jp.FreeBSD.org>
Date: Wed, 20 Sep 2000 11:34:40 +0900
From: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: PATCH: Default module patch mismatch between kernel and loader(8)
X-Send-Pr-Version: 3.2

>Number:         21405
>Category:       kern
>Synopsis:       Default module patch mismatch between kernel and loader(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 19 19:40:01 PDT 2000
>Closed-Date:    Sun Aug 19 18:12:44 PDT 2001
>Last-Modified:  Sun Aug 19 18:12:53 PDT 2001
>Originator:     Makoto MATSUSHITA
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Japan FreeBSD Users' Group
>Environment:

	5.0-CURRENT as of Sep/19/2000

>Description:

	Default module path of loader(8) is changed a few days before,
	however, module path of kernel (shown as 'kern.module_path' MIB)
	is not changed yet.

	This should cause a problem, if a user upgrades their old
	-current box to the latest, and forget to remove /modules
	directory.

	Typical example is 'mfs' module. If a kernel does not have MFS
	feature, kernel try to load a mfs.ko module (this is easily
	happen if your /etc/fstab has 'mfs' entry). However, if
	/modules/mfs.ko exists, it is used instead of /boot/kernel/mfs.ko.

>How-To-Repeat:

	(Left old /modules/*.ko, then)
	kldload your_favorite_module_name

>Fix:
	
Change default module_path, to sync with src/sys/boot/loader.conf.

Index: kern_linker.c
===================================================================
RCS file: /usr/site/FreeBSD/ncvs/src/sys/kern/kern_linker.c,v
retrieving revision 1.51
diff -c -r1.51 kern_linker.c
*** kern_linker.c	2000/09/06 06:22:20	1.51
--- kern_linker.c	2000/09/20 02:24:29
***************
*** 1168,1174 ****
   * character as a separator to be consistent with the bootloader.
   */
  
! static char linker_path[MAXPATHLEN] = "/boot/modules/;/modules/;/boot/kernel/";
  
  SYSCTL_STRING(_kern, OID_AUTO, module_path, CTLFLAG_RW, linker_path,
  	      sizeof(linker_path), "module load search path");
--- 1168,1174 ----
   * character as a separator to be consistent with the bootloader.
   */
  
! static char linker_path[MAXPATHLEN] = "/boot/kernel/;/boot/modules/;/modules/;";
  
  SYSCTL_STRING(_kern, OID_AUTO, module_path, CTLFLAG_RW, linker_path,
  	      sizeof(linker_path), "module load search path");

>Release-Note:
>Audit-Trail:

From: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/21405: PATCH: Default module patch mismatch between
 kernel and loader(8)
Date: Wed, 27 Sep 2000 13:23:38 +0900

 Here is a status of this PR.
 
 * Just submitted, no one checked.
 
 * There are yet another way of thinking. If you want to install a *new*
   version of kernel module which is also available by FreeBSD itself,
   /boot/modules should be listed *before* of /boot/kernel. So, maybe
   current kernel implementation is not wrong, and loader.conf needs
   modification.
 
 Anyway, is there anybody to analyse this PR ?
 
 -- -
 Makoto `MAR' MATSUSHITA
 
Responsible-Changed-From-To: freebsd-bugs->dd 
Responsible-Changed-By: dd 
Responsible-Changed-When: Sun Jul 22 08:48:09 PDT 2001 
Responsible-Changed-Why:  
I'll take a look at this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21405 
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Sun Aug 19 18:12:44 PDT 2001 
State-Changed-Why:  
Patch applied, thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21405 
>Unformatted:
