2093 Commits
Author SHA1 Message Date
Castulo Martinez b4cc6e6ae3 Release 4.2.1
Enhancements
 - Reorganizes the location of cached manifests in the statedir

Bug fixes
 - Makes the swupd autocompletion script POSIX compliant
 - Fixes a syntax error in the configure.ac script

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
v4.2.1
2020-05-21 09:07:46 -07:00
Patrick McCarty 1330204558 Fix syntax error in configure.ac
The `configure` script generated from configure.ac tries to run a `]`
command, but that command doesn't exist.

The root cause is a syntax issue configure.ac: there is a stray `]` on
one of the lines.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-05-19 15:30:09 -07:00
Otavio Pontes 5bb4ef2337 swupd.bash: Make swupd.bash POSIX compliant
Bash autocomplete scripts should be POSIX compliant, so fixing that and
adding a test to validate this.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-19 13:47:49 -07:00
Otavio Pontes 721aae6358 clean: Clean manifests in deprecated location
Manifest directory has moved and we need to clean manifests in previous location.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-19 13:47:37 -07:00
Castulo Martinez 9d995c1ad5 Move manifest deltas to the manifest dir in state
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-15 11:47:33 -07:00
Castulo Martinez 8e4c017365 Moving downloaded manifests to their own directory
When swupd downloads manifests to the statedir they are downloaded in
directories that represent the version of clear that the manifests
belong to. However those version directories are stored in the statedir,
root directory. This commit moves them into their own "manifest"
directory so there is more consistency with the downloaded files.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-15 11:47:33 -07:00
Otavio Pontes 926773041f Release 4.2.0
Enhancements
 - Bundle-list now offers an option to list all bundles that are not required
   by any explicitly installed bundle in the system (--orphans)
 - Flag --orphans added to bundle-remove to remove all bundles that are not explicitly installed in the system
 - Consolidating file heuristics to remove duplication, leading to an improvement in performance
 - Bash autocomplete auto generate options so it will always match the current installed swupd
 - Complete support to unusual characters on filenames and directories
 - Better debug output when delta files failed to apply and curl download errors

Bug fixes
 - Config file loader was not loading config file in /etc properly
 - Fixed unsigned to signed integer conversion errors
 - Invalid warning was printed on 3rd-party update when there were no 3rd-party repositories

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
v4.2.0
2020-05-15 10:20:05 -07:00
Otavio Pontes c83391321c Revert "Move manifest deltas to the manifest dir in state"
This reverts commit 845b74f95b.
2020-05-15 08:18:45 -07:00
Otavio Pontes d5d3c599d2 Revert "Moving downloaded manifests to their own directory"
This reverts commit 336fee7a9d.
2020-05-15 08:18:37 -07:00
Otavio Pontes 24ecf6c913 delta: Improve message on delta errors
Print a more useful error when we fail to locate a file to apply a
delta. Add a suggestion for the user to run `swupd repair` and make
it clear that the problem is in their system and not in the update
content.

Fixes #1425

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-14 13:41:59 -07:00
Castulo Martinez 845b74f95b Move manifest deltas to the manifest dir in state
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-14 11:03:51 -07:00
Castulo Martinez 336fee7a9d Moving downloaded manifests to their own directory
When swupd downloads manifests to the statedir they are downloaded in
directories that represent the version of clear that the manifests
belong to. However those version directories are stored in the statedir,
root directory. This commit moves them into their own "manifest"
directory so there is more consistency with the downloaded files.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-14 11:03:51 -07:00
Castulo Martinez e473385084 Bug_Fix: Only update templates if repos exist
Closes #1566

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-14 10:49:45 -07:00
Otavio Pontes 5ff46653cf actions: Create another job to check for API changes
Create another github job to check if the API has been changed in this
PR, so it will be easier to notice that a broken test is just an API
broken test

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-14 10:45:46 -07:00
Otavio Pontes 062cab09cf curl: Remove '*' character in error output
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-14 09:26:12 -07:00
Castulo Martinez 9958f9c4ce Moving some remaining functions to statedir.c
Some of these references to statedir where left in the code, this commit
moves them to the statedir.c module so references to content of the
statedir are not hardcoded. Files in the statedir can move to different
locations freely this way.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-14 08:27:24 -07:00
Otavio Pontes 7263b2d774 verify: Don't apply heuristic to os-install
Don't run heuristics for os-install or repair --quick.
On os-install we want all files to be always installed. On repair --quick
we don't process any do_not_update files

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-13 08:24:37 -07:00
Castulo Martinez 66d002d0ce Repairig amemory leak in delta.c
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-13 08:24:24 -07:00
Otavio Pontes 260fed75d5 thread_pool: Number of threads can be zero
Actually thread_pool supports zero threads, that means exactly running in
serial. So rolling back to what it was before the integer conversion fix of
commit 2a7f181e00.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-13 08:24:06 -07:00
Castulo Martinez e552a95645 Add function to remove the content of a directory
Instead of having a function to remove the contents of a specific
directory in the statedir this commit creates a generic function to
remove the contents of a directory without removing the directory
itself.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 14:21:11 -07:00
Castulo Martinez cf263bbd07 Move function to set the path to the statedir
Moving the function to the appropriate statedir module.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 14:21:11 -07:00
Castulo Martinez 62bb6bd8a0 Function to get the version from statedir
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 14:21:11 -07:00
Castulo Martinez 8ba1812c6f Function to get the delta pack from statedir
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 14:21:11 -07:00
Castulo Martinez 251c2cb68f Functions to get the manifests directory and delta
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 14:21:11 -07:00
Castulo Martinez 74ec454110 Function to get the path to the swupd_lock file
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 14:21:11 -07:00
Castulo Martinez a3a1ad1d3d Function to get telemetry record from statedir
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 14:21:11 -07:00
Otavio Pontes a993c1a3fc Enforce warning to check for integer conversion errors
Converting from different int types are not always correct, so turning the
gcc warning that check for conversions that might change the value or sign of
the number.
2020-05-12 12:27:06 -07:00
Otavio Pontes 043351ab09 Fix integer to float conversion errors
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:27:06 -07:00
Otavio Pontes e1fd274599 Fixing multiple unsigned to signed int conversion errors
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:27:06 -07:00
Otavio Pontes 235ea872a8 strings: Use correct variable type for str_len return
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:27:06 -07:00
Otavio Pontes 2a7f181e00 int: Fix some integer conversion errors when using malloc
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:27:06 -07:00
Otavio Pontes 9fd1632ef0 int: Add functions to safely convert signed ints to unsigned
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:27:06 -07:00
Otavio Pontes 5f67a46354 string: Add function to convert from string to unsigned ints
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:27:06 -07:00
Otavio Pontes fb43852440 motd: Remove motd code that was not being used
check-update was trying to create a motd in a deprecated directory and
it was always failing.

