From owner-freebsd-hackers Fri Aug 11 15:39:10 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id PAA16393 for hackers-outgoing; Fri, 11 Aug 1995 15:39:10 -0700 Received: from tserv.lodgenet.com (dial1.iw.net [204.157.148.50]) by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id PAA16296 for ; Fri, 11 Aug 1995 15:37:30 -0700 Received: from jake.lodgenet.com (jake.lodgenet.com [204.124.120.30]) by tserv.lodgenet.com (8.6.12/8.6.12) with ESMTP id RAA27307 for ; Fri, 11 Aug 1995 17:37:17 -0500 Received: from localhost (localhost [127.0.0.1]) by jake.lodgenet.com (8.6.11/8.6.9) with SMTP id RAA13872 for ; Fri, 11 Aug 1995 17:36:08 -0500 Message-Id: <199508112236.RAA13872@jake.lodgenet.com> X-Authentication-Warning: jake.lodgenet.com: Host localhost didn't use HELO protocol X-Mailer: exmh version 1.6 4/21/95 To: hackers@freebsd.org Subject: reloading lkm's Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 11 Aug 1995 17:36:06 -0500 From: "Eric L. Hernes" Sender: hackers-owner@freebsd.org Precedence: bulk Here's a small patch which I mentioned in the device driver writer's guide. It adds a `reload' target to bsd.kmod.mk This lets me sit in emacs and bounce on `compile' and have `make reload' be the target and it will always do the right thing. *** /usr/share/mk/bsd.kmod.mk Sat Jun 10 04:58:25 1995 --- bsd.kmod.mk Wed Jun 28 15:28:55 1995 *************** *** 1,5 **** # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 ! # bsd.kmod.mk,v 1.11 1995/03/20 19:18:51 wollman Exp .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" --- 1,5 ---- # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 ! # $Id: bsd.kmod.mk,v 1.11 1995/03/20 19:18:51 wollman Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" *************** *** 149,154 **** --- 149,160 ---- .if !target(unload) unload: ${PROG} /sbin/modunload -n ${KMOD} + .endif + + .if !target(reload) + reload: ${PROG} + -/usr/bin/modstat -n ${KMOD} && /sbin/modunload -n ${KMOD} + /sbin/modload -o ${KMOD} -e${KMOD} ${PROG} .endif KERN= ${.CURDIR}/../../sys/kern eric. -- erich@lodgenet.com erich@rrnet.com