linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Hotplug only coldplugs...
@ 2006-03-30 23:21 Matthew Percival
  2006-03-31 17:16 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matthew Percival @ 2006-03-30 23:21 UTC (permalink / raw)
  To: linux-hotplug

G'Day,

	I hope it is OK to post these sorts of questions here; I was not sure
where it should be taken.

	I have been trying to set up diethotplug for an embedded system, but
have not had any success with actually hotplugging devices.  The only
devices that are to be attached are a compact flash memory device and a
USB flash memory, which will always be on hda1 and sda1 respectively.
After much playing around with the scripts, I have been able to get the
USB memory to mount when `/etc/init.d/hotplug start' is called, which
seems to be a good start, but I have not been able to get any effect
outside of this case.  I have not spend much time on compact flash yet,
which is why the scripts for it are not yet working.

	In one test I tried, I left the device plugged in, unmounted it, and
run `hotplug usb', but nothing seemed to happen --- I even added an echo
statement the the start of /etc/hotplug/usb.rc, but did not see it.
Since coldplugging works, I would assume my scripts are all correctly
set up, so I am a little stuck on what the problem could be.  In
addition, /proc/sys/kernel/hotplug says hotplug needs to be
at /sbin/hotplug, which it is, but when I replace hotplug with a script
that merely echoes any arguments it receives, and try plugging in the
device, there is no response.  Perhaps this is to be expected, but it
seems odd to me.

	If anyone could offer any advice to what I should try doing here, it
would be most appreciated.

	Thanks,

	Matthew Percival

PS	When the system is used as a USB device rather than a USB host, can
hotplug be used somehow to identify when it is connected to a host?  I
have not been able to find anything saying it can, but I can always
hope.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Hotplug only coldplugs...
  2006-03-30 23:21 Hotplug only coldplugs Matthew Percival
@ 2006-03-31 17:16 ` Greg KH
  2006-04-03  6:16 ` Matthew Percival
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2006-03-31 17:16 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Mar 31, 2006 at 09:21:34AM +1000, Matthew Percival wrote:
> G'Day,
> 
> 	I hope it is OK to post these sorts of questions here; I was not sure
> where it should be taken.
> 
> 	I have been trying to set up diethotplug for an embedded system, but
> have not had any success with actually hotplugging devices.

Ick, don't use diethotplug.  It can be replaced with one line in a udev
rule file.  Just use udev and you should be fine.

Unless you are using a 2.4 kernel.  If that is the case, good luck, you
are on your own :)

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Hotplug only coldplugs...
  2006-03-30 23:21 Hotplug only coldplugs Matthew Percival
  2006-03-31 17:16 ` Greg KH
@ 2006-04-03  6:16 ` Matthew Percival
  2006-04-04  2:51 ` Matthew Percival
  2006-04-06  6:33 ` Matthew Percival
  3 siblings, 0 replies; 5+ messages in thread
From: Matthew Percival @ 2006-04-03  6:16 UTC (permalink / raw)
  To: linux-hotplug

G'Day,

> Ick, don't use diethotplug.  It can be replaced with one line in a udev
> rule file.  Just use udev and you should be fine.

	I am now trying to migrate to udev (I had only filled /dev/ with a
hand-full of mknods in the past), but all the HOWTOs I find are very
distro-specific, while I am working with a home-cooked embedded system,
so I am having trouble with doing this.

	I crosscompiled and installed udev with little trouble (it does not
seem to install udevstart for some reason, but I just copied it across)
and moved the contents of /dev/ to /lib/udev/devices/, but left copies
of console and null in /dev/: this much was straight-forward enough.
All the documentation I have seen now either skips forward to
customising rules, or tells you do perform some distro-specific
operation to complete this stage: I am completely lost at what to do
next!

	I seem to need to mount a tmpfs on /dev/, then somehow have udev copy
the contents of /lib/udev/devices/ to /dev/, but have no idea how I am
supposed to do this.  I have tried explicitly mounting /dev/, launching
udevd and running udevstart, but the moment I mount /dev/ I lose console
and null, so do not get any further. If I run udevstart without mounting
the tmpfs, it just creates an almighty number of useless files in on the
disk (in /dev/) --- I assume the number of files was simply because I
have not yet properly configured the rules.

	How do I get udev started properly on an embedded system?  I do not
need to worry about lilo/grub, and I do not use an initrd; I assume I
just need to add a few lines to my rcS file, but cannot work out what.

	-- Matthew



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Hotplug only coldplugs...
  2006-03-30 23:21 Hotplug only coldplugs Matthew Percival
  2006-03-31 17:16 ` Greg KH
  2006-04-03  6:16 ` Matthew Percival
@ 2006-04-04  2:51 ` Matthew Percival
  2006-04-06  6:33 ` Matthew Percival
  3 siblings, 0 replies; 5+ messages in thread
