Symlinks aren't intended to be different between optimization levels
so they are not needed to be installed in the optimized chroots.
Signed-off-by: William Douglas <william.douglas@intel.com>
Same files in optimized paths would be under a symlink in the standard
path so try and just correct them during the move.
Signed-off-by: William Douglas <william.douglas@intel.com>
The libraries being in hwcaps is going to cause extra space usage more
heavily when enabling avx2 broadly in the ecosystem. To avoid this,
use the binary replacement that's already in place for the rest of the
ecosystem instead.
Signed-off-by: William Douglas <william.douglas@intel.com>
The packages now are expected to have content placed in a optimized
path prefix, V3 for AVX2 and V4 for AVX512 (with additional prefixes
as new options are added). Update elf-move.py to move content in the
installdir to the targetdir under a prefix based on the btype.
Library files that are moved to the hwcaps directory are not impacted
by this change. All other files that are moved will now be found in
the targetdir with the remaining fullpath name of prefix + virtpath.
Signed-off-by: William Douglas <william.douglas@intel.com>
In some cases paths end with /usr/lib64 but are not exactly /usr/lib64
and elf-move was incorrectly classifying them as libraries. Fix this
by checking against the exact virt path dirname for /usr/lib64
instead.
Signed-off-by: William Douglas <william.douglas@intel.com>
The original file being missing from the filemap makes it hard to know
what all the files in the optimized-elf directory actually correspond
to. This change allows better validation and tracking to happen in
case there are issues in either the content creation or deployment
side of the operation.
Signed-off-by: William Douglas <william.r.douglas@gmail.com>
Make the content of the filemap clearly indicate if a file is an elf
or not and use that to determine if the file is added to the
optimized-elf contents.
Signed-off-by: William Douglas <william.douglas@intel.com>
copy_original should only run when the filemap entry is added to the
optimized_dir.
Also use the targetdir file not the installdir file (as that is the
sse version).
Signed-off-by: William Douglas <william.douglas@intel.com>
For content that isn't directly in /usr/lib64 but is under that
path (typically plugins) it wasn't added to the optimized-elf
directory incorrectly. Resolve this by fixing the test against
/usr/lib64.
Signed-off-by: William Douglas <william.douglas@intel.com>
Callers previously would set the full optimized-elf path and need to
be updated. To ensure they are updated rather than build incorrectly,
check if the full path is being used for targetdir and error out.
Signed-off-by: William Douglas <william.douglas@intel.com>
The libraries do not need to conditionally installed as they are used
conditionally already. While this takes up additional disk space it is
preferrable for now due to swupd not handling the missing files well.
This requires a change in how targetpath is interpretted. Now the
targetpath is no longer the path given to the optimized file directory
but instead the path to the base of the target and the optimzied file
directory is now fixed ('/usr/share/clear/optimized-elf').
Signed-off-by: William Douglas <william.douglas@intel.com>
Golang binaries have been observed to contain function names with many
other ASCII characters not captured by the previous regex.
Adjust that regex by permitting arbitrary characters for the function
name component of the line (between the ` <` and `>:`) and declaring the
expected content for the rest of the line.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Refactor the output parsing of `objdump -d ...` so that function
summaries are properly reported.
Previously, the correspondence of results and functions were off-by-one:
the results were mistakenly associated with the next function to parse
instead of the previous function that was just parsed.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
In cases where nothing was written to the filemap, delete it as it
just creates extra package waste if it is left behind.
Signed-off-by: William Douglas <william.douglas@intel.com>
Enable skipping a specific file (this will override the include if
both paths are set to the same file).
Current usage is excluding setuid files that are only known about by
autospec and are otherwise tricky to exclude after.
Signed-off-by: William Douglas <william.douglas@intel.com>
The setuid files need to be specially annotated in the spec
file in order for the setuid attribute to be handled correctly by
rpm. Because the optimized binaries are not easily able to be
identified this way in the spec file, just skip setuid binaries from
being added to the optimized list.
Signed-off-by: William Douglas <william.douglas@intel.com>
It is possible for matches to have the form:
rfc3986[idna2008]<2,>=1.3
So account for the bracket as part of the regex.
Signed-off-by: William Douglas <william.douglas@intel.com>
Add tooling to remove version dependencies for a given list of python
modules found in a subset of files in a given directory. This is
useful for cases where packages in pypi have out of date dependencies
relative to the test of the ecoysystem.
Signed-off-by: William Douglas <william.douglas@intel.com>
Because miltiple binaries might share the same exact contents, include
the filepath as part of the hash.
Signed-off-by: William Douglas <william.douglas@intel.com>
If --path was not passed previously elf-move would crash, it also was
incorrectly handling the filepath instead of the virtpath (only care
about the path after the DESTDIR for --path, makes handling easier
too).
Finally make --path override the --skip behavior so they can work
together to append new content to a file.