@@ -354,8 +354,8 @@ static int cp(const char *src, const char *dst)
354
354
static int library_install (const char * src , const char * lib )
355
355
{
356
356
_cleanup_free_ char * p = NULL ;
357
- _cleanup_free_ char * pdir = NULL , * ppdir = NULL , * clib = NULL ;
358
- char * q ;
357
+ _cleanup_free_ char * pdir = NULL , * ppdir = NULL , * pppdir = NULL , * clib = NULL ;
358
+ char * q , * clibdir ;
359
359
int r , ret = 0 ;
360
360
361
361
p = strdup (lib );
@@ -377,7 +377,8 @@ static int library_install(const char *src, const char *lib)
377
377
log_debug ("Lib install: '%s'" , p );
378
378
}
379
379
380
- /* Also try to install the same library from one directory above.
380
+ /* Also try to install the same library from one directory above
381
+ * or from one directory above glibc-hwcaps.
381
382
This fixes the case, where only the HWCAP lib would be installed
382
383
# ldconfig -p|grep -F libc.so
383
384
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
@@ -398,10 +399,18 @@ static int library_install(const char *src, const char *lib)
398
399
return ret ;
399
400
400
401
ppdir = strdup (ppdir );
402
+ pppdir = dirname (ppdir );
403
+ if (!pppdir )
404
+ return ret ;
405
+
406
+ pppdir = strdup (pppdir );
407
+ if (!pppdir )
408
+ return ret ;
401
409
402
410
strcpy (p , lib );
403
411
404
- clib = strjoin (ppdir , "/" , basename (p ), NULL );
412
+ clibdir = streq (basename (ppdir ), "glibc-hwcaps" ) ? pppdir : ppdir ;
413
+ clib = strjoin (clibdir , "/" , basename (p ), NULL );
405
414
if (dracut_install (clib , clib , false, false, true) == 0 )
406
415
log_debug ("Lib install: '%s'" , clib );
407
416
/* also install lib.so for lib.so.* files */
0 commit comments