On 8/29/07, Georgina Joyce <[EMAIL PROTECTED]> wrote:
>
> In attempting to get a braille display working with brltty, the brltty list 
> invited me to show the contents of /dev/bus/usb/, from which, it raised an 
> interesting question.  That of leading zeroes, it would appear that brltty 
> expects the devices to have a leading zero but my lfs installation doesn't, 
> should it?

I believe that if they're using libusb, it should take care of it. But
I'm not certain, and it's not really worth it for you to tell the
brltty people how to write their application. Instead we can just fix
up your udev rule to use printf and give the leading zeroes, which is
what's used on other distros.

Look at /etc/udev/rules.d/25-lfs.rules for this rule:

SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev};
B=$${X%%%%.*} D=$${X#*.}; echo bus/usb/$$B/$$D'", NAME="%c"

Comment it out (# is for comments) and try this rule that other
distros were using:

SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev};
printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c"

The key here is the %03i format specifier for printf which will give
the leading zeroes to fill to three places.

This is the first time I've known this to be an issue (the leading
zeroes). The good news is that this hackery is not needed on 2.6.22 or
newer kernels. For those, the name is in the environment, which allows
this rule:

SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device",
NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"

which is in the udev-config rules with LFS-6.3. If you're not using a
newer kernel, though, the rule with printf will work, though. (Unless
your shell doesn't provide printf and /usr is on a separate mount)

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to