[dahdi-commits] tzafrir: linux/trunk r8033 - /linux/trunk/build_tools/make_static_devs

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Mon Feb 15 02:32:21 CST 2010


Author: tzafrir
Date: Mon Feb 15 02:32:15 2010
New Revision: 8033

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8033
Log:
make_static_devs: a script to generate the static device files.

Added:
    linux/trunk/build_tools/make_static_devs   (with props)

Added: linux/trunk/build_tools/make_static_devs
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/build_tools/make_static_devs?view=auto&rev=8033
==============================================================================
--- linux/trunk/build_tools/make_static_devs (added)
+++ linux/trunk/build_tools/make_static_devs Mon Feb 15 02:32:15 2010
@@ -1,0 +1,67 @@
+#!/bin/sh
+
+set -e
+
+# make_static_devs: create static device files for DAHDI
+
+# Copyright (C) 2010 by Xorcom <support at xorcom.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# In most cases DAHDI device files are generated by udev,
+# but there would be cases where you'd want to just have static device
+# files. Note that if you do use udev, that static device files will be
+# essentially deleted.
+
+BASE_DIR="/dev/dahdi"
+
+usage() {
+	me=`basename $0`
+	echo "$me: Generate static DAHDI device files"
+	echo ""
+	echo "Usage:"
+	echo "  $me [-h] [-d base_dir]"
+	echo "    -d base_dir: create under base_dir (default: $BASE_DIR)"
+	echo "    -h: this help message."
+}
+
+
+mknod_safe() {
+	if [ -c $1 ]; then return; fi
+	mknod "$@"
+}
+
+while getopts 'd:h' opt; do
+	case "$opt" in
+	h) usage; exit 0;;
+	d) BASE_DIR="$OPTARG";;
+	\?) usage; exit 1;;
+	esac
+done
+
+mkdir -p "$BASE_DIR"
+mknod_safe "${BASE_DIR}/ctl" c 196 0
+mknod_safe "${BASE_DIR}/transcode" c 196 250
+mknod_safe "${BASE_DIR}/timer" c 196 253
+mknod_safe "${BASE_DIR}/channel" c 196 254
+mknod_safe "${BASE_DIR}/pseudo" c 196 255
+
+# The following are not used by Asterisk itself nowadays. Some DAHDI
+# users still find it simpler to open them directly rather than using
+# /dev/dahdi/channel and the DAHDI_SPECIFY ioctl .
+for i in `seq 249`; do
+	mknod_safe ${BASE_DIR}/$i c 196 $i
+done
+

Propchange: linux/trunk/build_tools/make_static_devs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: linux/trunk/build_tools/make_static_devs
------------------------------------------------------------------------------
    svn:executable = *

Propchange: linux/trunk/build_tools/make_static_devs
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: linux/trunk/build_tools/make_static_devs
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the dahdi-commits mailing list