Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: init.d/
Date: Fri, 01 Feb 2013 19:51:29
Message-Id: 1359748142.8a6c3391bdc707e89733c259d116d004cbebce88.WilliamH@OpenRC
1 commit: 8a6c3391bdc707e89733c259d116d004cbebce88
2 Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
3 AuthorDate: Fri Feb 1 19:49:02 2013 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 1 19:49:02 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=8a6c3391
7
8 sysfs: mount the fusectl file system
9
10 Reported-by: vapier <AT> gentoo.org
11 X-Gentoo-Bug: 453740
12 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=453740
13
14 ---
15 init.d/sysfs.in | 29 ++++++++++++++++++++---------
16 1 files changed, 20 insertions(+), 9 deletions(-)
17
18 diff --git a/init.d/sysfs.in b/init.d/sysfs.in
19 index 7d354e0..85bc083 100644
20 --- a/init.d/sysfs.in
21 +++ b/init.d/sysfs.in
22 @@ -4,6 +4,8 @@
23
24 description="Mount the sys filesystem."
25
26 +sysfs_opts=nodev,noexec,nosuid
27 +
28 depend()
29 {
30 keyword -lxc -prefix -vserver
31 @@ -23,7 +25,7 @@ mount_sys()
32
33 ebegin "Mounting /sys"
34 if ! fstabinfo --mount /sys; then
35 - mount -n -t sysfs -o noexec,nosuid,nodev sysfs /sys
36 + mount -n -t sysfs -o ${sysfs_opts} sysfs /sys
37 fi
38 eend $?
39 }
40 @@ -35,7 +37,7 @@ mount_misc()
41 ! mountinfo -q /sys/kernel/security; then
42 if grep -qs securityfs /proc/filesystems; then
43 ebegin "Mounting security filesystem"
44 - mount -n -t securityfs -o nodev,noexec,nosuid \
45 + mount -n -t securityfs -o ${sysfs_opts} \
46 securityfs /sys/kernel/security
47 eend $?
48 fi
49 @@ -45,8 +47,7 @@ mount_misc()
50 if [ -d /sys/kernel/debug ] && ! mountinfo -q /sys/kernel/debug; then
51 if grep -qs debugfs /proc/filesystems; then
52 ebegin "Mounting debug filesystem"
53 - mount -n -t debugfs -o nodev,noexec,nosuid \
54 - debugfs /sys/kernel/debug
55 + mount -n -t debugfs -o ${sysfs_opts} debugfs /sys/kernel/debug
56 eend $?
57 fi
58 fi
59 @@ -55,8 +56,7 @@ mount_misc()
60 if [ -d /sys/kernel/config ] && ! mountinfo -q /sys/kernel/config; then
61 if grep -qs configfs /proc/filesystems; then
62 ebegin "Mounting config filesystem"
63 - mount -n -t configfs -o nodev,noexec,nosuid \
64 - configfs /sys/kernel/config
65 + mount -n -t configfs -o ${sysfs_opts} configfs /sys/kernel/config
66 eend $?
67 fi
68 fi
69 @@ -65,11 +65,22 @@ mount_misc()
70 if [ -d /sys/fs/cgroup ] && ! mountinfo -q /sys/fs/cgroup; then
71 if grep -qs cgroup /proc/filesystems; then
72 ebegin "Mounting cgroup filesystem"
73 - local opts="nodev,noexec,nosuid,mode=755,size=${rc_cgroupsize:-10m}"
74 + local opts="${sysfs_opts},mode=755,size=${rc_cgroupsize:-10m}"
75 mount -n -t tmpfs -o ${opts} cgroup_root /sys/fs/cgroup
76 eend $?
77 fi
78 fi
79 +
80 + # set up kernel support for fusectl
81 + if [ -d /sys/fs/fuse/connections ] \
82 + && ! mountinfo -q /sys/fs/fuse/connections; then
83 + if grep -qs fusectl /proc/filesystems; then
84 + ebegin "Mounting fuse control filesystem"
85 + mount -n -t fusectl -o ${sysfs_opts} \
86 + fusectl /sys/fs/fuse/connections
87 + eend $?
88 + fi
89 + fi
90 }
91
92 mount_cgroups()
93 @@ -79,7 +90,7 @@ mount_cgroups()
94 local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
95 mkdir /sys/fs/cgroup/openrc
96 mount -n -t cgroup \
97 - -o none,nodev,noexec,nosuid,name=openrc,release_agent="$agent" \
98 + -o none,${sysfs_opts},name=openrc,release_agent="$agent" \
99 openrc /sys/fs/cgroup/openrc
100 echo 1 > /sys/fs/cgroup/openrc/notify_on_release
101
102 @@ -87,7 +98,7 @@ mount_cgroups()
103 while read name hier groups enabled rest; do
104 case "${enabled}" in
105 1) mkdir /sys/fs/cgroup/${name}
106 - mount -n -t cgroup -o nodev,noexec,nosuid,${name} \
107 + mount -n -t cgroup -o ${sysfs_opts},${name} \
108 ${name} /sys/fs/cgroup/${name}
109 ;;
110 esac