1 Star 0 Fork 49

alpha_wang/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0987-fstab-generator-allow-overriding-path-to-sysroot-etc.patch 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2024-08-28 13:34 . update to systemd-239-82.1.src.rpm
From f4a9bdf74c23a55ea96de696155ce9a5dfa43850 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <fsumsal@redhat.com>
Date: Mon, 27 Nov 2023 16:16:40 +0100
Subject: [PATCH] fstab-generator: allow overriding path to /sysroot/etc/fstab
too
Based on: 99e3d4767932bce5febb45e8543162d729d17425
Related: RHEL-1087
rhel-only
---
src/fstab-generator/fstab-generator.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 105ddd2fd0..02f0bccd2f 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -503,13 +503,17 @@ static int add_mount(
return 0;
}
+static const char *sysroot_fstab_path(void) {
+ return getenv("SYSTEMD_SYSROOT_FSTAB") ?: "/sysroot/etc/fstab";
+}
+
static int parse_fstab(bool initrd) {
_cleanup_endmntent_ FILE *f = NULL;
const char *fstab;
struct mntent *me;
int r = 0;
- fstab = initrd ? "/sysroot/etc/fstab" : fstab_path();
+ fstab = initrd ? sysroot_fstab_path() : fstab_path();
f = setmntent(fstab, "re");
if (!f) {
if (errno == ENOENT)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/alpha-wang/systemd.git
git@gitee.com:alpha-wang/systemd.git
alpha-wang
systemd
systemd
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385