加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fstab-generator-do-not-remount-sys-when-running-in-a.patch 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
From cee7e40200b5eba60a5fed04fe006e8b48944fb2 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sun, 12 Dec 2021 11:43:21 +0900
Subject: [PATCH] fstab-generator: do not remount /sys when running in a
container
Closes #21744.
(cherry picked from commit 18f0eaafd7f180f5d0d2d65349835374146efdb3)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/cee7e40200b5eba60a5fed04fe006e8b48944fb2
---
src/fstab-generator/fstab-generator.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index b6582c9538..1dee728233 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -601,9 +601,16 @@ static int parse_fstab(bool initrd) {
if (!what)
return log_oom();
- if (is_device_path(what) && path_is_read_only_fs("/sys") > 0) {
- log_info("Running in a container, ignoring fstab device entry for %s.", what);
- continue;
+ if (path_is_read_only_fs("/sys") > 0) {
+ if (streq(what, "sysfs")) {
+ log_info("Running in a container, ignoring fstab entry for %s.", what);
+ continue;
+ }
+
+ if (is_device_path(what)) {
+ log_info("Running in a container, ignoring fstab device entry for %s.", what);
+ continue;
+ }
}
where = strdup(me->mnt_dir);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化