Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57633 - patch to sys-apps/hotplug to automount into /mnt/usb
Summary: patch to sys-apps/hotplug to automount into /mnt/usb
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-19 13:44 UTC by Scott Marks
Modified: 2004-09-20 16:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to modify and add files to the hotplug ebuild install (hotplug.patch,7.28 KB, patch)
2004-07-19 13:47 UTC, Scott Marks
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Marks 2004-07-19 13:44:40 UTC
Although with the appropriate drivers a USB mass storage device will show up in /dev/sd when plugged in, it will not always be in the same place, usually /dev/sda1.  This patch adds a usb-storage "agent" that will create a mount point (usually /mnt/usb/storage) and mount the USB drive.  It handles multiple partitions, creates and symlinks an alias roughly of the form Vendor.Model to the mount point, and also tears down everything when the USB drive is removed.
Comment 1 Scott Marks 2004-07-19 13:47:50 UTC
Created attachment 35767 [details, diff]
Patch to modify and add files to the hotplug ebuild install

This patch merely modified /etc/hotplug/usb.usermap, /etc/conf.d/usb and adds
the files /etc/hotplug/usb/usb-storage and /etc/hotplug/usb/usb-storage.remove.
 It does not patch the ebuild, which also will need to create /var/run/usb
Comment 2 Simone Gotti (RETIRED) gentoo-dev 2004-07-19 14:00:07 UTC
I think that this won't work with udev, because in this moment the devicea under /dev arent't already created.

The solution is to put this script under /etc/dev.d with the .dev extension.

IMHO I also think that using something like hal (with the update-fstab script) and ivman will be a better solution.
Comment 3 Scott Marks 2004-07-19 14:16:08 UTC
Maybe, but the comments on the ivman/hal/dbus threads seem to indicate that USB sticks aren't supported (and the whole scene looks pretty flaky from the comments, IMO).

When I said multiple partitions, I meant on the USB mass storage.

I currently use this by having a more mnemonic name (like "/p" for "pen drive") symlinked to /mnt/usb/storage.  When the pen drive is in the USB port, I can see its contents under /p;  when I pull it out, ls /p just gives /p, as /mnt/sub no longer contains a storage subdirectory.

This could still use a little work.  If, to be safe, you "umount /p" before pulling out the drive, the mount point and its alias are not removed when the drive is pulled out.  I suspect this is because the hotplug agent never receives its "remove" action event, but I haven't tracked it down.  Instead, I just "sync".
Comment 4 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-09-20 16:17:30 UTC
Please use either HAL or /etc/dev.d for this.  Or devlabel.

But not a hotplug agent script, that's not the way to do this, sorry.