Skip to contentSkip to conversation

Create symlinks and static/module nodes before /dev/null

PATCH Applied Michal Soltys 2 participants 2 messages Nov 19, 2010 – Nov 22, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Create symlinks and static/module nodes before /dev/null

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.

udev/udevd.c +4 -2
index 21dde82..efdabe6 100644
@@ -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);
Applied
#1 lore raw

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

Quoted 8 lines · Michal Soltys

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