#376 Preventing loss of a builtin modem

open
nobody
5
2005-05-20
2005-05-20
dunsalen
No

Laptops quite commonly have a built in modem, the
device node of which
is usually /dev/modem. The /etc/pcmcia/serial script
replaces this link
when a modem card is inserted, then removes it when the
card is
removed. A desktop user is unlikely to remember that
the link has to be
reconstructed and point to some obscure device like
/dev/tts/LT0.

This simple patch preserves an existing /dev/modem link
and restores
it on card removal, thereby preventing tears and great
agonies of a
frustrated user:

--- /etc/pcmcia-3.2.8/serial 2005-05-19
19:51:43.000000000 -0700
+++ /etc/pcmcia/serial 2005-05-20 11:49:51.000000000 -0700
@@ -42,7 +42,7 @@
cd /dev ; log ./MAKEDEV $DEVICE
fi
if [ -n "$LINK" ] ; then
- if [ -L $LINK ] ; then rm $LINK ; fi
+ mv $LINK /var/tmp/pcmcia$SOCKET
if match `uname -r` "2.[2-9].*" ; then
ln -s /dev/$DEVICE $LINK
else
@@ -85,7 +85,10 @@
telinit q
fi
do_fuser -k /dev/$DEVICE /dev/$CALLOUT $LINK >
/dev/null
- if [ -L "$LINK" ] ; then rm $LINK ; fi
+ if [ -L "$LINK" ] ; then
+ rm $LINK
+ mv /var/tmp/pcmcia$SOCKET $LINK
+ fi
stop_fn $DEVICE
;;

Discussion

  • dunsalen
    dunsalen
    2005-05-20

    Patch to /etc/pcmcia/serial to preserve the /dev/modem link

     
    Attachments