Commit Graph
1976 Commits
Author SHA1 Message Date
Castulo Martinez a7ed2cbce0 Bug_fix: In closing steps in multi-repo ops
Multi-repo operations can run in one or multiple repos, so that needs to
be taken in consideration when opening and closing progress steps.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-22 10:46:59 -07:00
Castulo Martinez 6be7cb857d 3rd-party: do not report telemetry on 3rd-party
Telemetry is used to report problems to main repository, so it doesn't
make sense to create telemetry report files for 3rd-party repositories.

Closes #1358

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-22 10:12:12 -07:00
Castulo Martinez 1a13a29e14 Updating list to run clr-boot-manager
This commit adds the following files to trigger the execution of
clr-boot-manager:
- /usr/bin/clr-boot-manager
- /usr/share/syslinux/ldlinux.c32

Closes #1415

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-22 09:37:59 -07:00
Otavio Pontes 9d967e2482 scripts: Use --enable-debug to run swupd tests
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-21 14:20:40 -07:00
Otavio Pontes b7d9de6ae5 tests: Adding more attribute changes to test
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-21 11:33:41 -07:00
Castulo Martinez 1e3cb68979 API: output for mirror
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd mirror

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-20 10:52:14 -07:00
Castulo Martinez dbe702ca03 API: output for 3rd-party add, remove, list
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd 3rd-party add
- swupd 3rd-party remove
- swupd 3rd-party list

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-20 09:51:22 -07:00
Otavio Pontes 71ef82cc1a telemetry: Report a critical telemetry error when any unexpected condition happens
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-20 09:33:51 -07:00
Otavio Pontes 05cc86b6a7 telemetry: Don't create telemetry reports if swupd was built for debug only
On testing environments we produce a lot of false errors that would polute the
telemetry data with false information. Disabling that when debug mode is on.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-20 09:33:51 -07:00
Otavio Pontes 10177bc124 telemetry: Updating the severity of multiple telemetry records
- On bundle-add send CRIT on errors, MED on missing bundles and LOW
   on success
 - update,verify: LOW on success and CRIT on errors.
 - packmissing: LOW when a delta pack is missing and CRIT if a zero pack is missing

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-20 09:33:51 -07:00
Otavio Pontes 02bd0a8da7 telemetry: Update telemetry severity
The severity of telemetry records were not corresponding to what's processed
on telemetry service.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-20 09:33:51 -07:00
Otavio Pontes b476183e2c telemetry: Create a header for telemetry module
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-20 09:33:51 -07:00
Otavio Pontes 57df33b46d search_file: Don't store boolean just to be used in an if clause
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-20 09:12:18 -07:00
Otavio Pontes 64d8222e4e test: Rebalance weights
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 18:44:18 -07:00
Castulo Martinez a59cbbd6a5 swupd --quiet documentation update.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 16:36:06 -07:00
Otavio Pontes 4a711d2821 test: Add test to install files with unusual characters
Make sure files with unsual characters are successfully installed. Most
characters used in test are filtered by mixer, but there's no reason to
not support them in swupd

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 15:20:10 -07:00
Otavio Pontes 27150cabaa sys: Use vfork() instead of fork() to run external commands
Instead of creating another thread and copying the memory space from
the main program, vfork() block the main code and reuse the memory space
in child. This was created to be more performant in cases where execve is
called after forking, what's exactly our case.

Changes on variables on child are going to reflect on parent, so this should be
avoided. Writing and reading from file descriptors works exactly like fork so
we can keep using that.

This change makes a huge performance improvement on commands that are
executed multiple times.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 15:20:10 -07:00
Otavio Pontes 3f189f9278 target_root: Copy a file instead of tar|tar
When we want to install a single file we can copy it instead of using
the tar tar dance.

tar_tar is still left as a fallback if copy fails

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 15:20:10 -07:00
Otavio Pontes 5e776f8df6 target_root: Don't use tar to install directories
Instead of using a tar | tar command to install directories, we can create
the folder and apply needed properties. The tar|tar command is still left
as a fallback in the case the install dir fails.
2020-04-17 15:20:10 -07:00
Otavio Pontes 15ab72fe51 target_root: Use a const for the stage file prefix
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 15:20:10 -07:00
Otavio Pontes 01ec2a2d2c target_root: Reorganizing the stage file code
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 15:20:10 -07:00
Otavio Pontes 0f35bdaada macros: Improve loging on macro UNEXPECTED
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 15:20:10 -07:00
Otavio Pontes 84432107d4 target_root: Function should be static
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 15:20:10 -07:00
Castulo Martinez 5b2773455f API: output for hashdump
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd hashdump

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 12:21:40 -07:00
Castulo Martinez 5b69e4585c API: output for [3rd-party] clean
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd clean
- swupd 3rd-party clean

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 11:43:32 -07:00
Castulo Martinez 194d54544e API: output for os-install
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd os-install

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 10:39:26 -07:00
Castulo Martinez 4f852953d0 API: output for [3rd-party] repair
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd repair
- swupd 3rd-party repair

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 10:37:26 -07:00
Otavio Pontes 12f3d9c145 Release 4.0.0
Swupd 4.0.0 consolidate major changes introduced on previous releases and
the replacement of mixin functionality with swupd 3rd-party. Besides that
adds more enhancements and bug fixes.

