⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rc.serial

📁 8250/16550串口芯片在Linux下的驱动(Ver5.5)
💻 SERIAL
字号:
## /etc/rc.serial #	Initializes the serial ports on your system## chkconfig: 2345 50 75# description: This initializes the settings of the serial port## FILE_VERSION: 20000519## Distributed with setserial and the serial driver.  We need to use the# FILE_VERSION field to assure that we don't overwrite a newer rc.serial # file with a newer one.# # XXXX For now, the autosave feature doesn't work if you are# using the multiport feature; it doesn't save the multiport configuration# (for now).  Autosave also doesn't work for the hayes devices.  # Will fix later...##RCLOCKFILE=/var/lock/subsys/serialDIRS="/lib/modules/`uname -r`/misc /lib/modules /usr/lib/modules ."PATH=/bin:/sbin:/usr/binDRIVER=serialDRIVER_NAME=serialMODULE_REGEXP="serial\b"if test -d /dev/tts ; then	ALLDEVS="/dev/tts/?"	if /bin/ls /dev/tts/?? >& /dev/null ; then		ALLDEVS="$ALLDEVS /dev/tts/??"	fielse	ALLDEVS="/dev/ttyS?"	if /bin/ls /dev/ttyS?? >& /dev/null ; then		ALLDEVS="$ALLDEVS /dev/ttyS??"	fifiSETSERIAL=""if test -x /bin/setserial ; then	SETSERIAL=/bin/setserialelif test -x /sbin/setserial ; then	SETSERIAL=/sbin/setserialfi## See if the serial driver is loaded#LOADED=""if test -f /proc/devices; then	if grep -q " ttyS$" /proc/devices || grep -q " tts/" /proc/devices; then		LOADED="yes"	else		LOADED="no"	fifi## Find the serial driver#for i in $DIRSdo	if test -z "$MODULE" -a -f $i/$DRIVER.o ; then		MODULE=$i/$DRIVER.o	fidoneif ! test -f /proc/modules ; then	MODULE=""fi## Handle System V init conventions...#case $1 instart)	action="start";	;;stop)	action="stop";	;;restart|reload)	$0 stop	$0 start	exit $?	;;status)	module=`grep $MODULE_REGEXP /proc/modules | awk '{print $1}'`	if test -n "$module" ; then 	    echo "The $DRIVER driver is loaded."	    exit 0	fi	if test "$LOADED" = "yes" ; then	    echo "The $DRIVER driver is compiled into the kernel"	    exit 0        fi	echo "The $DRIVER driver is not loaded."	exit 1	;;*)	action="start";esacif test $action  = stop ; then	if test -n ${SETSERIAL} -a "$LOADED" != "no" -a \           `head -1 /etc/serial.conf`X = "###AUTOSAVE###X" ; then		echo -n "Saving state of serial devices... "		grep "^#" /etc/serial.conf > /etc/.serial.conf.new		${SETSERIAL} -G -g ${ALLDEVS} >> /etc/.serial.conf.new		mv /etc/serial.conf /etc/.serial.conf.old		mv /etc/.serial.conf.new /etc/serial.conf		echo "done."	fi	if test -n $MODULE ; then		module=`grep $MODULE_REGEXP /proc/modules | awk '{print $1}'`		if test -z "$module" ; then 			echo "The $DRIVER_NAME driver is not loaded."			rm -f ${RCLOCKFILE}			exit 0		fi		if rmmod $module ; then :; else 			echo "The $DRIVER_NAME driver could NOT be unloaded."			exit 1;		fi		echo "The $DRIVER_NAME driver has been unloaded."	fi	rm -f ${RCLOCKFILE}	exit 0fi## If not stop, it must be a start....#if test -n $MODULE -a "$LOADED" != "yes" ; then 	if insmod -fm $MODULE $DRIVER_ARG \		> /tmp/$DRIVER.map 2> /tmp/$DRIVER.$$; then :; 	else		echo "Couldn't load $DRIVER_NAME driver."		echo "See error logs in /tmp/$DRIVER.$$"		exit 1	fi	/bin/rm -f /tmp/$DRIVER.$$fiif test -f /etc/serial.conf ; then        if test -n ${SETSERIAL} ; then		grep -v ^# < /etc/serial.conf | while read device args		do		    ${SETSERIAL} -z $device $args		done 	fielse	echo "###AUTOSAVE###" > /etc/serial.conffitouch ${RCLOCKFILE}${SETSERIAL} -bg ${ALLDEVS}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -