* Serial uart detection script for udev
@ 2006-05-11 9:40 Ilkka Tuohela
2006-05-11 10:00 ` Kay Sievers
2006-05-11 12:11 ` Ilkka Tuohela
0 siblings, 2 replies; 3+ messages in thread
From: Ilkka Tuohela @ 2006-05-11 9:40 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]
Attached is a small script to find out UART for a serial device from
udev rules. I have installed the script to /lib/udev/serial_uart. It
would be nice to get this script to standard udev distribution as well.
I need this script for globetrotter gprs pcmcia-card, which has two
serial ports: one is a proprietary control port not usable from linux
which can be recognized by 16450 UART, other is the real serial device
to use with 16550A UART.
To explain this further here is my rule file for this card:
ACTION!="add", GOTO="globetrotter_end"
SYSFS{prod_id1}=="Option International", SYSFS{prod_id2}=="GSM/GPRS
GlobeTrotter", IMPORT{program}="serial_uart %p"
### Control channel device, not really used in linux
SYSFS{prod_id1}=="Option International", SYSFS{prod_id2}=="GSM/GPRS
GlobeTrotter", ENV{SERIAL_UART}=="16450", SYMLINK
+="globetrotter/control"
### Normal serial device
SYSFS{prod_id1}=="Option International", SYSFS{prod_id2}=="GSM/GPRS
GlobeTrotter", ENV{SERIAL_UART}=="16550A", SYMLINK
+="globetrotter/serial"
# Now set pincode to the serial device
SYSFS{prod_id1}=="Option International", SYSFS{prod_id2}=="GSM/GPRS
GlobeTrotter", ENV{SERIAL_UART}=="16550A",
RUN="/etc/udev/scripts/globetrotter-pincode.sh %k"
LABEL="globetrotter_end"
I think it would be actually better that UART for a serial port would be
available directly as SYSFS attribute, but this system works as well.
--
Ilkka Tuohela / Nixu Oy <Ilkka.Tuohela@nixu.com>
PGP-fingerprint: EAE2 B9CF BFE3 A6A1 09DD 3C12 C721 CF5A EB00 F285
Mobile phone: +358-40-5233174
[-- Attachment #2: serial_uart --]
[-- Type: application/x-shellscript, Size: 742 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Serial uart detection script for udev
2006-05-11 9:40 Serial uart detection script for udev Ilkka Tuohela
@ 2006-05-11 10:00 ` Kay Sievers
2006-05-11 12:11 ` Ilkka Tuohela
1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2006-05-11 10:00 UTC (permalink / raw)
To: linux-hotplug
On Thu, May 11, 2006 at 12:40:42PM +0300, Ilkka Tuohela wrote:
>
> Attached is a small script to find out UART for a serial device from
> udev rules. I have installed the script to /lib/udev/serial_uart. It
> would be nice to get this script to standard udev distribution as well.
There are no "standard" rules today in the udev tarball, only examples
copied from the distros. It's up to the distro maintainer to pick these
up if they want and it will show up with the next round of copying from
the package to the examples in the udev tree.
> I think it would be actually better that UART for a serial port would be
> available directly as SYSFS attribute, but this system works as well.
This should be exported in sysfs, yes. Reading such stuff from /proc
for new stuff, should be avoided these days. Care to give it a try to
export this in sysfs?
And your script writes to /tmp, which it shouldn't.
Thanks,
Kay
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Serial uart detection script for udev
2006-05-11 9:40 Serial uart detection script for udev Ilkka Tuohela
2006-05-11 10:00 ` Kay Sievers
@ 2006-05-11 12:11 ` Ilkka Tuohela
1 sibling, 0 replies; 3+ messages in thread
From: Ilkka Tuohela @ 2006-05-11 12:11 UTC (permalink / raw)
To: linux-hotplug
to, 2006-05-11 kello 12:00 +0200, Kay Sievers kirjoitti:
> On Thu, May 11, 2006 at 12:40:42PM +0300, Ilkka Tuohela wrote:
> >
> > Attached is a small script to find out UART for a serial device from
> > udev rules. I have installed the script to /lib/udev/serial_uart. It
> > would be nice to get this script to standard udev distribution as well.
>
> There are no "standard" rules today in the udev tarball, only examples
> copied from the distros. It's up to the distro maintainer to pick these
> up if they want and it will show up with the next round of copying from
> the package to the examples in the udev tree.
OK, I'll suggest this for at least ubuntu which I'm using, while sysfs
does not have the attribute.
> > I think it would be actually better that UART for a serial port would be
> > available directly as SYSFS attribute, but this system works as well.
>
> This should be exported in sysfs, yes. Reading such stuff from /proc
> for new stuff, should be avoided these days. Care to give it a try to
> export this in sysfs?
No problem, I'll do it.
> And your script writes to /tmp, which it shouldn't.
Oh, that was just a leftover debugging message which I forgot there ;)
It should be removed.
--
Ilkka Tuohela / Nixu Oy <Ilkka.Tuohela@nixu.com>
PGP-fingerprint: EAE2 B9CF BFE3 A6A1 09DD 3C12 C721 CF5A EB00 F285
Mobile phone: +358-40-5233174
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-05-11 12:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-11 9:40 Serial uart detection script for udev Ilkka Tuohela
2006-05-11 10:00 ` Kay Sievers
2006-05-11 12:11 ` Ilkka Tuohela
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).