Scot W. Hetzel
2009-02-12 10:40:21 UTC
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: freebsd-ports-bugs
State: open
Class: sw-bug
Submitter-Id: current-users
Arrival-Date: Thu Feb 12 10:40:01 UTC 2009
Originator: Scot W. Hetzel
Release: FreeBSD 8.0-CURRENT
FreeBSD hp010 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Mon Feb 9 00:17:11 CST 2009Category: ports
Synopsis: [patch] emulators/kqemu-kmod-devel: unit2minor doesn't exist on recent 8.0-CURRENT
Confidential: no
Severity: non-critical
Priority: low
Responsible: freebsd-ports-bugs
State: open
Class: sw-bug
Submitter-Id: current-users
Arrival-Date: Thu Feb 12 10:40:01 UTC 2009
Originator: Scot W. Hetzel
Release: FreeBSD 8.0-CURRENT
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.
install either emulators/kqemu-kmod or emulators/kqemu-kmod-devel
then try to load kqemu.ko on a recent 8.0-CURRENT.
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);