279 Commits
Author SHA1 Message Date
William Douglas 3b5d8e089c Improve manifest include subtraction
Instead of giving up on directory subtraction entirely, try to
subtract directories that are in an included manifest *and* do not
have a non-directory file somewhere in their path.

For example:

bundle1:
/dir/file

bundle2: includes bundle1
/dir

In this case /dir would be subtracted from bundle2.

Also add a special case for subtracting directories if they are in
os-core as this reduces a lot of unused content from a bundle's
manifest.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-05-01 11:51:54 -07:00
William Douglas 1252267078 Avoid defining chrootDir in a loop
Variable doesn't need to be redefined each iteration, declare it
outside the loop.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-05-01 11:51:54 -07:00
William Douglas b452dd935c Add support for package bundles
Add package level bundles "pundles" first class support in mixer. This
involves tagging pundles with "pundle" in the bundle definition file's
"MAINTAINER" field.

This support requires changes to bundle constraints, primarily that
cycles are now allowed in bundle includes. As part of this, directory
subtraction will no longer be done for includes as the true directory
owner isn't something that can be decided on in a cycle.

Validation also needed a slight adjustment for pundles to reflect
their minimal bundle definition files.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-04-25 11:30:00 -07:00
William Douglas e5966cbe5a Identify manifest in logging
Improve the usability of log messages by indicating which manifest is
invalid when printing errors.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-04-25 11:30:00 -07:00
William Douglas 4eba5e1528 Limit the amount of certain modifiers in packs
Systems using certain modifiers are currently not used as frequently
so in order to reduce pack size and improve update times skip those
modifiers from being considered for packs.

Currently the SSE version is skipped when either AVX2 or AVX512
versions exist and APX is always skipped.

This change does not apply to 0 packs as it would break installer
offline support.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-01-06 15:03:08 -08:00
William Douglas 8faa776067 Add missing SSE modifier mappings
These were unintentionally left out and while unlikely to be used
should be included for correctness.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-01-06 15:03:08 -08:00
William Douglas bb53ba0046 Use /VA instead of /V5 for the APX prefix
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-30 11:42:32 -08:00
William Douglas 8031794511 Fix remaining two logic lints
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-30 11:42:32 -08:00
William Douglas 04eee0d0bb Mass lint cleanups
Two left over that are logic changes to be addressed in the next
commit.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-30 11:42:32 -08:00
William Douglas 671732bb24 Add APX support
Add support for new APX optimization level using the /V5 prefix.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-30 11:42:32 -08:00
William Douglas a84c256962 Improve testing for linkPeersAndChange
Add cases for optimization prefixes being changed and directories with
optimizations being skipped.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-05-30 12:36:02 -07:00
William Douglas ebeb309042 Ignore directories with optimization prefixes for delta peers
When considering delta peer matches, skip any directory with an
optimization prefix for consideration. The the directories are not
intended to be different between optimization versions.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-05-30 12:36:02 -07:00
William Douglas 481f2fba6f Fix log message
Correct message to indicate SSE file is missing.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-05-17 10:03:34 -07:00
William Douglas 9beba01847 Add linking for optimized prefixes
The optimized prefix doesn't set Misc flags until the last moment
during manifest writing so ignore the flags when testing for peers
when a prefix is in place.

Also improve some comments and test cases.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-24 23:50:24 -07:00
William Douglas 0cf23ce610 Reset prefix after manifest is written
As other mixer processes might use the manifests after they are
written, reset the path to include the prefix once the manifest write
is complete.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-24 14:57:48 -07:00
William Douglas 244c9fb554 Reset name from manifest based on modifiers
If the modifiers of a file indicate it came from a chroot path, reset
the filename to use the chroot path when reading the file information
from a manifest.

Also ensure the only case files are marked as deleted is when it is
the SSE file. Other optimized files marked as deleted will be skipped
from being output in the manifest (and if the delete is new, the other
files with the same post processed path will be marked as new in the
version being built to ensure the deleted file is replaced).

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-24 07:33:45 -07:00
William Douglas 05fff65f3e Use sort with version in setupModifiers
The codebase uses sortFilesVersionName prior to writing out manifests
and that should be used in setupModifiers as well.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-19 10:39:33 -07:00
William Douglas 9d2f3a0f0c Update generation code for modifierMasks and reformat 2023-04-14 15:38:53 -07:00
William Douglas 0a7f6068e1 Enable multiple versions of the same path
This change allows for a chroot with specific versioned content with
matching optimization levels to be added and accounted for. The paths
will be stripped of a version prefix (currently /V3 or /V4) and the
file's Modifier will be setup accordingly. The modifier will then be
updated to reflect the optimization level of the file and the total
optimization of any file with the same path.

