[PATCH] Create symlinks and static/module nodes before /dev/null check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



static_dev_create() and static_dev_create_from_modules() are called much later,
after udevd checks for /dev/null existence (and in case of failure it exits).
Although not really important with devtmpfs - if someone uses standard tmpfs,
one will have to copy static nodes manually (or at least create /dev/null) - even
though udevd does that itself.

As both of the functions don't seem to depend on things after /dev/null check, they
probably could be moved up a bit, right after setting umask.


diff --git a/udev/udevd.c b/udev/udevd.c
index 21dde82..efdabe6 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -1098,6 +1098,10 @@ int main(int argc, char *argv[])
 	chdir("/");
 	umask(022);
 
+	/* create standard links, copy static nodes, create nodes from modules */
+	static_dev_create(udev);
+	static_dev_create_from_modules(udev);
+
 	/* before opening new files, make sure std{in,out,err} fds are in a sane state */
 	fd = open("/dev/null", O_RDWR);
 	if (fd < 0) {
@@ -1264,8 +1268,6 @@ int main(int argc, char *argv[])
 	}
 	info(udev, "set children_max to %u\n", children_max);
 
-	static_dev_create(udev);
-	static_dev_create_from_modules(udev);
 	udev_rules_apply_static_dev_perms(rules);
 
 	udev_list_init(&event_list);
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux