From 6b00c90d709a01822027fb9986ec8ace605dd991 Mon Sep 17 00:00:00 2001 From: "\"Steven J. Hill\"" Date: Wed, 9 May 2007 22:48:41 +0000 Subject: Rename all INIT scripts to have the numerical prefixes to easily see the start-up order. --- package/ltt/S27tracer | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ package/ltt/init-tracer | 93 ------------------------------------------------- package/ltt/ltt.mk | 2 +- 3 files changed, 94 insertions(+), 94 deletions(-) create mode 100755 package/ltt/S27tracer delete mode 100755 package/ltt/init-tracer (limited to 'package/ltt') diff --git a/package/ltt/S27tracer b/package/ltt/S27tracer new file mode 100755 index 000000000..3dee49211 --- /dev/null +++ b/package/ltt/S27tracer @@ -0,0 +1,93 @@ +#!/bin/sh +# +# Load tracer module and create tracer device node. +# + +MODULE="tracer" +MAIN_DEVICE="tracer" +USER_DEVICE="tracerU" +GROUP="root" +MODE="664" + +start() { + if [ -e /dev/${MAIN_DEVICE} -o -e /dev/${USER_DEVICE} ] + then + # tell the user about what we are doing + echo "Deleting old tracer nodes: /dev/tracer and /dev/tracerU" + + # remove stale nodes + rm -f /dev/${MAIN_DEVICE} + rm -f /dev/${USER_DEVICE} + fi + + # look for the major number + MAJOR=`/bin/grep " ${MODULE}$" /proc/devices | cut -d" " -f1` + + # does the device exist? + if [ ${MAJOR} ] + then + echo "Found tracer device with major number:" ${MAJOR} + else + echo "Loading tracer kernel module: " + # invoke modprobe + /sbin/modprobe ${MODULE} + MAJOR=`/bin/grep " ${MODULE}$" /proc/devices | cut -d" " -f1` + if [ ${MAJOR} ] + then + echo "Found tracer device with major number:" ${MAJOR} + else + echo "Did not find tracer device ... /dev entries not created ..." + exit 1 + fi + fi + + # tell the user about what we are doing + echo "Creating new tracer nodes: /dev/tracer and /dev/tracerU" + + # create the character special file + /bin/mknod /dev/${MAIN_DEVICE} c ${MAJOR} 0 + /bin/mknod /dev/${USER_DEVICE} c ${MAJOR} 1 + + # set permissions and ownership + /bin/chgrp ${GROUP} /dev/${MAIN_DEVICE} + /bin/chmod ${MODE} /dev/${MAIN_DEVICE} + /bin/chgrp ${GROUP} /dev/${USER_DEVICE} + /bin/chmod ${MODE} /dev/${USER_DEVICE} +} +stop() { + # tell the user about what we are doing + echo "Deleting tracer nodes: /dev/tracer and /dev/tracerU" + + # remove nodes + rm -f /dev/${MAIN_DEVICE} + rm -f /dev/${USER_DEVICE} + + if lsmod | /bin/grep "^${MODULE} " + then + echo -n "Removing tracer kernel module: " + # invoke modprobe -r + /sbin/modprobe -r ${MODULE} + echo "OK" + fi +} +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/package/ltt/init-tracer b/package/ltt/init-tracer deleted file mode 100755 index 3dee49211..000000000 --- a/package/ltt/init-tracer +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# -# Load tracer module and create tracer device node. -# - -MODULE="tracer" -MAIN_DEVICE="tracer" -USER_DEVICE="tracerU" -GROUP="root" -MODE="664" - -start() { - if [ -e /dev/${MAIN_DEVICE} -o -e /dev/${USER_DEVICE} ] - then - # tell the user about what we are doing - echo "Deleting old tracer nodes: /dev/tracer and /dev/tracerU" - - # remove stale nodes - rm -f /dev/${MAIN_DEVICE} - rm -f /dev/${USER_DEVICE} - fi - - # look for the major number - MAJOR=`/bin/grep " ${MODULE}$" /proc/devices | cut -d" " -f1` - - # does the device exist? - if [ ${MAJOR} ] - then - echo "Found tracer device with major number:" ${MAJOR} - else - echo "Loading tracer kernel module: " - # invoke modprobe - /sbin/modprobe ${MODULE} - MAJOR=`/bin/grep " ${MODULE}$" /proc/devices | cut -d" " -f1` - if [ ${MAJOR} ] - then - echo "Found tracer device with major number:" ${MAJOR} - else - echo "Did not find tracer device ... /dev entries not created ..." - exit 1 - fi - fi - - # tell the user about what we are doing - echo "Creating new tracer nodes: /dev/tracer and /dev/tracerU" - - # create the character special file - /bin/mknod /dev/${MAIN_DEVICE} c ${MAJOR} 0 - /bin/mknod /dev/${USER_DEVICE} c ${MAJOR} 1 - - # set permissions and ownership - /bin/chgrp ${GROUP} /dev/${MAIN_DEVICE} - /bin/chmod ${MODE} /dev/${MAIN_DEVICE} - /bin/chgrp ${GROUP} /dev/${USER_DEVICE} - /bin/chmod ${MODE} /dev/${USER_DEVICE} -} -stop() { - # tell the user about what we are doing - echo "Deleting tracer nodes: /dev/tracer and /dev/tracerU" - - # remove nodes - rm -f /dev/${MAIN_DEVICE} - rm -f /dev/${USER_DEVICE} - - if lsmod | /bin/grep "^${MODULE} " - then - echo -n "Removing tracer kernel module: " - # invoke modprobe -r - /sbin/modprobe -r ${MODULE} - echo "OK" - fi -} -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - *) - echo $"Usage: $0 {start|stop|restart}" - exit 1 -esac - -exit $? diff --git a/package/ltt/ltt.mk b/package/ltt/ltt.mk index f4a2d0962..3626c232d 100644 --- a/package/ltt/ltt.mk +++ b/package/ltt/ltt.mk @@ -98,7 +98,7 @@ $(TARGET_DIR)/usr/bin/tracedaemon: $(LTT_DIR2)/$(LTT_TARGET_BINARY) $(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) \ -C $(LTT_DIR2)/Daemon install $(STRIP) $(TARGET_DIR)/usr/bin/tracedaemon > /dev/null 2>&1 - $(INSTALL) -D -m 0755 package/ltt/init-tracer $(TARGET_DIR)/etc/init.d/S27tracer + $(INSTALL) -D -m 0755 package/ltt/S27tracer $(TARGET_DIR)/etc/init.d ltt-tracedaemon: uclibc $(TARGET_DIR)/usr/bin/tracedaemon -- cgit v1.2.3