From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Aug 13 06:10:17 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 68B7A16A4DE for ; Sun, 13 Aug 2006 06:10:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6E4243D46 for ; Sun, 13 Aug 2006 06:10:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k7D6AGhF004356 for ; Sun, 13 Aug 2006 06:10:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k7D6AGb5004355; Sun, 13 Aug 2006 06:10:16 GMT (envelope-from gnats) Resent-Date: Sun, 13 Aug 2006 06:10:16 GMT Resent-Message-Id: <200608130610.k7D6AGb5004355@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Anish Mistry" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C25E716A4DA; Sun, 13 Aug 2006 06:06:10 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from smtp2.fuse.net (mail-out2.fuse.net [216.68.8.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4366043D46; Sun, 13 Aug 2006 06:06:09 +0000 (GMT) (envelope-from amistry@am-productions.biz) Received: from gx6.fuse.net ([69.61.164.22]) by smtp2.fuse.net (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20060813060605.ZJIH2008.smtp2.fuse.net@gx6.fuse.net>; Sun, 13 Aug 2006 02:06:05 -0400 Received: from bigguy.am-productions.biz ([69.61.164.22]) by gx6.fuse.net (InterMail vG.1.02.00.02 201-2136-104-102-20041210) with ESMTP id <20060813060604.RDPA24896.gx6.fuse.net@bigguy.am-productions.biz>; Sun, 13 Aug 2006 02:06:04 -0400 Message-Id: <1155449218.68183@bigguy.am-productions.biz> Date: Sun, 13 Aug 2006 02:06:58 -0400 From: "Anish Mistry" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.7 Cc: sobomax@FreeBSD.org Subject: ports/101958: RCify misc/zaptel and cleanup X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 06:10:17 -0000 >Number: 101958 >Category: ports >Synopsis: RCify misc/zaptel and cleanup >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sun Aug 13 06:10:11 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Anish Mistry >Release: FreeBSD 6.1-RELEASE-p1 i386 >Organization: AM Productions >Environment: System: FreeBSD 6.1-RELEASE-p1 #0: Thu Jun 1 21:16:20 EDT 2006 amistry@bigguy.am-productions.biz:/usr/obj/usr/src/sys/BIGGUY >Description: RCify the startup so we can allow other scripts to depend on zaptel loading first. Make use of SUB_FILES for pkg-message. Also included is patch to fix the panic: sleeping without a mutex problem on CURRENT. This should probably should have been submitted separately. >How-To-Repeat: >Fix: --- zaptel-rcify.patch begins here --- diff -ruN zaptel.orig/Makefile zaptel/Makefile --- zaptel.orig/Makefile Sun Aug 13 00:29:52 2006 +++ zaptel/Makefile Sun Aug 13 01:34:42 2006 @@ -20,13 +20,14 @@ ONLY_FOR_ARCHS= i386 -PKGMESSAGE= ${WRKSRC}/.MESSAGE MAKE_ENV= KMODDIR=${PREFIX}/lib/zaptel +SUB_FILES= pkg-message +USE_RC_SUBR= zaptel .include .if ${OSVERSION} < 500000 -IGNORE= "does not build on FreeBSD \< 5.x" +IGNORE= does not build on FreeBSD \< 5.x .endif pre-everything:: @@ -42,15 +43,10 @@ ${WRKSRC}/ztcfg/ztcfg.c pre-su-install: - @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${PKGDIR}/pkg-message > \ - ${PKGMESSAGE} - @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${FILESDIR}/zaptel.sh > \ - ${WRKDIR}/zaptel.sh.sample @${MKDIR} ${PREFIX}/lib/zaptel post-install: @${TOUCH} ${PREFIX}/lib/zaptel/linker.hints - @${INSTALL_SCRIPT} ${WRKDIR}/zaptel.sh.sample ${PREFIX}/etc/rc.d @${CAT} ${PKGMESSAGE} .include diff -ruN zaptel.orig/files/patch-zaptel_zaptel.c zaptel/files/patch-zaptel_zaptel.c --- zaptel.orig/files/patch-zaptel_zaptel.c Wed Dec 31 19:00:00 1969 +++ zaptel/files/patch-zaptel_zaptel.c Fri Aug 11 11:57:02 2006 @@ -0,0 +1,11 @@ +--- zaptel/zaptel.c.orig Sun Jun 25 14:21:49 2006 ++++ zaptel/zaptel.c Fri Aug 11 11:56:20 2006 +@@ -397,7 +397,7 @@ + + int schluffen(void *q) + { +- int rc = tsleep(q, PZERO | PCATCH, "schluffen", 0); ++ int rc = tsleep(q, PZERO | PCATCH, "schluffen", 10); + switch(rc) + { + case EINTR: diff -ruN zaptel.orig/files/pkg-message.in zaptel/files/pkg-message.in --- zaptel.orig/files/pkg-message.in Wed Dec 31 19:00:00 1969 +++ zaptel/files/pkg-message.in Sun Aug 13 01:09:17 2006 @@ -0,0 +1,27 @@ +------------------------------------------------------------------------------- +IMPORTANT! MAKE SURE TO READ THE FOLLOWING! + +To use the driver set zaptel_enable="YES" in your rc.conf. + +To load the driver run (as root): + +# %%PREFIX%%/etc/rc.d/zaptel start + +To unload it: + +# %%PREFIX%%/etc/rc.d/zaptel stop + +It'll also load the driver automatically when the system is started. + +Report problems to Alexander Timoshenko . Please note that +it is still "work in progress" so that your bug reports are welcome and will +help to improve quality of the drivers. + +Great thanks to all companies and individuals who made this driver happen, +including but not limited to, John Todd, Chris Coleman, Alexander Timoshenko, +PBXpress, Inc, Max Khon, LF.net, Luigi Rizzo and others contributors. + +Thanks and enjoy! + +-Maxim +------------------------------------------------------------------------------- diff -ruN zaptel.orig/files/zaptel.in zaptel/files/zaptel.in --- zaptel.orig/files/zaptel.in Wed Dec 31 19:00:00 1969 +++ zaptel/files/zaptel.in Sun Aug 13 01:49:33 2006 @@ -0,0 +1,51 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: zaptel +# REQUIRE: NETWORKING +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# zaptel_enable (bool): Set to NO by default. +# Set it to YES to enable zaptel. +# + +. %%RC_SUBR%% + +kmod_dir=%%PREFIX%%/lib/zaptel + +kmod_load="qozap.ko wcfxs.ko wcfxo.ko wct1xxp.ko wct4xxp.ko wcte11xp.ko" +name="zaptel" +rcvar=${name}_enable + +start_cmd="zaptel_start" +stop_cmd="zaptel_stop" + +zaptel_start() +{ + echo "Starting ${name}." + kldload ${kmod_dir}/${name}.ko + for kmod in ${kmod_load} + do + kldload ${kmod_dir}/${kmod} + done +} + +zaptel_stop() +{ + echo "Stopping ${name}." + for kmod in ${kmod_load} + do + kldunload ${kmod} + done + kldunload ${name}.ko +} +load_rc_config $name + +: ${zaptel_enable="NO"} + +run_rc_command "$1" + diff -ruN zaptel.orig/files/zaptel.sh zaptel/files/zaptel.sh --- zaptel.orig/files/zaptel.sh Sun Aug 13 00:29:46 2006 +++ zaptel/files/zaptel.sh Wed Dec 31 19:00:00 1969 @@ -1,36 +0,0 @@ -#!/bin/sh - -PREFIX=%%PREFIX%% -LIBDIR=${PREFIX}/lib/zaptel - -case "$1" in - start) - /sbin/kldload ${LIBDIR}/zaptel.ko || exit 1 - /sbin/kldload ${LIBDIR}/qozap.ko || exit 1 - /sbin/kldload ${LIBDIR}/wcfxo.ko || exit 1 - /sbin/kldload ${LIBDIR}/wcfxs.ko || exit 1 - /sbin/kldload ${LIBDIR}/wct1xxp.ko || exit 1 - /sbin/kldload ${LIBDIR}/wct4xxp.ko || exit 1 - /sbin/kldload ${LIBDIR}/wcte11xp.ko || exit 1 - ${PREFIX}/bin/ztcfg - echo -n " zaptel" - ;; - - stop) - /sbin/kldunload qozap.ko || exit 1 - /sbin/kldunload wcfxs.ko || exit 1 - /sbin/kldunload wcfxo.ko || exit 1 - /sbin/kldunload wct1xxp.ko || exit 1 - /sbin/kldunload wct4xxp.ko || exit 1 - /sbin/kldunload wcte11xp.ko || exit 1 - /sbin/kldunload zaptel.ko || exit 1 - echo -n " zaptel" - ;; - - *) - echo "" - echo "Usage: `basename $0` { start | stop }" - echo "" - exit 64 - ;; -esac diff -ruN zaptel.orig/pkg-message zaptel/pkg-message --- zaptel.orig/pkg-message Sun Aug 13 00:29:52 2006 +++ zaptel/pkg-message Wed Dec 31 19:00:00 1969 @@ -1,28 +0,0 @@ -------------------------------------------------------------------------------- -IMPORTANT! MAKE SURE TO READ THE FOLLOWING! - -To use the driver, make a copy of %%PREFIX%%/etc/rc.d/zaptel.sh.sample -under %%PREFIX%%/etc/rc.d/zaptel.sh. - -To load the driver run (as root): - -# %%PREFIX%%/etc/rc.d/zaptel.sh start - -To unload it: - -# %%PREFIX%%/etc/rc.d/zaptel.sh stop - -It'll also load the driver automatically when the system is started. - -Report problems to Alexander Timoshenko . Please note that -it is still "work in progress" so that your bug reports are welcome and will -help to improve quality of the drivers. - -Great thanks to all companies and individuals who made this driver happen, -including but not limited to, John Todd, Chris Coleman, Alexander Timoshenko, -PBXpress, Inc, Max Khon, LF.net, Luigi Rizzo and others contributors. - -Thanks and enjoy! - --Maxim -------------------------------------------------------------------------------- diff -ruN zaptel.orig/pkg-plist zaptel/pkg-plist --- zaptel.orig/pkg-plist Sun Aug 13 00:29:52 2006 +++ zaptel/pkg-plist Sun Aug 13 00:52:56 2006 @@ -3,7 +3,6 @@ bin/ztmonitor bin/zttest bin/zttool -etc/rc.d/zaptel.sh.sample include/tonezone.h include/zaptel.h lib/libtonezone.a --- zaptel-rcify.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: