Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael S. Zick <minimod@morethan.org>
To: buildroot@busybox.net
Subject: [Buildroot] package/hotplug
Date: Thu, 19 Aug 2010 13:59:18 -0500	[thread overview]
Message-ID: <201008191359.23930.minimod@morethan.org> (raw)
In-Reply-To: <0D753D10438DA54287A00B0270842697643E6303F9@AUSP01VMBX24.collaborationhost.net>

On Thu August 19 2010, H Hartley Sweeten wrote:
> On Thursday, August 19, 2010 10:58 AM, Will Newton wrote:
> > On Thu, Aug 19, 2010 at 6:10 PM, H Hartley Sweeten wrote:
> >> But, how to I get mdev to mount the drive after it's detected?
> >
> > it may be possible with the mdev config file. It seems to only be
> > documented in the source:
> >
> > http://git.busybox.net/busybox/tree/util-linux/mdev.c
> >
> > See the section that mentions executing a command.
> 
> I figured it had something to do with the mdev.conf file.  I did
> some grep'ing and found the KwikByte target handles this with a
> custom '/sbin/automount.script' that is called by mdev.
> 
> I have modified my setup and it appears to be working.  When I plug
> in the USB drive it is now detected and mounted.  The only issue I
> have now is when the drive is removed.  mdev does call the script
> to unmount the drive but I get two kernel errors:
> 
> usb 2-1.4: USB disconnect, address 4
> FAT: bread failed in fat_clusters_flush
> FAT: bread failed in fat_clusters_flush
> 
> I think these are generated because the drive is actually not present
> when umount tries to unmount it.  I'm using the -f option (force unmount)
> but that doesn't seem to prevent the error.
> 

It can't, the drive isn't there to write to once you remove it.

Add a "safely unmount" thingy to whatever interface your device has, 
call a:
mount -o remount device_name
script.
Note there is no option specified after the "remount" - not a typo here.
That will make the kernel flush its VFS buffers for that device.

Mike
> Thanks for the help,
> Hartley
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 
> 

  reply	other threads:[~2010-08-19 18:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19  0:43 [Buildroot] package/hotplug H Hartley Sweeten
2010-08-19  9:26 ` Will Newton
2010-08-19 17:10   ` H Hartley Sweeten
2010-08-19 17:58     ` Will Newton
2010-08-19 18:38       ` H Hartley Sweeten
2010-08-19 18:59         ` Michael S. Zick [this message]
2010-08-25  5:35           ` Mitch Davis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201008191359.23930.minimod@morethan.org \
    --to=minimod@morethan.org \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox