Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

udev and autofs

Spent the last hour learning and playing with both udev and autofs. That goal, of course, is:

-- plug in a USB compact flash reader
-- insert some media
-- have device nodes created automatically, with correct permissions
-- have a filesystem mounted automatically, with correct permissions

Got it all working, but it's not so exciting.
Get udev-021, make, make install, then my udev.rules:
BUS="scsi", SYSFS{vendor}="SIIG", NAME="cardreader%n"

And udev.permissions:

Now I have:
bradfitz@bini:~$ ls -l /udev/cardreader*
brwxrwxrwx    1 bradfitz bradfitz   8,   0 Mar  9 16:24 /udev/cardreader
brwxrwxrwx    1 bradfitz bradfitz   8,   1 Mar  9 16:24 /udev/cardreader1

And I remove the reader and the nodes disappear.

It's hard to be impressed when the clunky parts are still clunky and the parts that work should've worked years ago.

Things that are clunky:

-- what does usb-storage driver register everything on the scsi bus? lame.

-- autofs feels like all things ancient unix. that's not always bad, but it does give it an odor. I'm thinking I don't actually want autofs, though... I think the better place to do this is from hotplug.

-- I want hotplug to tell me about media changes, so I can mount/umount stuff on my own. Maybe it does. I didn't dive into hotplug much. udev was getting its notifications from its installed hotplug hooks, so I didn't look at it more.

-- mount can't auto-detect FAT16? no magic? then I'd like to give it a list of file systems to try and mount at least on media change. if the mount fails, try them in order until one works. I'd make compact flash be (vfat, ext3)

In any case, more research to be done in this area I suppose. I'd be following Robert Love and the other monkey's Project Utopia more closely if it weren't all Fedora/SuSE. I suppose Debian will get it in a few years. *yawn*

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.

  • Why, hello...

    Long time no see. How's my baby doing?

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.