1 Star 0 Fork 50

crazyss/systemd_anolis

forked from src-anolis-os/systemd 
Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
0574-initrd-do-a-debug-log-if-failed-to-detect-rootfs-typ.patch 1.13 KB
Copy Edit Raw Blame History
renbo02 authored 2021-12-27 17:02 +08:00 . update to systemd-239-51.el8
From 3299c855c6e65596ff9d8635dcbd45ff6818499a Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Thu, 14 Jan 2021 00:39:10 +0800
Subject: [PATCH] initrd: do a debug log if failed to detect rootfs type
(cherry picked from commit 3377c740d9121f38385e70d6a380b5e4bd8c672a)
Related: #1959339
---
src/basic/util.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/basic/util.c b/src/basic/util.c
index 59bcf7b00c..fef52ad5ff 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -166,8 +166,16 @@ bool in_initrd(void) {
}
}
- saved_in_initrd = (lenient || path_is_temporary_fs("/") > 0) &&
- access("/etc/initrd-release", F_OK) >= 0;
+ if (!lenient) {
+ r = path_is_temporary_fs("/");
+ if (r < 0)
+ log_debug_errno(r, "Couldn't determine if / is a temporary file system: %m");
+
+ saved_in_initrd = r > 0;
+ }
+
+ if (saved_in_initrd != 0)
+ saved_in_initrd = access("/etc/initrd-release", F_OK) >= 0;
return saved_in_initrd;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/crazyss/systemd_anolis.git
git@gitee.com:crazyss/systemd_anolis.git
crazyss
systemd_anolis
systemd_anolis
a8

Search