From mboxrd@z Thu Jan 1 00:00:00 1970 From: md@Linux.IT (Marco d'Itri) Date: Sun, 19 Dec 2004 14:56:16 +0000 Subject: temporarily disabling udev Message-Id: <20041219145616.GA8975@wonderland.linux.it> MIME-Version: 1 Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR" List-Id: To: linux-hotplug@vger.kernel.org --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I need to patch udev to be sure that it will not modify /dev if udevstart has been not been run (e.g. because root disabled the init script, or it failed for some reason). Would this work? diff -ruNp udev-048.orig/udev.c udev-048/udev.c --- udev-048.orig/udev.c 2004-12-08 20:43:16.000000000 +0100 +++ udev-048/udev.c 2004-12-19 15:09:51.000000000 +0100 @@ -83,6 +83,15 @@ exit: return 0; } =20 +/* return true if the udev database exists */ +static int udev_active(void) { + struct stat stats; + + if (stat (udev_db_path, &stats) =3D=3D 0) + return 1; + return 0; +} + static void asmlinkage sig_handler(int signum) { switch (signum) { @@ -161,6 +170,9 @@ int main(int argc, char *argv[], char *e if (udev_log) setenv("UDEV_LOG", "1", 1); =20 + if (!udev_active()) + goto hotplug; + if ((strncmp(devpath, "/block/", 7) =3D=3D 0) || (strncmp(devpath, "/clas= s/", 7) =3D=3D 0)) { if (strcmp(action, "add") =3D=3D 0) { /* wait for sysfs and possibly add node */ --=20 ciao, | Marco | [9919 peXnx6UiWKdTk] --T4sUOijqQbZv57TR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBxZaQFGfw2OHuP7ERApc/AJ9QVFxF93nbNJN5LSHsxHGnfq44FQCfa4VJ A9zdol5okrNw+N1M4mmn28g= =LwK3 -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ 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