From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott James Remnant Date: Mon, 03 Oct 2005 15:21:49 +0000 Subject: Re: [RFC] coldplug - emit hotplug events from sysfs Message-Id: <1128352909.7525.4.camel@localhost.localdomain> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-b4OoNxtoipzcbYDUYE6W" List-Id: References: <20051001124943.GA26076@vrfy.org> In-Reply-To: <20051001124943.GA26076@vrfy.org> To: linux-hotplug@vger.kernel.org --=-b4OoNxtoipzcbYDUYE6W Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2005-10-03 at 14:21 +0200, Kay Sievers wrote: > To play with it, I use this stupid hack in an early init-script and > it works without udevstart or any other coldplug logic. > After mounting tmpfs, creating /dev/null, disabling /sbin/hotplug and > starting udevd, it creates the tty devices, waits for the events to > finish, then sends out all remaining events to finish asynchronously: > ... > # regenerate events by triggering sysfs > for i in /sys/class/t*/*/uevent; do echo 1 > $i; done > # wait for async tty events to finish > while [ $(cat /proc/*/status 2> /dev/null | grep -c -E '^Name:.udevd?$'= ) -gt 1 ]; do > sleep 0.1 > done >=20 There's a much better way to do this! If there's a guarantee that a "write to uevent" will cause a uevent, you can simply use the udev rules to make sure that udev has fired for each uevent you caused to be generated. No need to grovel for udev processes, etc. Scott --=20 Scott James Remnant scott@ubuntu.com --=-b4OoNxtoipzcbYDUYE6W Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBDQUyNSnQiFMl4yK4RAk9/AKCrchqqldZ0ZYZYH1B/p+J+TwkMcACcD+SE 1Ce2uHgU1oc+Q+wmLy/QTyY= =utxM -----END PGP SIGNATURE----- --=-b4OoNxtoipzcbYDUYE6W-- ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ 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