how to automount USB key on nios ii uclinux system?

Robert P. J. Day rpjday at crashcourse.ca
Thu Jun 3 21:35:10 UTC 2010


  here's the majority of a posting i made on the nios II mailing list,
but it concerns busybox so i'm going to post it here as well since i
really, really would like to solve this by tomorrow morning.

---------- Forwarded message ----------

  i just got back from a site here in town where someone is trying to
configure their nios II uClinux system to automount the USB key when
it's inserted.  i spent an hour there and adjusted some things that
definitely needed to be adjusted but it's still not working.

  in a nutshell, here's what i can tell you about the system -- i am
not sitting in front of it so i can't test anything you suggest until
i go back there tomorrow.

  kernel: 2.6.23
  busybox: 1.5.1
    - configured with all mdev settings, including /etc/mdev.conf


  once the system is up and running, you can certainly insert the USB
key, and you see the proper messages regarding devices sda and sda1.
and once that's done, you can certainly *manually* mount the
filesystem:

  # mount /dev/sda1 /mnt

and the contents are there, then you can unmount it, so that part
works.  all that's left is to somehow register with hotplug to
automount /dev/sda1 at some specified mount point.

  now, the rest of the details.  /dev is entirely static, and already
contains device files for /dev/sda[1-10], so i'm thinking that might
be a problem.  wouldn't the whole point of mdev be to *create* the
device file upon insertion?  in any event, /dev is static and i don't
think i have the freedom to change that.

  on top of that, i noticed early that there was no /proc/sys
directory because /proc/sys hadn't been selected for creation so i
reconfigured to get /proc/sys.  but even after that, there was no
/proc/sys/kernel/hotplug file.

  from what i read, one sets up hotplugging and automounting with:

  # echo /bin/mdev > /proc/sys/kernel/hotplug

but if that hotplug file doesn't even exist, that command certainly
isn't going to create it under /proc.

  so ... the questions.  assuming i want to have an inserted USB key
mounted at /mnt upon insertion (and, of course, unmounted upon
removal):

  1) at boot time, shouldn't i have a /proc/sys/kernel/hotplug file?
and if it's missing, what have i forgotten to configure?

  2) does this have *any* chance of working if /dev is static content?

  3) if i can solve the above, what would the /etc/mdev.conf file look
like?

  i am *wide* open to advice, and i should be able to test any of it
tomorrow morning.  thanks in advance.

rday

p.s.  i have to think this should be simple to fix, but i've never
actually set up automount with mdev on a busybox-based system, so i'm
guessing it's something trivially stupid i've overlooked.

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================


More information about the busybox mailing list