From: Michal Soltys <soltys@ziu.info>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] Create symlinks and static/module nodes before /dev/null
Date: Fri, 19 Nov 2010 16:44:46 +0000 [thread overview]
Message-ID: <20101119164446.GA5399@mott.hasevolq.tld> (raw)
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);
next reply other threads:[~2010-11-19 16:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-19 16:44 Michal Soltys [this message]
2010-11-22 13:01 ` [PATCH] Create symlinks and static/module nodes before /dev/null check Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101119164446.GA5399@mott.hasevolq.tld \
--to=soltys@ziu.info \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox