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

📄 serial

📁 pcmcia source code
💻
字号:
#!/bin/sh## serial 1.42 2002/06/25 06:15:10 (David Hinds)## Initialize or shutdown a PCMCIA serial device## The first argument should be either 'start' or 'stop'.  The second# argument is the base name for the device.## The script passes an extended device address to 'serial.opts' in the # ADDRESS variable, to retrieve device-specific configuration options.# The address format is "scheme,socket,instance" where "scheme" is the# PCMCIA configuration scheme, "socket" is the socket number, and# "instance" is used to number multiple ports on a single card.  #if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi# Get device attributesget_info $DEVICE# Load site-specific settingsADDRESS="$SCHEME,$SOCKET,$INSTANCE"start_fn () { return; }stop_fn () { return; }. $0.opts# Newer kernels deprecate use of "cua" devices, but we need to# keep track of them anyway, if the device files are presentNR=`expr $MINOR - 64`if [ -c /dev/cua1 ] ; then    CALLOUT=cua$NRelse    CALLOUT=$DEVICEficase "$ACTION" in'start')    [ -n "$VERBOSE" -a -n "$INFO" ] && echo "$INFO"    if [ ! -c /dev/$DEVICE ] ; then	cd /dev ; log ./MAKEDEV $DEVICE    fi    if [ -n "$LINK" ] ; then	if [ -L $LINK ] ; then rm $LINK ; fi	if match `uname -r` "2.[2345].*" ; then	    ln -s /dev/$DEVICE $LINK	else	    ln -s /dev/$CALLOUT $LINK	fi    fi    if [ -x /bin/setserial ] ; then	# Workaround for serial driver bug	IRQ=`setserial /dev/$DEVICE | sed -e 's/.*IRQ: //'`	setserial /dev/$DEVICE irq 0 ; setserial /dev/$DEVICE irq $IRQ	if [ -n "$SERIAL_OPTS" ] ; then	    log setserial /dev/$DEVICE $SERIAL_OPTS	fi    fi    if [ -n "$INITTAB" ] ; then	echo "S$NR:12345:respawn:$INITTAB $DEVICE" >> /etc/inittab	telinit q    fi    start_fn $DEVICE    ;;'check')    is_true $NO_CHECK && exit 0    if [ -n "$INITTAB" ] ; then	do_fuser -v /dev/$DEVICE /dev/$CALLOUT $LINK | grep -v getty \	    | grep -q /dev/$DEVICE && exit 1    else	do_fuser -s /dev/$DEVICE /dev/$CALLOUT $LINK && exit 1    fi    ;;'cksum')    chk_simple "$NEW_SCHEME,$SOCKET,$INSTANCE" || exit 1    ;;    'stop')    if [ -n "$INITTAB" ] ; then	grep -v $DEVICE /etc/inittab > /etc/inittab.new	mv /etc/inittab.new /etc/inittab	telinit q    fi    do_fuser -k /dev/$DEVICE /dev/$CALLOUT $LINK > /dev/null    if [ -L "$LINK" ] ; then rm $LINK ; fi    stop_fn $DEVICE    ;;'suspend')    do_fuser -k -STOP /dev/$DEVICE /dev/$CALLOUT > /dev/null    ;;'resume')    if [ -n "$SERIAL_OPTS" ] ; then	setserial /dev/$DEVICE $SERIAL_OPTS    fi    do_fuser -k -CONT /dev/$DEVICE /dev/$CALLOUT $LINK > /dev/null    ;;*)    usage    ;;esacexit 0

⌨️ 快捷键说明

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