We were only support version from the YAML file, now support
setting directly on the command line for swupd.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
This function has not been used for a long time and can
be misleading when making updates. Dropping.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Fixes: #559
Allow the format to be set in the configuration YAML file
as well as on the command line.
Useful for mixes.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
The gometalinter project has been deprecated and the golangci-lint
project has been selected as its replacement.
Previously failing errors for the gocyclo linter are skipped, but they
should be fixed eventually.
Fixes: #527
Signed-off-by: John Akre <john.w.akre@intel.com>
Allow setting the version url and content url to the same value
with a single argument of --swupd-url.
Useful for mixer
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
swupd had depreciated 'verify --fix' with 'os-install' a while ago.
Though we change the command, the method name was unchanged. Now
refactored the name and also just pass the entire model at creation
for future changes instead of just a few member datum.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
When using advanced disk partitioning with an invalid setup and loading
the menu page or disk configuration page for the first time, the warning
messages were not set correctly. The warnings were incorrectly set
because the TargetMedias variable was unexpectedly overwritten to nil.
This change prevents unexpected overwrites of TargetMedias and sets
TargetMedias when it is uninitialized.
Fixes: #553
Signed-off-by: John Akre <john.w.akre@intel.com>
When --allow-insecure-http is not set and the IsValidURI function
recieves an HTTP URI, a warning will be displayed.
Signed-off-by: John Akre <john.w.akre@intel.com>
When passing a config file URL to the --config flag, the installer will
download and consume the config. For example:
clr-installer --config https://pathToConfig.yamlFixes: #524
Signed-off-by: John Akre <john.w.akre@intel.com>
The IsValidMirror function was moved to the network package and renamed
to IsValidURI because it can be used for more than swupd mirror validation.
The IsValidURI function is used to check for supported URI protocols.
Signed-off-by: John Akre <john.w.akre@intel.com>
When installing from offline content, the taget version must match the
offline content version so that the offline content remains valid. Now a
log message will be written to document the version override.
Signed-off-by: John Akre <john.w.akre@intel.com>
When the version field in the config file is set to 0, the latest
version will be installed instead of the host's version.
Fixes: #502
Signed-off-by: John Akre <john.w.akre@intel.com>
This ensures that user is able to proceed through installer
with low resolutions.
This commit also removes hardcoded placement of 'change language'
button (See removed TODO).
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
This is done to ensure that installer can be run on virtual
machines that have a small default screen size.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
When target bundles are added to the configuration file
we generate an override YAML file for the installer. This needs
to default to autoUpdate: true for interactive installs.
This fixes a bug which was introduced when we switched to having
the installer generate the override YAML file instead of creating
it with a post-installation hook in conjunction with offline
installation support.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Fixes: #478
Add new --allow-insecure-http flag to support the use of HTTP URLs.
This is needed to allow swupd to download content from http sites;
generally development mixes.
Also enable the use of the setting in both the TUI and GUI to allow
the user to set a swupd mirror which is HTTP.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Previously, the main function used panics to exit with a non-zero exit
code and to execute deferred functions (os.Exit() does not execute
deferred functions). To remove the need for panics the main function was
refactored so that it is only responsible for calling the execute function,
logging failures, and returning the exit status.
Fixes: #547
Signed-off-by: John Akre <john.w.akre@intel.com>
The err variable was incorrectly used to determine when the
encrypt.Crypt function failed. It should use the errHash variable
instead.
Signed-off-by: John Akre <john.w.akre@intel.com>
When sorting partitions, the partition numbers must be separated from
the partition name and be compared as integers. Comparing the partition
numbers in ascii leads to undesirable sorting results when using numbers
with multiple digits.
Fixes: #510
Signed-off-by: John Akre <john.w.akre@intel.com>
The gotk3 package contains deprecated functions that emit a large amount
of warnings during builds. Appending the -Wno-deprecated-declarations
flag to CGO_CFLAGS suppresses these warnings.
The -Wno-deprecated-declarations option can be removed once
gotk3/gotk3#420 is fixed.
Fixes: #539
Signed-off-by: John Akre <john.w.akre@intel.com>
The `go build -race` command creates an executable with support for race
condition detection, but does not provide any static analysis. This
change adds race condition detection support to the coverage Makefile
target.
Signed-off-by: John Akre <john.w.akre@intel.com>
The saveMedias variable is responsible for selecting between loading the
page or resetting page state on cancel button clicks. When clicking the
confirm button, saveMedias must be set to nil to prevent flipping the
logic for loading the page and cancel button clicks. This logic
inversion led to incorrect menu descriptions for the disk config page.
Signed-off-by: John Akre <john.w.akre@intel.com>
Fixes: #533
Change from partition label to partition name to be consistent
with how the data is named in the external tools.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Ensure that we default to the previously selected disk
when re-entering the media selection screen.
Fixes: #515
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
The VerifyWithBundles function is used to install contents into the
target, download offline contents, and to create the initrd for the ISO.
Now, a prefix string will be added to the output of these commands to
specify which step VerifyWithBundles is running.
Signed-off-by: John Akre <john.w.akre@intel.com>
The indeterminate progress bar does not behave as expected when pulsing
twice consecutively. In this case, the progress bar moves very, very
slowly. When the progress bar pulses once, it smoothly moves back and
forth across the screen.
Signed-off-by: John Akre <john.w.akre@intel.com>
This commit adds an installation step to copy offline update contents to
the install target media. When installing from an ISO image, unsquashfs
is used to decompress offline content directly to the target which is
faster than a file copy.
Signed-off-by: John Akre <john.w.akre@intel.com>
The Offline and OfflineSet fields were added to args, but test coverage
only exists for Offline. Typically fields like OfflineSet are untested,
so reducing the coverage.
Signed-off-by: John Akre <john.w.akre@intel.com>
Network checks are no longer a hard requirement with offline install
support, so the precheck page should not prevent users from advancing.
This change creates a fatal pop-up window for system check failures and
removes the precheck page. Network checks will be performed as needed.
Signed-off-by: John Akre <john.w.akre@intel.com>
When a network connection is required to complete an install, but the
installer's network state is not passing, a network check will be
performed. If the network check fails, additional bundles were selected,
and offline installs are supported, the user will be prompted to remove
the additional bundles so that they can continue the install.
Signed-off-by: John Akre <john.w.akre@intel.com>
The bundle page will peform a network check when the network state is
not passing. Users will be unable to select additional bundles when the
network check fails.
Signed-off-by: John Akre <john.w.akre@intel.com>
A network check page was added to the menu. Similarly to the TUI, the
network check page will launch a pop-up window and perform a network
check.
Signed-off-by: John Akre <john.w.akre@intel.com>
A network check will be performed when a network connection is required
to install, but hte installer's network state is not passing. If the
network check fails, additional bundles were selected, and offline
installs are supported, the user will be prompted to remove the
additional bundles so that they can continue the install.
Signed-off-by: John Akre <john.w.akre@intel.com>
When the network state is not passing, the bundle page will perform a
network check. Users will be unable to select additional bundles when
the network check fails.
Signed-off-by: John Akre <john.w.akre@intel.com>