Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Aug 1995 17:36:06 -0500
From:      "Eric L. Hernes" <erich@lodgenet.com>
To:        hackers@freebsd.org
Subject:   reloading lkm's
Message-ID:  <199508112236.RAA13872@jake.lodgenet.com>

next in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508112236.RAA13872>