2202 Commits

Author SHA1 Message Date
Robert Dower 79cea2778f archive repository 2025-08-07 14:08:09 -07:00
William Douglas b84ce51b29 Release 7.0.0
- Change update output to include format
- Require root for check-update --verbose

Signed-off-by: William Douglas <william.douglas@intel.com>
v7.0.0
2025-04-24 14:26:55 -07:00
William Douglas acad8c47b0 Add format information to update output
The current format is very useful information to get from bug reports
so add it as default output to swupd update.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-04-24 14:20:58 -07:00
William Douglas 700b9ed5ad Make check-update --verbose require root
In order to get the content needed for check-update with the --verbose
option, root is required as data is put into the statedir. Keep the
old behavior when verbose isn't passed.

This was change was required because of the new latest file handling
for --incremental.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-04-24 14:20:58 -07:00
William Douglas dd3e0f3d81 Update copyright years
Signed-off-by: William Douglas <william.douglas@intel.com>
2025-04-24 14:20:58 -07:00
William Douglas 93c75767ef Release 6.1.0
This release contains:

* Add ability to handle bundle deletes outside of format bumps
* Add new instructions for cleaning up orphaned bundles

Signed-off-by: William Douglas <william.douglas@intel.com>
v6.1.0
2025-03-27 14:16:13 -07:00
William Douglas 23a9a44571 Make github action shellcheck run on PRs
Modify the shell check workflow to operate on the same events as the
swupd tests.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-03-26 16:55:13 -07:00
William Douglas 79717bd2cd Fix up shellcheck issues
The mechanism used to convert bats tests to something shellcheck can
verify caused a large number of failures due to the introduction of
testing for if a call is possible. Given the tests aren't called in
a normal shell script way, it is best to just ignore this error for
bats files.

Also fix an index using '$' unnecessarily.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-03-26 16:55:13 -07:00
William Douglas ee42901d83 Update output for bundle-list --orphans
Add informational line for how to cleanup orphan bundles to
bundle-list --orphans.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-03-12 11:39:23 -07:00
William Douglas 5e605943f5 Add new orphan tests for bundle deletes
When a bundle is removed, ensure the new orphans created are detected
by bundle-list and bundle-remove.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-03-12 11:39:23 -07:00
William Douglas 48cdc5e04c Enable bundle delete during non-format bump updates
Signed-off-by: William Douglas <william.douglas@intel.com>
2025-03-12 11:39:23 -07:00
William Douglas 42e38325fd Add CI fixes for github's updated Ubuntu container
Includes needed dev packages and an ignore for error messages seen on
Ubuntu's version of curl but not in Clear Linux.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-03-03 17:11:46 -08:00
William Douglas 243d7085a2 Release 6.0.0
- Add new --incremental option for update
- Fix version buffer length

Signed-off-by: William Douglas <william.douglas@intel.com>
v6.0.0
2024-11-18 10:20:48 -08:00
William Douglas 6df531ffc8 Add --incremental support for update
Allow users to update by stepping through each release between their
current version and the latest. This option is primarily for cases
where update is failing due to memory or disk space running out when
updating normally.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-11-18 10:18:06 -08:00
William Douglas e1f77e34bb Fix buffer size for inmemory version
When allocating the buffer for a version string, the size should be
one greater than the max string size as the null string is inserted at
the content size index which leads to a buffer overflow.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-11-18 10:18:06 -08:00
William Douglas abea281722 Update github actions
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-10-17 11:23:22 -07:00
William Douglas 0e3d6b2e25 Release 5.2.0
- Add support for a second signing certificate
- Test fixes

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.2.0
2024-08-29 12:00:54 -07:00
William Douglas e02cab570c Add support for an alternative swupd certificate
Enable an alternative swupd certificate location (the location of the
default or given cert with an ".alt" appended to it). The purpose of
this change is to allow more reliable and flexible key rotations.

