From nobody@FreeBSD.org  Thu Feb 12 10:34:11 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8AE24106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Feb 2009 10:34:11 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 783858FC1E
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Feb 2009 10:34:11 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CAYBFX048446
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Feb 2009 10:34:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n1CAYB6P048445;
	Thu, 12 Feb 2009 10:34:11 GMT
	(envelope-from nobody)
Message-Id: <200902121034.n1CAYB6P048445@www.freebsd.org>
Date: Thu, 12 Feb 2009 10:34:11 GMT
From: "Scot W. Hetzel" <swhetzel@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] emulators/kqemu-kmod-devel: unit2minor doesn't exist on recent 8.0-CURRENT
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         131603
>Category:       ports
>Synopsis:       [patch] emulators/kqemu-kmod-devel: unit2minor doesn't exist on recent 8.0-CURRENT
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    nox
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 12 10:40:01 UTC 2009
>Closed-Date:    Thu Feb 12 17:47:04 UTC 2009
>Last-Modified:  Thu Feb 12 17:50:01 UTC 2009
>Originator:     Scot W. Hetzel
>Release:        FreeBSD 8.0-CURRENT
>Organization:
>Environment:
FreeBSD hp010 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Mon Feb  9 00:17:11 CST 2009
root@hp010:/usr/obj/usr/src/sys/DV8135NR  amd64
>Description:
When trying to load the kqemu.ko kernel module, it fails with:

kldload: can't load kqemu.ko: Exec format error

/var/log/messages shows:

Feb 12 03:27:58 hp010 kernel: link_elf_obj: symbol unit2minor undefined
Feb 12 03:27:58 hp010 kernel: kldload: /boot/modules/kqemu.ko: Unsupported file type
Feb 12 03:27:58 hp010 root: ./kqemu: WARNING: kqemu module failed to load.

CURRENT > 800062 no longer has unit2minor.
>How-To-Repeat:
install either emulators/kqemu-kmod or emulators/kqemu-kmod-devel
then try to load kqemu.ko on a recent 8.0-CURRENT.
>Fix:
Apply the attached patch to emulators/kqemu-kmod-devel

Note: emulators/kqemu-kmod also needs the same patch:

cd /usr/ports/emulators/kqemu-kmod
cp ../kqemu-kmod-devel/files/patch-unit2minorfix files

Then update the PORTREVISON in emulators/kqemu-kmod/Makefile.

Patch attached with submission follows:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/emulators/kqemu-kmod-devel/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- Makefile	22 Jun 2008 22:06:15 -0000	1.30
+++ Makefile	12 Feb 2009 09:59:54 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	kqemu
 PORTVERSION=	1.4.0.p1
+PORTREVISION=	1
 CATEGORIES=	emulators kld
 MASTER_SITES=	http://bellard.org/qemu/ \
 		http://qemu.org/ \
Index: files/patch-unit2minorfix
===================================================================
RCS file: files/patch-unit2minorfix
diff -N files/patch-unit2minorfix
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-unit2minorfix	12 Feb 2009 09:58:56 -0000
@@ -0,0 +1,16 @@
+--- kqemu-freebsd.c.orig	2009-02-12 03:45:30.607773000 -0600
++++ kqemu-freebsd.c	2009-02-12 03:50:10.019986534 -0600
+@@ -381,7 +381,12 @@
+ 
+     r = clone_create(&kqemuclones, &kqemu_cdevsw, &unit, dev, 0);
+     if (r) {
+-	*dev = make_dev(&kqemu_cdevsw, unit2minor(unit),
++	*dev = make_dev(&kqemu_cdevsw,
++#if __FreeBSD_version < 800062
++	    unit2minor(unit),
++#else /* __FreeBSD_version >= 800062 */
++	    unit,
++#endif /* __FreeBSD_version < 800062 */
+ 	    UID_ROOT, GID_WHEEL, 0660, "kqemu%d", unit);
+ 	if (*dev != NULL) {
+ 	    dev_ref(*dev);


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->nox 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Feb 12 10:40:13 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=131603 
State-Changed-From-To: open->closed 
State-Changed-By: nox 
State-Changed-When: Thu Feb 12 17:47:03 UTC 2009 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=131603 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/131603: commit references a PR
Date: Thu, 12 Feb 2009 17:46:45 +0000 (UTC)

 nox         2009-02-12 17:46:29 UTC
 
   FreeBSD ports repository
 
   Modified files:
     emulators/kqemu-kmod Makefile 
     emulators/kqemu-kmod-devel Makefile 
   Added files:
     emulators/kqemu-kmod/files patch-unit2minorfix 
     emulators/kqemu-kmod-devel/files patch-unit2minorfix 
   Log:
   - Fix kqemu on recent -current which no longer has/uses unit2minor()
   - Bump PORTREVISION
   
   PR:             ports/131603
   Submitted by:   "Scot W. Hetzel" <swhetzel@gmail.com>
   
   Revision  Changes    Path
   1.31      +1 -0      ports/emulators/kqemu-kmod-devel/Makefile
   1.1       +16 -0     ports/emulators/kqemu-kmod-devel/files/patch-unit2minorfix (new)
   1.30      +1 -1      ports/emulators/kqemu-kmod/Makefile
   1.1       +16 -0     ports/emulators/kqemu-kmod/files/patch-unit2minorfix (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
