Chmod of /dev/ulptN

Warren Block wblock at wonkity.com
Tue Feb 12 16:01:29 UTC 2013


On Tue, 12 Feb 2013, Polytropon wrote:

> On Mon, 11 Feb 2013 18:33:12 -0800, Ronald F. Guilmette wrote:
>> I exactly followed the directions here:
>>
>>   http://lists.freebsd.org/pipermail/freebsd-questions/2012-February/238118.html
>>
>> Nontheless, my /dev/lpt0 node still only has permissions set to 0644.
>
> In the subject you've mentioned /dev/ulpt (USB LPT port), and
> now /dev/lpt (conventional LPT port), still the same applies
> for both.

Actually, the standard devfs.conf settings do not work for dynamic 
devices like ulpt0.  devd is the only way to do that for dynamic 
devices.  Here's an example I use use for a USB printer.  The vendor and 
product IDs were determined with usbconfig dump_device_desc:

# WB
# link Epson R200 printer to /dev/ulpt-r200 and unlpt-r200
attach 20 {
         device-name "ulpt[0-9]";
         match "vendor" "0x04b8";
         match "product" "0x0005";
         action "ln -sf /dev/$device-name /dev/ulpt-r200";
         action "ln -sf /dev/`echo $device-name \
                 | sed -e 's/ulpt/unlpt/'` /dev/unlpt-r200";
         action "chmod g+w /dev/ulpt-r200 /dev/unlpt-r200";
};

# WB
detach 20 {
         device-name "ugen[0-9].[0-9]";
         match "vendor" "0x04b8";
         match "product" "0x0005";
         action "rm -f /dev/ulpt-r200 /dev/unlpt-r200";
};


More information about the freebsd-questions mailing list