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
1=== modified file 'ChangeLog'
2--- ChangeLog 2012-08-03 15:47:59 +0000
3+++ ChangeLog 2012-08-07 15:24:24 +0000
4@@ -1,3 +1,11 @@
5+2012-08-07 James Hunt <james.hunt@ubuntu.com>
6+
7+ * init/main.c: main(): Remove checks for /dev/kmsg, /dev/null,
8+ /dev/console and /dev/tty since some environments use different
9+ major/minor numbers to the norm (for example on LXC, /dev/console is
10+ not (5,1), but (136,*)). Do not attempt to create /dev/console again,
11+ due to LXC numbering difference.
12+
13 2012-08-03 James Hunt <james.hunt@ubuntu.com>
14
15 * init/main.c:main(): Handle hostile initramfs-less environments by
16
17=== modified file 'init/main.c'
18--- init/main.c 2012-08-07 14:33:12 +0000
19+++ init/main.c 2012-08-07 15:24:24 +0000
20@@ -244,15 +244,11 @@
21 */
22 (void)umask (0);
23
24- /* Check if key devices already exist; if they do,
25+ /* Check if key /dev entries already exist; if they do,
26 * we should assume we don't need to mount /dev.
27 */
28 if (system_check_file ("/dev/ptmx", S_IFCHR, makedev (5, 2)) < 0
29- || system_check_file ("/dev/pts", S_IFDIR, 0) < 0
30- || system_check_file ("/dev/kmsg", S_IFCHR, makedev (1, 11)) < 0
31- || system_check_file ("/dev/null", S_IFCHR, makedev (1, 3)) < 0
32- || system_check_file ("/dev/console", S_IFCHR, makedev (5, 1)) < 0
33- || system_check_file ("/dev/tty", S_IFCHR, makedev (5, 0)) < 0)
34+ || system_check_file ("/dev/pts", S_IFDIR, 0) < 0)
35 needs_devtmpfs = 1;
36
37 if (needs_devtmpfs) {
38@@ -290,7 +286,6 @@
39 */
40 system_mknod ("/dev/null", (S_IFCHR | 0666), makedev (1, 3));
41 system_mknod ("/dev/tty", (S_IFCHR | 0666), makedev (5, 0));
42- system_mknod ("/dev/console", (S_IFCHR | 0600), makedev (5, 1));
43 system_mknod ("/dev/kmsg", (S_IFCHR | 0600), makedev (1, 11));
44
45 /* Set the standard file descriptors to the ordinary console device,

Subscribers

People subscribed via source and target branches