Removing code for now.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:26:16 -07:00
Otavio Pontes 07fb739c10 test: Add test to make sure we won't forget '\n' on log messages
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:26:09 -07:00
Otavio Pontes 7f5c1b6ab3 log: Adding missing '\n' at the end of log messages
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-12 12:26:09 -07:00
Castulo Martinez 14bbc2c44d Add functions to get manifest from the statedir
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 10:15:51 -07:00
Castulo Martinez eee1585f64 Add functions to get fullfile tars from statedir
This commit adds these function:
- statedir_get_delta_dir: to get the "download" directory
- tatedir_get_fullfile_tar: to get thet downloaded fullfile tar
- statedir_get_fullfile_renamed_tar: to get the renamed fullfile during
  untarring

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 10:15:51 -07:00
Castulo Martinez 9844f2a1d0 Add function to get delta dir from statedir
This commit adds the following function:
- statedir_get_delta_dir()

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 10:15:51 -07:00
Castulo Martinez 858965f52e Move function to create state dirs to statedir mod
This commit moves the function to create the state directories to the
statedir module.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 09:05:26 -07:00
Castulo Martinez 39bfd77831 Add function to get staging files from statedir
This commit adds the following functions:
- statedir_get_staged_dir()
- statedir_get_staged_file()

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 09:05:26 -07:00
Castulo Martinez ca2601efc7 Consolidate functions to track bundles
Currently we have two functions to track bundles, bundles should always
be tracked in the same location, if there is an exception to this rule
then it should be handled separately.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 09:05:26 -07:00
Castulo Martinez 7e921eca64 Tracking dir functions in statedir.c
This commit adds the statedir.c module and moves the function to get the
tracking directory to this module. It also adds a new function to get
the path to a tracking file into the module.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-12 09:05:26 -07:00
Otavio Pontes 49131e7059 heuristics: Remove duplicated heuristics check
We check for is_config() and is_state() twice in heuristic check. Removing
the duplication

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-08 13:34:53 -07:00
Otavio Pontes 6613fc5ffa heuristics: Add test to validate heuristics
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-08 13:34:53 -07:00
Otavio Pontes d237e4d499 heuristics: don't set is_boot for files that are not kernel files
Bootloader updates should trigger a call to boot manager, but they shouldn't be
treated like boot files.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-08 13:34:53 -07:00
Otavio Pontes 3bb6c8a9de heuristics: Consolidate main heuristics with the ignore heuristics
Ignore call was confusing and value was ignored for the main usages.
It should always run with the main heuristic functions.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-08 13:34:53 -07:00
Otavio Pontes 46400708e6 heuristics: Consolidate need_update_boot and need_update_bootloader
Both variables were used to call the boot manager, so renaming them to
neew_update_bootmanager

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-08 13:34:53 -07:00
Castulo Martinez bca38243d8 3rd-party: add bundle-remove --orphans flag
Implementing the --orphans option to remove bundles no longer required
by tracked bundles from 3rd-party repositories.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-08 09:30:50 -07:00
Castulo Martinez 4d0a6d29a1 Implement bundle-remove --orphans flag
This commit implements the --orphan flag for bundle-remove which can be
used to remove bundles that are no longer required by tracked bundles.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-08 09:30:50 -07:00