The --statedir-cache flag specifies a secondary statedir that will be
checked before downloading files over the network.
The primary reason to use the statedir-cache is to enable the os-install
command to take advantage of hardlinks when installing content across
partitions. In this case, update content stored in the statedir-cache
(source partition) will be copied to the statedir (target partition) before
installing content into the target partition. Since the update content
will exist on the target partition before installation, hardlinks can be
used instead of copies.
Signed-off-by: John Akre <john.w.akre@intel.com>
If --update-search-file-index flag is used on update, all search-file indexes, i.e.
all Manifests will be downloaded on update. This shouldn't be used if you have
disk or network restrictions, but it shouldn't be very download intensive after the
first usage because delta manifests are going to be used.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When the --download flag is set for the os-install command, update
content will be downloaded to the statedir and no content will be
installed.
Signed-off-by: John Akre <john.w.akre@intel.com>
The -B/--bundle option is confusing and causing users to wipe out their
systems. This option was really just meant for os-install, so this
commit removes it from "swupd diagnose"
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The -B/--bundle option is confusing and causing users to wipe out their
systems. This option was really just meant for os-install, so this
commit removes it from "swupd repair".
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Since --picky was made a superset of diagnose/repair, there is the need
of a new flag that only finds/repairs the extra files that are not in
any manifest.
Many things were included in this commit:
- This commit adds the new flag --extra-files-only for this purpose.
- The commit also refactors the verify function to simplify its workflow
and remove code duplication
- It also adds some validations for flags that are mutually exclusive in
verify/diagnose/repair
- Updates the documentation
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Running "swupd diagnose --picky" result in only identifying the extra
files in the system, but doesn't run the other standard checks that a
"swupd diagnose" do. "swupd diagnose --picky" should do everything
"swupd diagnose" does plus searching for the extra files.
This commit fixes the issue by making diagnose --picky a superset of
diagnose. The commit also makes some changes in the output of --picky so
it is consistent with the rest of the diagnose output.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When running tasks that require to run post update scripts in swupd,
for most users we don't want to wait for the scripts to finish running,
those can be run in the background so we can finish the task faster.
However for some users like DevOps, clr-installer, and QA, it is useful
to have a way to instruct swupd to wait until these scripts have finish
running.
This commit adds a way of doing this by introducing the
--wait-for-scripts flag.
Closes#909
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Some swupd flags from subcommands clash with some global flags.
This commit fixes the issue by renaming the duplicated flags in the
subcommands.
Closes#946Closes#950
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit renames the "verify" command to "diagnose" to make it
more straightforward for the user to understand the purpose of the
command.
Closes#918
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The purpose of "swupd verify --fix" is to repair local issues relative
to a server manifest. However the verify command currently has many
flags, and some flags are mutually exclusive, this makes the command
very confusing to use for users.
This commit makes "swupd verify --fix" the top level command
"swupd repair". This new command still uses the verify code under the
covers.
Closes#914
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The purpose of swupd verify --install is so it can be used to install
a new Clear OS in a target system. However since currently it is part
of the swupd verify command it makes it confusing as of to what its
purpose is.
This commit moves the swupd verify --install option to be a top level
command (swupd os-install) so its purpose is more straightforward. The
new command still uses the verify code to perform the task underneath.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Documentation coverage on src/lib is now 100% and the goal is to eventually
reach that for everything on src/.
Also improve some documention on headers.
--scope=b output is the same as -T 1. And if we have a real use case for
--scope=o we can create another parameter just for it.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When using verify to check if the system is sane we should return a
non zero exit code if the system is invalid. And when repairing
(fix or install) we need to use a non zero exit code if some files
are still incorrect after verify has finished.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Signature verification was disabled as a default parameters to make it easier
for people to build the project on other distros. But this can be dangerous
as users may start using a built swupd without signature checking to
install a CL distro.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Use a binary launcher to load swupd-inspector and execute that
when swupd inspector is run.
Closes#826
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
--force/-x is specific for verify command, but documentation was stating
that it was global. Removing all references from a global --force and
adding that information to the help page of verify command.
Also moves the force variable from global to verify.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Those files are generate that in build time, so there's no reason to keep
them here.
We went out of sync before and it's easier to make sure the last man page is
used if we generate that on build time.
Also removes man page tests because they don't make sense anymore. And add
option --disable-manpage, so we can build swupd without manpages if rst2man.py
isn't available.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit reorganize the codes in the swupd_code enum so the codes
that were already defined before are still the same. This commit also
renames some of those codes so they are more consistent with the rest of
the codes in the enum.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The guide in how_to_contribute.md specify a set og rules to follow to be
a contributor of the swupd client project.
This commit adds the guidelines for using return/exit codes in functions
within the swupd source code.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Regardless of what codes are used internally, swupd should always
exit with a code defined in swupd_exit_codes.h.
This commit makes those changes for verify.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Regardless of what codes are used internally, swupd should always
exit with a code defined in swupd_exit_codes.h.
This commit makes those changes for update.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Regardless of what codes are used internally, swupd should always
exit with a code defined in swupd_exit_codes.h.
This commit makes those changes for mirror.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Regardless of what codes are used internally, swupd should always
exit with a code defined in swupd_exit_codes.h.
This commit makes those changes for clean.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Regardless of what codes are used internally, swupd should always
exit with a code defined in swupd_exit_codes.h.
This commit makes those changes for hashdump.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Regardless of what codes are used internally, swupd should always
exit with a code defined in swupd_exit_codes.h.
This commit makes those changes for bundle-list.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Regardless of what codes are used internally, swupd should always
exit with a code defined in swupd_exit_codes.h.
This commit makes those changes for autoupdate.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Some functions currently mask error codes by using a very general error
like SWUPD_COULDNT_INSTALL_BUNDLE (formerly EBUNDLE_INSTALL) in the case of
the bundle-add command.
This commit modifies the codes returned by the bundle-add in case of
failures so they are more meaningful for the actual issue.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Some functions currently mask error codes by using a very general error
like SWUPD_COULDNT_REMOVE_BUNDLE (formerly EBUNDLE_REMOVE) in the case of
the bundle-remove command.
This commit modifies the codes returned by the bundle-remove in case of
failures so they are more meaningful for the actual issue.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Allow users to verify only a given subset of bundles rather than the
entire system. This also enables an alternative "installation" with a
verify --fix --bundles $foo where foo doesn't include os-core which is
useful for installing 3rd party content that lives outside of /usr.
We have defined that we are committing to the repository the rst files,
so I'm adding the alias rst file
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Add a new alias filetype that swupd understands. This file's format is
the following:
A potentially multiline file with an alias name per line followed by,
ont he same line, a list of bundle names with all fields being tab
separated.
If the same alias is defined in the same file, the first definition
will be used. Malformed lines will not be parsed but it is valid to
have multiple concurrent tabs in a line.
The files are to be read from both user and system alias directories
with stateless overrides of system files with user files. This implies
you can mask a system file with a user file of the same name if the
user file is a symlink to /dev/null. You can also override a system
file with a user file of the same name but with different content (the
contents of the system file will be unused). Alias files are
considered in lexicographical order sorted the same as bundle-list. If
two files provide the same alias than the one in the file that comes
first lexicographically will be used. User files will always come
before system files, such that if a user file 'u' defines alias 'a'
and a system file 's' also defines alias 'a' the user file definition
will be used instead of the system file definition.
The intended usage of this will be for OS content to provide alias
files that will then enable users to add content using the provided
aliases as well as enabling users to define their own alias for custom
package groups.
Eventually this feature may be considered for extension to other areas
aside from bundle-add but for now only bundle-add usage is to be
supported.
Linux programs return code should be a number between 0 and 255, so 404 is an
invalid return code. Removing it from docs and from swupd-error.h file.
As it wasn't being used, this won't be a problem.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
max-parallel-pack-downloads was renamed to max-parallel-downloads
and documentation needs to be fixed
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
After running an update, the state directory is cleaned up.
Sometimes it is useful to be able to peek at the state directory
after an update, this is specially true when testing updates,
this way tests can verify what manifests were downloaded during
the update.
This commit adds the --keepcache option to swupd update so it can
be used when writing tests for updates.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>