With this change the previous Modifier setting has been revamped and
the old 'C', 'b' and 's' fields will be ignored. The 'b' posed a
slight problem that needed to be accounted for with how ghosted files
are detected and this has been done through looking only at the files
path.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-12 11:55:05 -07:00
Arjan van de Ven 21a6cc2932 Add support for hex renames to mixer
Sometimes (like hex coded license files) there's value in not only ignoring digits
for detecting renames, but also ignoring a-f to deal with hex mismatches
2022-09-06 11:58:38 -07:00
Arjan van de Ven 10a5a75737 fix testcases 2022-09-02 09:14:50 -07:00
Arjan van de Ven d8f5c2736b fix testcases 2022-09-02 09:14:50 -07:00
Arjan van de Ven 74492c7e6e fix testcases 2022-09-02 09:14:50 -07:00
Arjan van de Ven 10fcaaa9d7 Pin the from/to versions in the delta filename
in https://github.com/clearlinux/mixer-tools/issues/782 a funky issue is found where
we do not use the right versions for delta files in some cases.

A full fix is complicated, but the client IGNORES the versions! so we can just hardcode
the versions to anything (10 and 20 here) and it'll suddenly resolve itself
2022-09-02 09:14:50 -07:00
Arjan van de Ven 417de44eec Revert "skip pure renames"
this is triggering a client bug; lets revert until we get to the bottom of that

This reverts commit 73bf833128.
2022-08-31 15:55:14 -07:00
Arjan van de Ven 73bf833128 skip pure renames 2022-08-30 15:19:39 -07:00
Arjan van de Ven 10d8912e4f fix missing files in packs
we need to not return "nil" if a delta file is missing, because that causes the caller
to not use the fallback option (which would include the full file)...
and we need the fallback option to have a complete pack

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
2022-08-30 11:19:02 -07:00
William Douglas 15ea3ace91 Revert "skip delta files for /usr/bin and /usr/lib64 due to our avx2 fallout"
This reverts commit 4c115e5a3e.

With content changes so that the /usr/bin and /usr/lib64 files should
still exist even using optimized libs this is no longer needed.

Signed-off-by: William Douglas <william.douglas@intel.com>
2022-08-09 09:42:05 -07:00
Arjan van de Ven 3aa920aac4 skip delta files for /usr/bin and /usr/lib64 due to our avx2 fallout 2021-11-04 09:23:49 -07:00
Reagan Lopez 3c0c3b63d9 Remove delta file in case bspatch test fails
Fixes the remaining part of #759

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2020-05-18 10:22:07 -07:00
Ashlesha Atrey 5ca50d0873 Fix generated warning for delta packs
While creating delta packs, only possible delta files are found.
If delta file is not found, log the error in debug mode instead
of generating warning, as delta might not have been
created for valid reason.

fixes #628
Signed-off-by: Ashlesha Atrey ashlesha.atrey@intel.com
2020-05-06 10:07:03 -07:00
Reagan Lopez eda20b16a8 Log bsdiff errors at Debug level
To avoid cluttering stdout with bsdiff errors, log them at Debug level
instead of Warning level.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2020-05-01 16:48:19 -07:00
Reagan Lopez 0c913eec00 Refactor logging for consistent messages
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2020-05-01 16:48:19 -07:00
Ashlesha Atrey f6dcd44f21 Implement logging for mixer
Implement the logging package for mixer.

A common log file can be set for all the mixer commands in the
builder.conf. E.g. `mixer config set Mixer.LOG <filepath>`

The log file and level can also be set for individual mixer
commands using the `--log` and `--log-level` flags respectively.

The various log levels are:
ERROR (1), WARNING (2), INFO (3), DEBUG (4) and VERBOSE (5).
Default log level is 4.

Fixes #666

Signed-off-by: Ashlesha Atrey ashlesha.atrey@intel.com
2020-04-30 13:57:58 -07:00
Ashlesha Atrey 40132af80c Improve performance of process bundles
Improve the performance of processing bundles by parallelizing readIncludes()
and detectManifestChanges() operations.

Fixes #725

Signed-off-by: Ashlesha Atrey <ashlesha.atrey@intel.com>
2020-03-10 16:14:30 -07:00
Ashlesha Atrey 301fb7e0c4 Calculate file hashes once
Currently, mixer build update performs multiple hash calculations for each file in the chroot.
Every manifest file entry and subtracted file will have their hashes calculated.
It would be a significant performance improvement to calculate the hash one time for each file and re-use it.

