1 Star 0 Fork 94

Mingtai/systemd_1

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-namespace-rebreak-a-few-comments.patch 4.63 KB
一键复制 编辑 原始数据 按行查看 历史
From bce7fb14df960aee57f0ad5c9c12a0d35c3e504e Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 12 Nov 2021 11:09:40 +0100
Subject: [PATCH] namespace: rebreak a few comments
(cherry picked from commit d73020f2420aa3f220481016829aaa2602abf081)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/bce7fb14df960aee57f0ad5c9c12a0d35c3e504e
---
src/core/namespace.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/src/core/namespace.c b/src/core/namespace.c
index 982aeeac19..233ee7be40 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -806,8 +806,7 @@ static int clone_device_node(
*make_devnode = false;
}
- /* We're about to fall back to bind-mounting the device
- * node. So create a dummy bind-mount target.
+ /* We're about to fall back to bind-mounting the device node. So create a dummy bind-mount target.
* Do not prepare device-node SELinux label (see issue 13762) */
r = mknod(dn, S_IFREG, 0);
if (r < 0 && errno != EEXIST)
@@ -930,10 +929,8 @@ static int mount_private_dev(MountEntry *m) {
if (r < 0)
log_debug_errno(r, "Failed to set up basic device tree at '%s', ignoring: %m", temporary_mount);
- /* Create the /dev directory if missing. It is more likely to be
- * missing when the service is started with RootDirectory. This is
- * consistent with mount units creating the mount points when missing.
- */
+ /* Create the /dev directory if missing. It is more likely to be missing when the service is started
+ * with RootDirectory. This is consistent with mount units creating the mount points when missing. */
(void) mkdir_p_label(mount_entry_path(m), 0755);
/* Unmount everything in old /dev */
@@ -975,8 +972,8 @@ static int mount_bind_dev(const MountEntry *m) {
assert(m);
- /* Implements the little brother of mount_private_dev(): simply bind mounts the host's /dev into the service's
- * /dev. This is only used when RootDirectory= is set. */
+ /* Implements the little brother of mount_private_dev(): simply bind mounts the host's /dev into the
+ * service's /dev. This is only used when RootDirectory= is set. */
(void) mkdir_p_label(mount_entry_path(m), 0755);
@@ -1085,7 +1082,8 @@ static int mount_tmpfs(const MountEntry *m) {
entry_path = mount_entry_path(m);
inner_path = mount_entry_unprefixed_path(m);
- /* First, get rid of everything that is below if there is anything. Then, overmount with our new tmpfs */
+ /* First, get rid of everything that is below if there is anything. Then, overmount with our new
+ * tmpfs */
(void) mkdir_p_label(entry_path, 0755);
(void) umount_recursive(entry_path, 0);
@@ -1930,11 +1928,11 @@ int setup_namespace(
* we create it if it doesn't already exist. */
(void) mkdir_p_label("/run/systemd", 0755);
- /* Always create the mount namespace in a temporary directory, instead of operating
- * directly in the root. The temporary directory prevents any mounts from being
- * potentially obscured my other mounts we already applied.
- * We use the same mount point for all images, which is safe, since they all live
- * in their own namespaces after all, and hence won't see each other. */
+ /* Always create the mount namespace in a temporary directory, instead of operating directly
+ * in the root. The temporary directory prevents any mounts from being potentially obscured
+ * my other mounts we already applied. We use the same mount point for all images, which is
+ * safe, since they all live in their own namespaces after all, and hence won't see each
+ * other. */
root = "/run/systemd/unit-root";
(void) mkdir_label(root, 0700);
@@ -2198,8 +2196,8 @@ int setup_namespace(
(void) mkdir_p(propagate_dir, 0600);
if (n_extension_images > 0)
- /* ExtensionImages mountpoint directories will be created
- * while parsing the mounts to create, so have the parent ready */
+ /* ExtensionImages mountpoint directories will be created while parsing the mounts to create,
+ * so have the parent ready */
(void) mkdir_p(extension_dir, 0600);
/* Remount / as SLAVE so that nothing now mounted in the namespace
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangmingtaip/systemd_1.git
git@gitee.com:yangmingtaip/systemd_1.git
yangmingtaip
systemd_1
systemd_1
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385