From: Matthew Percival @ 2006-04-04  2:51 UTC (permalink / raw)
  To: linux-hotplug

G'Day,

	With the help of an off-the-list reply from Dan Nicholson, I have been
able to get udev going.  I have put the contents of his reply at the end
of this message, so should anyone else have the same problem as I did,
and they search this list, they can get a solution.

	I am just having a small issue now, in regard to the rules files.  For
whatever reason, it seems as if the rules files are ignored: I took the
base Debian files, removed things that I did not need, changed the
permissions, added some symlinks, and set it up to mount the USB flash
memory sticks (which was the original purpose of my question).  The
trouble is, none of my changes are being seen in the system, even after
a reboot; indeed, I found that completely removing /etc/udev/rules.d/
has no effect on what I see in /dev/!  Each file ends in .rules, and it
readable to all.

	Just as an aside, the way I understand things is that udev works out
what the system has available, and uses the rules to work out how to
present them to the user (in very simple terms), but can I write rules
to say `yeah, I have this, but I do not use it, so just ignore it'?

	-- Matthew

On Mon, 2006-04-03 at 16:06 -0700, Dan Nicholson wrote: 
> Hi Matthew,
> 
> I saw your post on linux-hotplug-devel about setting up udev on a
> homebrewed system.  I'm not subscribe there, so I apologize for
> sending this off-list.
> 
> Anyway, my system uses the Linux From Scratch recipe which is pretty
> minimal for a base.  There are people tackling the newer udev issue
> right now.  This is not an advertisement for that project, but just an
> offering of one possible solution.
> 
> There are two books you might be interested in.  The first is the
> standard native build.  Here's the one using newer udev and kernel:
> 
> http://www.linuxfromscratch.org/lfs/view/udev_update/
> 
> The other one is cross-compiled and handles a few arches.  udev
> shouldn't matter much on the arch, I don't think, so you could pick
> any of them.
> 
> http://www.linuxfromscratch.org/lfs/view/cross-lfs/
> 
> Both are udev only, no hotplug.  The important parts are the udev
> build (obviously), the udev rules and the bootscripts.  The
> implementations are slightly different for stupid reasons that aren't
> worth getting into.
> 
> Since I'm more familiar with the native build, here are the relevant
> sections from that book.
> 
> Udev rules (these are much simpler than any you will find at a distro,
> although I make no promises that they will recognize all the devices
> for your system):
> 
> http://downloads.linuxfromscratch.org/udev-config-6.rules
> 
> Bootscripts (The important one is in init.d/udev; beware that another
> set of bootscripts may come very shortly as people experiment with the
> udevtrigger program in newer udev.  You rightly noticed that udevstart
> is not installed.  This is because it's use is discouraged.  The udev
> bootscript is one implementation to manually populate /dev at
> coldplug.)
> 
> http://www.linuxfromscratch.org/~dj/bootscripts/lfs-bootscripts-udev_update-20060402.tar.bz2
> 
> The udev build:
> 
> http://www.linuxfromscratch.org/lfs/view/udev_update/chapter06/udev.html
> 
> A description of the whole situation:
> 
> http://www.linuxfromscratch.org/lfs/view/udev_update/chapter07/udev.html
> 
> Good luck.
> 
> --
> Dan



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Hotplug only coldplugs...
  2006-03-30 23:21 Hotplug only coldplugs Matthew Percival
                   ` (2 preceding siblings ...)
  2006-04-04  2:51 ` Matthew Percival
@ 2006-04-06  6:33 ` Matthew Percival
  3 siblings, 0 replies; 5+ messages in thread
From: Matthew Percival @ 2006-04-06  6:33 UTC (permalink / raw)
  To: linux-hotplug

G'Day,

	I have not yet had much luck working out what is wrong with my udev
set-up (*.rules files are not applied), but I have spotted something odd
which may turn on a lightbulb for someone.

	When I look in /dev/.udev/ on my desktop, I see it full of directories
--- it seems to be one for every device in /dev/.  On the embedded
system, however, /dev/.udev/ only contains one directory, failed/, which
itself only contains class@dspctl@dspctl/.  No changes to the *.rules
files in /etc/udev/rules.d/ seems to have any effect on this.  I have
also messed around with udev.conf, but it did not seem to change things
here.  Whenever I use udevinfo, it complains that there is no record in
the database (which I guess is synonymous with there being no reference
in /dev/.udev/).

	Does this suggest anything to anyone, as I do not seem to be getting
anywhere with this.

	-- Matthew



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-04-06  6:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-30 23:21 Hotplug only coldplugs Matthew Percival
2006-03-31 17:16 ` Greg KH
2006-04-03  6:16 ` Matthew Percival
2006-04-04  2:51 ` Matthew Percival
2006-04-06  6:33 ` Matthew Percival

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).