From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Soltys Date: Fri, 19 Nov 2010 16:44:46 +0000 Subject: [PATCH] Create symlinks and static/module nodes before /dev/null Message-Id: <20101119164446.GA5399@mott.hasevolq.tld> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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);