If either the main cert or alt cert fails when doing content
verification then the other will be tried (and be used for the next
operation). In this way, as long as both certs don't fail for the same
content verification, progress can be made with either cert.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-08-29 11:58:59 -07:00
William Douglas 0d1591ff8f Update server.py ssl wrapping
The previous method for wrapping ssl was removed so update to the
replacement version.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-08-28 16:40:12 -07:00
William Douglas e0a4ed89c1 Add missing test teardown skips as needed 2024-08-28 16:40:12 -07:00
Brett T. Warden 2c45294461 Add sudo to commands to backup/restore Swupd_Root.pem 2024-08-28 15:22:35 -07:00
Brett T. Warden e170bfd3b1 Skip tests that require two builds in a format when there's only one
We already detect and report that certain tests require at least two
builds within the current format, but only one exists. Change that from
a test *failure* to a *skip*.

Example:
 We need at least 2 versions in format 38 to continue with this test
 Test teardown complete.
 not ok 2 RCT002: Repair a big system
 # (from function `test_setup' in file test/real_content/real_content_lib.bash, line 144,
 #  from function `setup' in test file test/real_content/../functional/testlib.bash, line 4647)
 #   `test_setup' failed
 #

becomes:
 ok 2 RCT002: Repair a big system # skip We need at least 2 versions in format 38 to continue with this test
2024-08-28 14:26:07 -07:00
Brett T. Warden 695417dca0 Protect the Swupd_Root.pem certificate file
This test creates an alternate swupd root certificate. If one already
exists, back it up, and restore it when the test is done. Previously,
this test just blindly deleted the certificate if it existed.
2024-08-27 12:02:07 -07:00
William Douglas 9da2dc6fc6 Release 5.1.1
- Testing fixups
- Update to use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
- Recursive delete handle user data gracefully
- Rework curl error checking

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.1.1
2024-08-27 10:46:58 -07:00
Brett T. Warden 6a43ac73aa Quell shellcheck error on sourcing file with variable path 2024-08-26 15:45:58 -07:00
Brett T. Warden 964ebcc12d Fix shellcheck for $lines 2024-08-26 14:08:36 -07:00
Brett T. Warden b1bbef06f9 Fixup bundle counting in real_content test library
Eliminate some uses of wc -l that don't help. Take advantage of lines
array to count bundles.
Separate STDERR messages from $output and ${lines[@]} that are used for
bundles.
2024-08-26 13:25:12 -07:00
Brett T. Warden 8742b3a168 Redirect URL override messages to STDERR
Previously, these messages were printed to STDOUT:
Overriding version and content URLs with...
Overriding content URL with...
Overriding version URL with...

But especially with --quiet, the output to STDOUT should be strictly the
requested data. So print these as warnings instead.
2024-08-26 13:25:12 -07:00
William Douglas 6e02330aa1 Add error handling for curl_easy_getinfo
Set response explicitly in case of curl_easy_getinfo error (though in
practice the response isn't modified and so program behavior is the
same as before this change).

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-08-13 14:25:09 -07:00
William Douglas 9fdf88c74b Test fixups and update for newer systemd
systemctl reports that the timer file is missing now as a return code
4 so update the unknown start number.

Also with this change SWUPD_NO is no longer always returned so add a
new helper to check if a status is one of multiple options.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-29 11:46:45 -07:00
Brett T. Warden abb3f2b4f1 Check for rst2man or rst2man.py 2024-07-26 13:52:55 -07:00
William Douglas 279f715759 Use curl CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
Previous use of CURLINFO_CONTENT_LENGTH_DOWNLOAD is deprecated so
switch to the updated CURLINFO_CONTENT_LENGTH_DOWNLOAD_T API.

This change does not propagate the curl type used to the rest of
swupd-client but instead tries to use reasonable type casts for their
given purpose.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-08 10:25:50 -07:00
William Douglas 5fe01a7211 Ignore a shell check issue
The specific issue isn't impactful since the file is already scanned.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-08 10:25:50 -07:00
William Douglas 99753d9beb Add helper file for language server interaction
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-08 10:25:50 -07:00
William Douglas 02d276564d Rework content deletion handling
Currently sys_rm_recursive was used in any instance of deleting swupd
content from the system (update, repair and bundle-remove). This can
cause user data loss when unkown files are in directories that swupd
is deleting.

