All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Create symlinks and static/module nodes before /dev/null
@ 2010-11-19 16:44 Michal Soltys
  2010-11-22 13:01 ` [PATCH] Create symlinks and static/module nodes before /dev/null check Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Soltys @ 2010-11-19 16:44 UTC (permalink / raw)
  To: linux-hotplug

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

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

* Re: [PATCH] Create symlinks and static/module nodes before /dev/null check
  2010-11-19 16:44 [PATCH] Create symlinks and static/module nodes before /dev/null Michal Soltys
@ 2010-11-22 13:01 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2010-11-22 13:01 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Nov 19, 2010 at 17:44, Michal Soltys <soltys@ziu.info> wrote:
> 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.

Applied.

Thanks,
Kay

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

end of thread, other threads:[~2010-11-22 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-19 16:44 [PATCH] Create symlinks and static/module nodes before /dev/null Michal Soltys
2010-11-22 13:01 ` [PATCH] Create symlinks and static/module nodes before /dev/null check Kay Sievers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.