Skip to content

Commit

Permalink
dd_extract: -l should not extract modules+firmware
Browse files Browse the repository at this point in the history
The -l|--libraries flag to dd_extract is (apparently) supposed to only
unpack the contents of /lib, /lib64, /usr/lib, and /usr/lib64.

Except... kernel modules are in /lib/modules, and firmware is in
/lib/firmware. So --libraries also extracts firmware and modules,
if present.

This patch makes it exclude files under /lib/modules and /lib/firmware
when using --libraries.
  • Loading branch information
wgwoods committed Jun 24, 2015
1 parent 1f14a36 commit b537c45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/dd/dd_extract.c
Expand Up @@ -102,7 +102,9 @@ int dlabelFilter(const char* name, const struct stat *fstat, int packageflags, v

/* unpack lib and lib64 if the package was marked as installer-enhancement */
if ((packageflags & dup_libraries)) {
if(!strncmp("lib/", name, 4))
if(!strncmp("lib/", name, 4) &&
strncmp("lib/firmware/", name, 13) &&
strncmp("lib/modules/", name, 12))
return 1;
else if (!strncmp("lib64/", name, 6))
return 1;
Expand Down

0 comments on commit b537c45

Please sign in to comment.