To prevent this, this patch changes how deleting content in swupd
operates. Swupd content removal is now done with sys_rm and the return
value is checked in case the removal failed due to a directory that
still had files in it. When this specific failure occurs, the
directory is added to a new list for reprocessing removals as it is
expected once the rest of the deletes on the system occur the failures
will go away as the directories will be empty (these deletes are
processed in alphabetical reverse order so leaf directories are
processed first). If the removal fails again it is presumed the
contents of the directory are not files swupd knows about and as such
should be kept somewhere else.

For handling the retention of user data, directories (with only the
content unknown to swupd) are renamed (currently using a
.deleted.$timestamp. prefix of the old name) and stored at the same
directory level they were previously found with one exception. The
exception is for nested deleted content best illustrated with an
example:

/swupd-dir1/user-file1
/swupd-dir1/swupd-dir2/user-file2

When swupd tries to remove the /swupd-dir1 content, it will store the
user files as follows:

/.deleted.$timestamp1.swupd-dir1/user-file1
/.deleted.$timestamp1.swupd-dir1/.deleted.$timestamp1.swupd-dir2/user-file2

To demarcate what was part of swupd content vs user content.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-05 10:28:41 -07:00
William Douglas 2fd2f6c58f Cleanup unused code
The remove_files_in_manifest_from_fs function isn't used and was a
user of a rather dangerous recursive remove function. Get rid of it to
avoid potential confusion.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-05 10:28:41 -07:00
William Douglas bf538679f0 Reformat files with make format
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-04 13:51:32 -07:00
William Douglas ae19d9d561 Rework how curl errors are checked
In cases where curl perform returns an error but is actually a 400
level response, swupd needs to check curl info to see this. If the
info reveals a 400 level response, return the corresponding download
status error to prevent useless download retries.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-04 13:51:32 -07:00
William Douglas bee9d51f82 Release 5.1.0
- Add APX flag support
- Avoid printing optimization level error repeatedly

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.1.0
2024-01-22 07:28:27 -08:00
William Douglas 3d8634edda Avoid printing optimization level error repeatedly
The error message about skipping unsupported file optimization levels
only needs to be printed once so do that instead of potentially
spamming it.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-22 06:50:40 -08:00
William Douglas 5ebfce069e Update pemfile
Generated with:
openssl req -x509 -newkey rsa:4096 -out pemfile -sha256 -days 3650 \
-nodes -subj "/CN=localhost"

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-22 06:50:40 -08:00
William Douglas 0d2d11d0fc Add APX flag support
Add support for new APX optimization level. Change increases the
maximim potential optimization level but does not yet allow the files
to be used (installed). get_opt_level_mask still needs to be updated
to account for system supporting the new optimization level (and
adding APX_SKIP_FILE support) before the APX files can be installed.

This change is being done at this time to allow mixer to create these
files without swupd error messages during updates.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-22 06:50:40 -08:00
William Douglas ec4a272115 Release 5.0.5
- Fix test errors configuring the system mask

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.0.5
2023-04-26 10:21:25 -07:00
William Douglas cdcd279371 Fix test errors configuring the system mask
Also make a mask check more consistent with the rest of the code.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-26 10:16:36 -07:00
William Douglas 6bafae49b4 Release 5.0.4
- Enable use of optimized manifest files beyond SSE

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.0.4
2023-04-25 14:49:51 -07:00
William Douglas e01b473251 Switch to clang-format as a github action
Instead of having this be a local test, have a format target for the
Makefile and use a github action for clang-format to avoid differences
between developer systems clang-format and runner clang-format
versions.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-25 14:44:10 -07:00
William Douglas 19a6b3a443 make compliant fixups
Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-25 14:44:10 -07:00
William Douglas ce82b5da51 Enable use of optimized manifest files beyond SSE
Allow the usage of non-SSE files from manifests. This involves testing
what the currently running system supports for optimized content and
installing the best matching available binary the manifest provides.

There is an exception for operations where the prefix is set to
something other than the rootfs where SSE binaries will be used in all
cases.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-25 14:44:10 -07:00
William Douglas 5ffe2282ac Update release process
Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-25 14:44:10 -07:00
William Douglas ad4ee1fe77 Release 5.0.3
- Fix issues with print format strings
- Update handling of optimized binary files

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.0.3
2023-04-11 12:39:28 -07:00