linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Wegner <ww-ml@gmx.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: cold-plugged usb flash drive not handled correctly in embedded
Date: Fri, 20 Aug 2010 15:00:22 +0000	[thread overview]
Message-ID: <20100820150022.GE10027@debian-wegner1.datadisplay.de> (raw)
In-Reply-To: <20100820144236.GD10027@debian-wegner1.datadisplay.de>

Hi,

On Fri, Aug 20, 2010 at 04:51:44PM +0200, Kay Sievers wrote:
> On Fri, Aug 20, 2010 at 16:42, Wolfgang Wegner <ww-ml@gmx.de> wrote:
> > /etc/udev/rules.d/50-udev.rules:
> > ACTION="add", KERNEL="sd[a-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,flush,quiet,nodev,nosuid,exec,noatime,dmask\00,fmask\x111 /dev/%k /mnt/usbdisk", OPTIONS="last_rule"
> 
> udev 161 has no "last_rule" thing anymore.

ok, but I guess this does not change anything, especially in the
case when I use this as the only rule. ;-)

> You mount all devices, the possibly built-in ,and the plugged-in
> devices at the same place? :)

Yes, currently I do, because only one USB device is "supported".

> > It does not matter if I leave the standard rules in
> > /libexec/rules.d/ or if I remove them altogether, in either
> > case the USB flash drive is correctly mounted when plugged
> > into the running system but not when it is already present when
> > the system boots up.
> 
> The event for the device happens during early boot where you have no
> chance to mount. Do you run 'udevadm trigger' at bootup? It will
> re-generate all events so that they can be handled when userspace is
> running. It would need --action­d for your current rule to match.

The busybox start script (/etc/init.d/rcS) runs my udev start script
(/etc/init.d/start_udev.sh) which in turn runs udevadm trigger as
one of the last steps:

[...]
udevd --daemon --debug

mkdir -p /dev/.udev/queue/ /dev/.udev/rules.d/
create_dev_root_rule /dev/.udev/

udevadm trigger

create_dev_makedev

udevadm settle

exit 0

Again, I have to admit I do not really understand what
create_dev_makedev is for (copied from debian), but I am quite
sure it can do no harm...

From my understanding, this should generate all the events -
and I see the event is there, because of this:
18.530148 [586] udev_device_new_from_syspath: device 0x40770 has devpath '/devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/host2/target2:0:0/2:0:0:0/block/sda/sda1'
18.530268 [586] udev_rules_apply_to_event: LINK 'block/8:1' //libexec/rules.d/50-udev-default.rules:3
18.530343 [586] udev_rules_apply_to_event: GROUP 0 //libexec/rules.d/50-udev-default.rules:72
18.530490 [586] udev_device_new_from_syspath: device 0x3eb40 has devpath '/devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/host2/target2:0:0/2:0:0:0/block/sda'
18.530894 [586] udev_device_read_db: device 0x3eb40 filled with db file data

All I am missing is the "RUN" line here.

BTW, amazing response time! :-)

Regards,
Wolfgang


  parent reply	other threads:[~2010-08-20 15:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-20 14:42 cold-plugged usb flash drive not handled correctly in embedded Wolfgang Wegner
2010-08-20 14:51 ` cold-plugged usb flash drive not handled correctly in embedded system Kay Sievers
2010-08-20 15:00 ` Wolfgang Wegner [this message]
2010-08-20 15:19 ` cold-plugged usb flash drive not handled correctly in embedded Wolfgang Wegner
2010-08-20 15:29 ` Greg KH
2010-08-20 15:31 ` cold-plugged usb flash drive not handled correctly in embedded system Kay Sievers
2010-08-20 16:02 ` cold-plugged usb flash drive not handled correctly in embedded Wolfgang Wegner
2010-08-20 16:12 ` Wolfgang Wegner
2010-08-20 16:25 ` Karl O. Pinc
2010-08-20 16:32 ` cold-plugged usb flash drive not handled correctly in embedded system Bryan Kadzban
2010-08-23  7:20 ` cold-plugged usb flash drive not handled correctly in embedded Wolfgang Wegner
2010-08-23  7:24 ` Wolfgang Wegner

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=20100820150022.GE10027@debian-wegner1.datadisplay.de \
    --to=ww-ml@gmx.de \
    --cc=linux-hotplug@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).