-
Notifications
You must be signed in to change notification settings - Fork 1
/
0010-mount-setup-mount-kernel-fs-by-default.patch
242 lines (238 loc) · 9.58 KB
/
0010-mount-setup-mount-kernel-fs-by-default.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
From 0359443ad4fc7c8052962b010f4a668a6312acc2 Mon Sep 17 00:00:00 2001
From: Dimitri John Ledkov <[email protected]>
Date: Mon, 6 Jul 2015 17:07:42 +0100
Subject: [PATCH 10/38] mount-setup: mount kernel fs by default.
Instead of using mount units, just mount hugetlbfs, mqueue, fusectl,
configfs, debugfs directly from mount-setup.
---
src/shared/mount-setup.c | 10 +++++++++
units/dev-hugepages.mount | 23 ---------------------
units/dev-mqueue.mount | 23 ---------------------
units/meson.build | 13 +-----------
units/sys-fs-fuse-connections.mount | 32 -----------------------------
units/sys-kernel-config.mount | 31 ----------------------------
units/sys-kernel-debug.mount | 23 ---------------------
7 files changed, 11 insertions(+), 144 deletions(-)
delete mode 100644 units/dev-hugepages.mount
delete mode 100644 units/dev-mqueue.mount
delete mode 100644 units/sys-fs-fuse-connections.mount
delete mode 100644 units/sys-kernel-config.mount
delete mode 100644 units/sys-kernel-debug.mount
diff --git a/src/shared/mount-setup.c b/src/shared/mount-setup.c
index 975c027f47..d8a95f4941 100644
--- a/src/shared/mount-setup.c
+++ b/src/shared/mount-setup.c
@@ -110,6 +110,16 @@ static const MountPoint mount_table[] = {
#endif
{ "bpf", "/sys/fs/bpf", "bpf", "mode=700", MS_NOSUID|MS_NOEXEC|MS_NODEV,
NULL, MNT_NONE, },
+ { "hugetlbfs", "/dev/hugepages", "hugetlbfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_NONE },
+ { "mqueue", "/dev/mqueue", "mqueue", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_NONE },
+ { "fusectl", "/sys/fs/fuse/connections", "fusectl", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_NONE },
+ { "configfs", "/sys/kernel/config", "configfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_NONE },
+ { "debugfs", "/sys/kernel/debug", "debugfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_NONE },
};
bool mount_point_is_api(const char *path) {
diff --git a/units/dev-hugepages.mount b/units/dev-hugepages.mount
deleted file mode 100644
index 517437784c..0000000000
--- a/units/dev-hugepages.mount
+++ /dev/null
@@ -1,23 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-#
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Huge Pages File System
-Documentation=https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
-DefaultDependencies=no
-Before=sysinit.target
-ConditionPathExists=/sys/kernel/mm/hugepages
-ConditionCapability=CAP_SYS_ADMIN
-ConditionVirtualization=!private-users
-
-[Mount]
-What=hugetlbfs
-Where=/dev/hugepages
-Type=hugetlbfs
diff --git a/units/dev-mqueue.mount b/units/dev-mqueue.mount
deleted file mode 100644
index 02683a9e1e..0000000000
--- a/units/dev-mqueue.mount
+++ /dev/null
@@ -1,23 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-#
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=POSIX Message Queue File System
-Documentation=man:mq_overview(7)
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
-DefaultDependencies=no
-Before=sysinit.target
-ConditionPathExists=/proc/sys/fs/mqueue
-ConditionCapability=CAP_SYS_ADMIN
-
-[Mount]
-What=mqueue
-Where=/dev/mqueue
-Type=mqueue
-Options=nosuid,nodev,noexec
diff --git a/units/meson.build b/units/meson.build
index e8f81f2230..e9f925a810 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -11,15 +11,10 @@ units = [
['cryptsetup.target', 'HAVE_LIBCRYPTSETUP',
'sysinit.target.wants/'],
['veritysetup-pre.target', 'HAVE_LIBCRYPTSETUP'],
- ['veritysetup.target', 'HAVE_LIBCRYPTSETUP',
- 'sysinit.target.wants/'],
+ ['veritysetup.target', 'HAVE_LIBCRYPTSETUP'],
['integritysetup-pre.target', 'HAVE_LIBCRYPTSETUP'],
['integritysetup.target', 'HAVE_LIBCRYPTSETUP',
'sysinit.target.wants/'],
- ['dev-hugepages.mount', '',
- 'sysinit.target.wants/'],
- ['dev-mqueue.mount', '',
- 'sysinit.target.wants/'],
['emergency.target', ''],
['exit.target', ''],
['factory-reset.target', ''],
@@ -86,12 +81,6 @@ units = [
['sound.target', ''],
['suspend.target', ''],
['swap.target', ''],
- ['sys-fs-fuse-connections.mount', '',
- 'sysinit.target.wants/'],
- ['sys-kernel-config.mount', '',
- 'sysinit.target.wants/'],
- ['sys-kernel-debug.mount', '',
- 'sysinit.target.wants/'],
['sys-kernel-tracing.mount', '',
'sysinit.target.wants/'],
['sysinit.target', ''],
diff --git a/units/sys-fs-fuse-connections.mount b/units/sys-fs-fuse-connections.mount
deleted file mode 100644
index ca48fd5f4f..0000000000
--- a/units/sys-fs-fuse-connections.mount
+++ /dev/null
@@ -1,32 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-#
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=FUSE Control File System
-Documentation=https://www.kernel.org/doc/Documentation/filesystems/fuse.txt
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
-DefaultDependencies=no
-ConditionPathExists=/sys/fs/fuse/connections
-ConditionCapability=CAP_SYS_ADMIN
-ConditionVirtualization=!private-users
-Before=sysinit.target
-
-# These dependencies are used to make certain that the module is fully
-# loaded. Indeed udev starts this unit when it receives an uevent for the
-# module but the kernel sends it too early, ie before the init() of the module
-# is fully operational and /sys/fs/fuse/connections is created, see issue#17586.
-
-
-[Mount]
-What=fusectl
-Where=/sys/fs/fuse/connections
-Type=fusectl
-Options=nosuid,nodev,noexec
diff --git a/units/sys-kernel-config.mount b/units/sys-kernel-config.mount
deleted file mode 100644
index b99b4f4b7e..0000000000
--- a/units/sys-kernel-config.mount
+++ /dev/null
@@ -1,31 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-#
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Kernel Configuration File System
-Documentation=https://www.kernel.org/doc/Documentation/filesystems/configfs/configfs.txt
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
-DefaultDependencies=no
-ConditionPathExists=/sys/kernel/config
-ConditionCapability=CAP_SYS_RAWIO
-Before=sysinit.target
-
-# These dependencies are used to make certain that the module is fully
-# loaded. Indeed udev starts this unit when it receives an uevent for the
-# module but the kernel sends it too early, ie before the init() of the module
-# is fully operational and /sys/kernel/config is created, see issue#17586.
-
-
-[Mount]
-What=configfs
-Where=/sys/kernel/config
-Type=configfs
-Options=nosuid,nodev,noexec
diff --git a/units/sys-kernel-debug.mount b/units/sys-kernel-debug.mount
deleted file mode 100644
index d03837bafb..0000000000
--- a/units/sys-kernel-debug.mount
+++ /dev/null
@@ -1,23 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-#
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Kernel Debug File System
-Documentation=https://www.kernel.org/doc/Documentation/filesystems/debugfs.txt
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
-DefaultDependencies=no
-ConditionPathExists=/sys/kernel/debug
-ConditionCapability=CAP_SYS_RAWIO
-Before=sysinit.target
-
-[Mount]
-What=debugfs
-Where=/sys/kernel/debug
-Type=debugfs
-Options=nosuid,nodev,noexec
--
2.36.1