Do not modify /dev until DB_DIR has been created.

diff -r 992812459513 udev_device.c
--- a/udev_device.c	Mon Oct 15 22:02:05 2007 +0200
+++ b/udev_device.c	Mon Oct 15 22:14:36 2007 +0200
@@ -164,6 +164,18 @@ exit:
 	return retval;
 }
 
+/* return true if the udev database exists */
+static int dynamic_dev(void) {
+	char dbpath[PATH_MAX];
+	struct stat stats;
+
+	strlcpy(dbpath, udev_root, sizeof(dbpath));
+	strlcat(dbpath, "/"DB_DIR, sizeof(dbpath));
+	if (stat(dbpath, &stats) == 0)
+		return 1;
+	return 0;
+}
+
 int udev_device_event(struct udev_rules *rules, struct udevice *udev)
 {
 	int retval = 0;
@@ -171,6 +183,11 @@ int udev_device_event(struct udev_rules 
 	if (udev->devpath_old != NULL)
 		if (udev_db_rename(udev->devpath_old, udev->dev->devpath) == 0)
 			info("moved database from '%s' to '%s'", udev->devpath_old, udev->dev->devpath);
+
+	if (major(udev->devt) != 0 && !dynamic_dev()) {
+		dbg("db not found, ignoring add event for %s", udev->dev->devpath);
+		return 0;
+	}
 
 	/* add device node */
 	if (major(udev->devt) != 0 &&
