Skip to content

Commit

Permalink
fix(dracut-install): do not try to copy files from the root directory
Browse files Browse the repository at this point in the history
HWCAP library path needs at least two parent directories, for example:

/lib64/power6x/libc.so.6
/lib64/glibc-hwcaps/power9/libpthread-2.28.so (glibc 2.33+)

Before:

dracut-install: Lib install: '/lib64/libz.so.1'
dracut-install: dracut_install('/lib64/libz.so', '/lib64/libz.so', 0, 0, 1)
dracut-install: dracut_install('//libz.so.1', '//libz.so.1', 0, 0, 1)
dracut-install: dracut_install('//libz.so', '//libz.so', 0, 0, 1)

After:

dracut-install: Lib install: '/lib64/libz.so.1'
dracut-install: dracut_install('/lib64/libz.so', '/lib64/libz.so', 0, 0, 1)
  • Loading branch information
marcosfrm authored and johannbg committed Aug 12, 2022
1 parent 7f2b093 commit ebbcf97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/install/dracut-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ static int library_install(const char *src, const char *lib)
return ret;

ppdir = dirname_malloc(pdir);
if (!ppdir)
/* only one parent directory, not HWCAP library */
if (!ppdir || streq(ppdir, "/"))
return ret;

pppdir = dirname_malloc(ppdir);
Expand Down

0 comments on commit ebbcf97

Please sign in to comment.