[Grml] Re: [Grml-devel] RFC: handling of external usb devices

Tobias Klauser tklauser at grml.org
Sun Sep 3 18:36:56 CEST 2006


Hi,

On 2006-09-03 at 18:14:01 +0200, Michael Prokop <mika at grml.org> wrote:
> I'd like to ask for your comments about handling of external usb
> devices on grml.

Really nice work!

Out of interest: Would you want this to be part of udev.deb or do you
want to ship it in a separated package, so you could also install it on
any debian system?

> /mnt/external[1] will be left without any changes, we will stay
> completely backwards compatible. Additionally we will create
> /dev/usb-sd* devices via udev rules like:
> 
> # cat /etc/udev/usbpen.rules
> SUBSYSTEM=="block", BUS=="usb", KERNEL=="sd[a-z]*", ACTION=="add", SYMLINK+="usb-%k", GROUP="users", NAME="%k"
> SUBSYSTEM=="block", BUS=="usb", KERNEL=="sd[a-z]*", ACTION=="add", RUN+="/bin/mkdir -p /mnt/usb-%k"
> SUBSYSTEM=="block", BUS=="usb", KERNEL=="sd[a-z]*", ACTION=="add", RUN+="/bin/sleep 2"
> SUBSYSTEM=="block", BUS=="usb", KERNEL=="sd[a-z]*", ACTION=="add", RUN+="/usr/sbin/create_mnt_labels"
> SUBSYSTEM=="block", BUS=="usb", KERNEL=="sd[a-z]*", ACTION=="add", RUN+="/usr/sbin/rebuildfstab -r -u 1000 -g 1000"

May I suggest s/BUS/SUBSYSTEMS/ according to the recent changes in
upstream udev. Or we might completely loose one of SUBSYSTEM or
BUS/SUBSYSTEMS, but I'd have to test that.

> ACTION=="remove", KERNEL=="sd[a-z]*", RUN+="/usr/sbin/rebuildfstab -r -u 1000 -g 1000"
> ACTION=="remove", KERNEL=="sd[a-z]*", RUN+="/bin/rmdir /mnt/usb-%k", OPTIONS="last_rule"

Purely cosmetic: Reordering the directives (ACTION being first on "add"
and "remove") would improve readability.

[snip]

> If you want to disable the above feature at all on your grml system
> you would just have to remove the according udev rules file. This
> will be documented of course.

Better just put the real rules file in /etc/udev and symlink it to
/etc/udev/rules.d like we already do with the current rules.

> Please let me know what you think about it. If you're happy with
> this solutions I'd implement it so you can test it in real-live with
> the upcoming grml 0.7-1 devel-release.

That would be 0.8-1, wouldn't it? ;-)

Cheers, Tobias

-- 
  ,'"`.	    Tobias Klauser <tklauser at grml.org>
 (   grml - Linux for geeks
  `._,'     http://www.grml.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://ml.grml.org/pipermail/grml/attachments/20060903/5a49d14d/attachment-0003.pgp>


More information about the Grml mailing list