Ken Moffat wrote:
On Sat, Feb 07, 2015 at 11:32:08PM -0600, Bruce Dubbs wrote:
Ken Moffat wrote:
# A. olympus camera control
# 1. - symlink to the partition
# originally from udevinfo -a -p /sys/class/usb_device/usbdev2.2/
if ! [ -f /etc/udev/rules.d/23-olympus.rules ]; then
echo "SUBSYSTEMS==\"usb\", ATTRS{manufacturer}==\"OLYMPUS\", KERNEL==\"sd?1\", SYMLINK=\"olympus\",
MODE=\"0660\", OPTIONS=\"last_rule\"" >/etc/udev/rules.d/23-olympus.rules
fi
Just a style suggestion Ken. You don't need all those backslashes.
echo 'SUBSYSTEMS=="usb", ATTRS{manufacturer}=="OLYMPUS", KERNEL=="sd?1", \
SYMLINK="olympus", MODE="0660", OPTIONS="last_rule"' \
> /etc/udev/rules.d/23-olympus.rules
should work for you. Inside single quotes, there are no special characters.
Note that the first backslash is is inside single quotes and splits the line
that is created. The second backslash is for bash.
True, but I have not changed most of the details since July 2009
(that's the earliest copy I still have, from way before my scripts
were under version control). Do rules split across more than one
line (your first backslash) work ? It's a long time since I looked
at rules, but at one time every example I could find was on a single
line.
Allowing split rules is now supoprted, but I agree that it was not originally.
For others that may read this, the udev line does not actually mount the
device. The instruction above just adds a symlink (/dev/olympus ->
/dev/sd?1) and changes the permissions of /dev/sd?1 to 660.
I would think that a GROUP= would be necessary. As it is, only root has
access, but that may be what you want.
I do it in stages, in the part you trimmed. The second stage is
mkdir /media/olympus with a chown to me and whichever group I
am in (in the early days, many of my builds were on clfs, and at one
time my default group differed between the two books). The third
stage adds /dev/olympus to /etc/fstab with mountpoint /media/olympus
and that lets me mount it.
But udev changes the group/permissions of the device, not the mountpoint, and
that can only happen when the kernel creates the device upon insertion.
-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Do not top post on this list.
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
http://en.wikipedia.org/wiki/Posting_style