fixes #585

Signed-off-by: Ashlesha Atrey <ashlesha.atrey@intel.com>
2020-03-09 14:08:33 -07:00
Reagan Lopez 1cb0a99126 Introduce new export flag in bundle manifests
By default, files with the prefix "/bin/", "/usr/bin/" and "/usr/local/bin/"
will have a new export flag "x" in the 4th byte of the flag section of the
bundle Manifest.

The user can override this by using a new keyword "un-export()" in
the bundle definition file.
E.g. un-export(/usr/bin/file2)

Note: The export flag is at a bundle-file level and hence does not get
written to the Full manifest.

Fixes #708

Includes bat tests for the export flag feature.
Also, adds an entry for the content-chroot tests to Travis.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2020-02-21 11:15:17 -08:00
Reagan Lopez 1ba623f78c Change RenameFlag to MiscFlag
Change RenameFlag to MiscFlag since "rename" has been deprecated and
this flag will be used as a placeholder for various other flags.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2020-02-21 11:15:17 -08:00
Ashlesha Atrey 5c6afffa1d Refactor error handling in channels
Currently while catching errors using channels and select
statements, when the error is caught in select statements, it
is not breaking from the outside loop.
The correct approach is to let the existing go routines finish
executing and return one of the errors caught by the error channel.
It should also close the channel in order to stop executing new go
routines.
fixes #673

Signed-off-by: Ashlesha Atrey <ashlesha.atrey@intel.com>
2020-01-13 15:22:16 -08:00
John Akre 72081e4ef4 swupd: Retain previously deleted file entries
When the previous manifest's list of files was longer than the new
manifest's list of files there was a chance for previously deleted file
entries to be unexpectedly dropped. This change prevents previously
deleted files from dropping when the previous manifest's file list is
longer than the new manifest's list.

Fixes #684

Signed-off-by: John Akre <john.w.akre@intel.com>
2020-01-02 18:14:10 -08:00
Reagan Lopez b0450cc9d3 Remove unused numWorker param from functions
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-11-08 18:11:10 +01:00
Otavio Pontes f5fcb8bc51 index: Don't generate files that were included by os-core-update-index
Don't create the allbundles folder and any file that was included in that folder.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-11-05 16:19:37 +00:00
Otavio Pontes b6d63f4b14 index: Deprecate os-core-update-index
Generate an empty bundle os-core-update-index to replace the old index,
deleting all files included in previous manifests.

 - if the previous index exists and it's not empty, we generate an empty index
 - if the previous index doesn't exist we don't generate any index
 - if the previous index is an empty index, we just point to it in the new MoM

Fix #541

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-11-05 16:19:32 +00:00
Otavio Pontes 5bafd5ef22 index: Fix permissions of the os-core-update-index tracking file
Tracking file and directory was being created with incorrect permissions.
This is important because tracking files have excatly the same hash, except
this one.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-11-05 16:19:01 +00:00
Rodrigo Chiossi 68eecc1ba2 fullfiles: Add zstd support
Add support to zstd for fullfile creation. This compression method can
be enable via config using option "external-zstd".

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2019-11-05 15:23:22 +00:00
Rodrigo Chiossi e9909408a1 fullfiles: Add user configured compression list
This patch allows users to configure the compression methods that will
be used for fullfiles creation. The compression method can be set in the
Swupd.COMPRESSION property in builder.conf. Instead of enabling all
methods as previosly, xz is the only method that comes enabled by
default.

Note: internal gzip is still used for Link and Directory fullfile
creation.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2019-11-05 15:23:22 +00:00
Otavio Pontes c5fc2b9c9b manifest: Ignore IManifests when reading MoM lines
When reading a MoM always ignore IManifests. This is important to prevent
IManifests to be carried out to next mom in an update

Also adding some deprecation warnings

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-10-23 23:30:03 +02:00
Otavio Pontes 6ccb538e8d Revert "test: Add function to check the number of files in a Manifest"
Reverting commit to remove Iterative Manifests from mixer

This reverts commit 2e70c7f989.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-10-23 23:30:03 +02:00
Otavio Pontes f654378e58 Revert partially "Introducing the Iterative to-Manifest"
Reverting commit to remove Iterative Manifests from mixer

This reverts commit 8a35392a76.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-10-23 23:30:03 +02:00
Otavio Pontes f4c62000f5 Revert "packs: Don't create packs for Iterative Manifests"
Reverting commit to remove Iterative Manifests from mixer

This reverts commit 813b75f72b.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-10-23 23:30:03 +02:00