Enhencements:
 - Removal of mixin support on swupd
 - Improvement of output of some swupd commands when using --quiet
 - Regenerate swupd 3rd-party binary wrapper when template is updated
 - More clear output on swupd bundle-list with --status flag

Bug fixes:
 - Fix incorrect progress report when diagnosing with --extra-files flag
 - 3rd-party was exporting variable XDG_CONFIG_DIRS with incorrect name

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
v4.0.0
2020-04-17 08:25:42 -07:00
Otavio Pontes 524c3c4e06 Merge branch '3.24' 2020-04-17 08:25:21 -07:00
Otavio Pontes c5435de83f test: Add test to check if file attrs are preserved on updates
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-16 13:52:29 -07:00
Otavio Pontes 669dfe09cf test: Preserve attributes on copy
When creating the fullfile and installing the bundle in targetfs we
need to preserve the owner and mode of file

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-16 13:52:29 -07:00
Otavio Pontes 9edb70023c 3rd-party: xdg env variable has a wrong name
XDG_CONFIG_DIRS variable was added with an incorrect name. XDG_CONF_DIRS was used instead.
Fixing that.

Fix #1443

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-16 13:25:04 -07:00
Castulo Martinez 056137fd4a Fixing progress type on diagnosing extra files
When dealing with extra files during a "verify" action, we cannot really
tell how far in the process we are, so we should be defining that step
as PROGRESS_UNDEFINED. Since we are using a PROGRESS_BAR, it is causing
to show an extra "[100%]" at the end of the diagnose process.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-16 12:54:45 -07:00
Otavio Pontes 77642ec291 verify: Move specific function to correct module
Function is specific and only used on verify, so moving it there

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-16 08:52:03 -07:00
Otavio Pontes b174fb85f3 repair: Use newer function to remove duplicated '/'
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-16 08:52:03 -07:00
Otavio Pontes 9c356f9406 sys: Move some functions from helpers to sys
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-16 08:52:03 -07:00
Castulo Martinez 53878d8317 API: output for [3rd-party] diagnose
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd diagnose
- swupd 3rd-party diagnose

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-15 16:15:28 -07:00
Castulo Martinez bc58b8bb48 API: output for search-file
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd search-file

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-15 15:35:00 -07:00
Castulo Martinez 532d5743ca API: output for [3rd-party] bundle-info
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd bundle-info
- swupd 3rd-party bundle-info

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-15 08:47:57 -07:00
Castulo Martinez b686c07719 API: output for [3rd-party] bundle-list
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd bundle-list
- swupd 3rd-party bundle-list

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-14 08:55:59 -07:00
Castulo Martinez 7c5c6417d0 Testlib: fix bug regenerating hashes in MoM
When a MoM contains an experimental bundle and the hashes in the MoM are
regenerated, the experimental bundles are being skipped. This commit
fixes that issue.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-13 15:29:46 -07:00
Otavio Pontes 10083e988d target_root: Using UNEXPECTED() to find development problems
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-13 11:18:31 -07:00
Otavio Pontes c019e11cc0 Create the UNEXPECTED() macro
There are several points in swupd that we find conditions that should never
happen, but we try to correct them anyway to be more reliable. Because of that
we may hide programming mistakes that are corrected later.

So, to make sure we are going to catch those problems in debug mode in our development
machines and test environment, I am suggesting a UNEXPECTED() macro that aborts swupd
if --enable-debug was used to build swupd.

I am adding some examples on what we could do with that.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-13 11:18:31 -07:00
Castulo Martinez e77c270ad8 Show status for all bundles with --status
When listing bundles using "swupd bundle-list --status" we were
distinguishing bundles that were explicitly installed, by marking them
as such and since bundle-list shows only bundles tha are installed, bundles
that were not marked as explicitelly installed were assumed to be
just installed.

When we use "bundle-list --all --status" (which shows installed and
uninstalled bundles), we were marking files as "installed", "explicitly
installed" and bundles without any of these distinctions were assumed to
be not installed. This could cause confusion.

This PR changes the "bundle-list --status" so we always label bundles
as either "implicitly installed" or "installed" (even though it couls
sound a little redundant) so it is consistent with the way they are
labeled during "bundle-list --all --status".

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-13 10:17:24 -07:00
Castulo Martinez 14ba906dd1 Testlib: including os-core in test bundles
When creating test bundles, we are not including os-core in them by
default. This is how it works in production so we should do it so it
resembles the real production environment more accurately.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-13 10:16:17 -07:00
Castulo Martinez faf2d994fb API: output for [3rd-party] bundle-add
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd bundle-add
- swupd 3rd-party bundle-add

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-10 16:44:34 -07:00
Castulo Martinez addd14013b Testlib: fix help menu from function
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-10 16:01:11 -07:00
Castulo Martinez 2fb27c3b5f API: output for [3rd-party] bundle-remove
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd bundle-remove
- swupd 3rd-party bundle-remove

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-10 15:21:59 -07:00
Otavio Pontes 3eebe4fd64 real_content: Use --quiet to get the list of bundles 2020-04-10 13:54:52 -07:00
Castulo Martinez d677c42fce 3rd-party: Regenerate wrapper on template change
When the template used for creating the wrapper scripts changes, all
exported binaries should have the scripts regenerated during updates
regardless of if the binary changed.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-10 11:08:16 -07:00