Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: sh/
Date: Wed, 07 Sep 2011 03:21:20
Message-Id: 5ed4d084d95608e40cb21888c18a8f381a44cd69.WilliamH@gentoo
1 commit: 5ed4d084d95608e40cb21888c18a8f381a44cd69
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 7 02:00:08 2011 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 7 02:00:08 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5ed4d084
7
8 Mount /run as early as possible
9
10 This commit moves the code that mounts /run to the earliest possible
11 position in openrc.
12
13 ---
14 sh/init-early.sh.Linux.in | 24 ++++++++++++++++++++++++
15 sh/init.sh.Linux.in | 24 ------------------------
16 2 files changed, 24 insertions(+), 24 deletions(-)
17
18 diff --git a/sh/init-early.sh.Linux.in b/sh/init-early.sh.Linux.in
19 index f546951..3a81ef9 100644
20 --- a/sh/init-early.sh.Linux.in
21 +++ b/sh/init-early.sh.Linux.in
22 @@ -5,6 +5,30 @@
23 : ${CONSOLE:=/dev/console}
24 : ${RC_LIBEXECDIR:=@LIBEXECDIR@}
25
26 +# Mount tmpfs on /run when directory exists.
27 +# /run is a new directory for storing volatile runtime data.
28 +# Read more about /run at https://lwn.net/Articles/436012
29 +if [ -d /run ]; then
30 + if mountinfo -q /run; then
31 + einfo "/run is already mounted, skipping"
32 + else
33 + ebegin "Mounting /run"
34 + if ! fstabinfo --mount /run; then
35 + mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
36 + fi
37 + eend $?
38 + fi
39 + if [ ! -d /run/lock ]; then
40 + mkdir /run/lock
41 + fi
42 + if [ -d /run/lock ]; then
43 + chown root:uucp /run/lock
44 + chmod 0775 /run/lock
45 + fi
46 +elif [ -e /run ]; then
47 + einfo "Unable to mount /run since it is not a directory"
48 +fi
49 +
50 if [ -e "$RC_LIBEXECDIR"/console/unicode ]; then
51 termencoding="%G"
52 kmode="-u"
53
54 diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
55 index b357434..d01cc7b 100644
56 --- a/sh/init.sh.Linux.in
57 +++ b/sh/init.sh.Linux.in
58 @@ -91,30 +91,6 @@ if $mountproc; then
59 eend $?
60 fi
61
62 -# Mount tmpfs on /run when directory exists.
63 -# /run is a new directory for storing volatile runtime data.
64 -# Read more about /run at https://lwn.net/Articles/436012
65 -if [ -d /run ]; then
66 - if mountinfo -q /run; then
67 - einfo "/run is already mounted, skipping"
68 - else
69 - ebegin "Mounting /run"
70 - if ! fstabinfo --mount /run; then
71 - mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
72 - fi
73 - eend $?
74 - fi
75 - if [ ! -d /run/lock ]; then
76 - mkdir /run/lock
77 - fi
78 - if [ -d /run/lock ]; then
79 - chown root:uucp /run/lock
80 - chmod 0775 /run/lock
81 - fi
82 -elif [ -e /run ]; then
83 - einfo "Unable to mount /run since it is not a directory"
84 -fi
85 -
86 # Try to mount xenfs as early as possible, otherwise rc_sys() will always
87 # return RC_SYS_XENU and will think that we are in a domU while it's not.
88 if grep -Eq "[[:space:]]+xenfs$" /proc/filesystems; then