8 Star 0 Fork 16

src-anolis-os/dracut

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0190.patch 2.28 KB
一键复制 编辑 原始数据 按行查看 历史
From e6cb22f2d12dfe61abf32389fa7d8927105081e2 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Mon, 30 Aug 2021 10:02:22 +0200
Subject: [PATCH] fix(install): extend hwcaps library handling to libraries
under glibc-hwcaps/
(cherry picked from commit 10ed204f873f454dcd15ffcc82dc3a1c781c1514)
Resolves: #1983030
---
install/dracut-install.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/install/dracut-install.c b/install/dracut-install.c
index baf6dcff..4962316d 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -335,8 +335,8 @@ static int cp(const char *src, const char *dst)
static int library_install(const char *src, const char *lib)
{
_cleanup_free_ char *p = NULL;
- _cleanup_free_ char *pdir = NULL, *ppdir = NULL, *clib = NULL;
- char *q;
+ _cleanup_free_ char *pdir = NULL, *ppdir = NULL, *pppdir = NULL, *clib = NULL;
+ char *q, *clibdir;
int r, ret = 0;
p = strdup(lib);
@@ -358,7 +358,8 @@ static int library_install(const char *src, const char *lib)
log_debug("Lib install: '%s'", p);
}
- /* Also try to install the same library from one directory above.
+ /* Also try to install the same library from one directory above
+ * or from one directory above glibc-hwcaps.
This fixes the case, where only the HWCAP lib would be installed
# ldconfig -p|grep -F libc.so
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
@@ -379,10 +380,18 @@ static int library_install(const char *src, const char *lib)
return ret;
ppdir = strdup(ppdir);
+ pppdir = dirname(ppdir);
+ if (!pppdir)
+ return ret;
+
+ pppdir = strdup(pppdir);
+ if (!pppdir)
+ return ret;
strcpy(p, lib);
- clib = strjoin(ppdir, "/", basename(p), NULL);
+ clibdir = streq(basename(ppdir), "glibc-hwcaps") ? pppdir : ppdir;
+ clib = strjoin(clibdir, "/", basename(p), NULL);
if (dracut_install(clib, clib, false, false, true) == 0)
log_debug("Lib install: '%s'", clib);
/* also install lib.so for lib.so.* files */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/dracut.git
git@gitee.com:src-anolis-os/dracut.git
src-anolis-os
dracut
dracut
a8

搜索帮助