Merge lp:~jamesodhunt/upstart/bug-980917-the-bug-that-would-not-die into lp:upstart

Proposed by James Hunt
Status: Merged
Merged at revision: 1377
Proposed branch: lp:~jamesodhunt/upstart/bug-980917-the-bug-that-would-not-die
Merge into: lp:upstart
Diff against target: 45 lines (+10/-7)
2 files modified
ChangeLog (+8/-0)
init/main.c (+2/-7)
To merge this branch: bzr merge lp:~jamesodhunt/upstart/bug-980917-the-bug-that-would-not-die
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+118579@code.launchpad.net

Description of the change

* init/main.c: main(): Remove checks for /dev/kmsg, /dev/null,
  /dev/console and /dev/tty since some environments use different
  major/minor numbers to the norm (for example on LXC, /dev/console is
  not (5,1), but (136,*)). Do not attempt to create /dev/console again,
  due to LXC numbering difference.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

@@ -290,7 +286,6 @@
                 */
                system_mknod ("/dev/null", (S_IFCHR | 0666), makedev (1, 3));
                system_mknod ("/dev/tty", (S_IFCHR | 0666), makedev (5, 0));
- system_mknod ("/dev/console", (S_IFCHR | 0600), makedev (5, 1));
                system_mknod ("/dev/kmsg", (S_IFCHR | 0600), makedev (1, 11));

                /* Set the standard file descriptors to the ordinary console device,

Per https://code.launchpad.net/~jamesodhunt/upstart/bug-980917-reworked/+merge/118132/comments/253998, we should also omit the mknod of /dev/null and /dev/kmsg, which are guaranteed to be provided at the time devtmpfs is mounted.

I'll fix this up and push.

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

Actually, on second thought: while I don't think the mknod()s here will ever do any good, they also aren't harmful in the case that the device file already exists. So it's fine to keep all of them, *including* the /dev/console one... so I'll just add that back.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2012-08-03 15:47:59 +0000
+++ ChangeLog 2012-08-07 15:24:24 +0000
@@ -1,3 +1,11 @@
12012-08-07 James Hunt <james.hunt@ubuntu.com>
2
3 * init/main.c: main(): Remove checks for /dev/kmsg, /dev/null,
4 /dev/console and /dev/tty since some environments use different
5 major/minor numbers to the norm (for example on LXC, /dev/console is
6 not (5,1), but (136,*)). Do not attempt to create /dev/console again,
7 due to LXC numbering difference.
8
12012-08-03 James Hunt <james.hunt@ubuntu.com>92012-08-03 James Hunt <james.hunt@ubuntu.com>
210
3 * init/main.c:main(): Handle hostile initramfs-less environments by11 * init/main.c:main(): Handle hostile initramfs-less environments by
412
=== modified file 'init/main.c'
--- init/main.c 2012-08-07 14:33:12 +0000
+++ init/main.c 2012-08-07 15:24:24 +0000
@@ -244,15 +244,11 @@
244 */244 */
245 (void)umask (0);245 (void)umask (0);
246246
247 /* Check if key devices already exist; if they do,247 /* Check if key /dev entries already exist; if they do,
248 * we should assume we don't need to mount /dev.248 * we should assume we don't need to mount /dev.
249 */249 */
250 if (system_check_file ("/dev/ptmx", S_IFCHR, makedev (5, 2)) < 0250 if (system_check_file ("/dev/ptmx", S_IFCHR, makedev (5, 2)) < 0
251 || system_check_file ("/dev/pts", S_IFDIR, 0) < 0251 || system_check_file ("/dev/pts", S_IFDIR, 0) < 0)
252 || system_check_file ("/dev/kmsg", S_IFCHR, makedev (1, 11)) < 0
253 || system_check_file ("/dev/null", S_IFCHR, makedev (1, 3)) < 0
254 || system_check_file ("/dev/console", S_IFCHR, makedev (5, 1)) < 0
255 || system_check_file ("/dev/tty", S_IFCHR, makedev (5, 0)) < 0)
256 needs_devtmpfs = 1;252 needs_devtmpfs = 1;
257253
258 if (needs_devtmpfs) {254 if (needs_devtmpfs) {
@@ -290,7 +286,6 @@
290 */286 */
291 system_mknod ("/dev/null", (S_IFCHR | 0666), makedev (1, 3));287 system_mknod ("/dev/null", (S_IFCHR | 0666), makedev (1, 3));
292 system_mknod ("/dev/tty", (S_IFCHR | 0666), makedev (5, 0));288 system_mknod ("/dev/tty", (S_IFCHR | 0666), makedev (5, 0));
293 system_mknod ("/dev/console", (S_IFCHR | 0600), makedev (5, 1));
294 system_mknod ("/dev/kmsg", (S_IFCHR | 0600), makedev (1, 11));289 system_mknod ("/dev/kmsg", (S_IFCHR | 0600), makedev (1, 11));
295290
296 /* Set the standard file descriptors to the ordinary console device,291 /* Set the standard file descriptors to the ordinary console device,

Subscribers

People subscribed via source and target branches