Why are the serial port numbers changing?
Baruch Siach
baruch at tkos.co.il
Fri Jul 9 07:23:56 IDT 2010
Hi Dotan,
On Thu, Jul 08, 2010 at 10:30:16PM +0300, Dotan Cohen wrote:
> On 8 July 2010 20:45, Hetz Ben Hamo <hetzbh at gmail.com> wrote:
> > IIRC correctly, it's due to the new features in Ubuntu (and Fedora): Each
> > time you boot the machine, it re-maps everything, although most of the maps
> > remains the same.
> >
> > You can, after the machine has finished booting, scan the tty for the new
> > serial ports and use them whatever you like, since the /dev tree is being
> > re-created every boot.
> > Hetz
>
> Thanks. I have some scripts that depend on the device being found at a
> particular tty. How can I disable scanning so that I won't have to
> change the scripts? Or, how can I tell what device is on which tty in
> my scripts?
The right solution IMO is to use udev rules that instruct udev to create those
tty devices at a persistent location. To get the full information you need to
write these rules do something like the following for each tty device:
# udevadm info -a -p $(udevadm info -q path -n /dev/ttyXXX)
Then, use the info you get to write the rules according to
http://reactivated.net/writing_udev_rules.html. (Note that udevinfo that's
mention in this document is now 'udevadm info'). Put the udev rules in a file
(say, '70-persistent-tty.rules') under /etc/udev/rules.d/, and you're done.
baruch
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
More information about the Linux-il
mailing list