From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Zeuthen Date: Sat, 30 Jan 2010 19:58:30 +0000 Subject: Re: Multi-serial USB Device Message-Id: <1264881510.6213.10.camel@localhost.localdomain> List-Id: References: <7a09e2151001301005m29daf8c8ndad88969d63918a4@mail.gmail.com> In-Reply-To: <7a09e2151001301005m29daf8c8ndad88969d63918a4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sat, 2010-01-30 at 13:59 -0500, Paul Dugas wrote: > On Sat, Jan 30, 2010 at 1:27 PM, David Zeuthen wrote: > > You should be able to use IMPORT and $tempnode > > And it seems the idea of getting IDs from the devices themselves is > not off-the-wall at all. Sweet. I completely missed the $tempnode > entry in the man page. > > Is there a reason I should use IMPORT{program} instead of PROGRAM like so... > > KERNEL="ttyUSB*", SYSFS{serial}="111", \ > PROGRAM="logger_port $N", \ > SYMLINK+="ttyLogger1USB%c" > > I ask mainly because I'm not entirely sure what "environment key format" is. I'm not sure that the output of PROGRAM is parsed the same way it is for IMPORT - in fact, I think it's just ignored for PROGRAM - Kay? Anyway, the general idea is something like this SUBSYSTEM="tty", SUBSYSTEMS="usb", IMPORT{program}="logger_import $tempnode", SYMLINK+="ttyLogger$env{LOGGER_DEVICE_NUMBER}port $env{LOGGER_PORT_NUMBER}" where the logger_import program writes lines like this LOGGER_PORT_NUMBERB LOGGER_DEVICE_NUMBERC on stdout which is then imported into the environment for the device (and thus available for later rules and via libudev). David