557 Commits
Author SHA1 Message Date
Mark D Horn a3ac0ad7a4 args: Allow setting version on command line
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>
2.3.1
2019-10-08 16:45:11 -07:00
Mark D Horn 2187466463 main: fix spelling error in strings
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-10-08 16:45:11 -07:00
Mark D Horn a0f1805ef3 tui: Fix Title Case
This is the only menu options not in Title Case.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-10-08 16:27:25 -07:00
Mark D Horn 372ed41da7 swupd: Clean up unused code
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>
2019-10-08 15:22:26 -07:00
Mark D Horn e482042355 swupd: model: Allow format to be set in config
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>
2019-10-08 14:09:00 -07:00
John Akre b640f8b3fe Makefile: Enable all linters for travis
The golangci-lint linter is fast enough to run all the linters in travis
without timing out.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-10-08 09:51:02 -07:00
John Akre d56dc35e07 Makefile: Replace gometalinter with golangci-lint
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>
2019-10-08 09:51:02 -07:00
Mark D Horn 48499d44da args: Enable --swupd-url for shorthand
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>
2019-10-08 09:41:49 -07:00
Mark D Horn a775026a65 swupd: Refactor name of swupd command
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>
2019-10-07 18:37:36 -07:00
John Akre e7c4128b72 storage: Synchronize device changes with udev
Device changes must be synchronized with udev before calling lsblk to
get accurate lsblk output.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-10-04 14:33:29 -07:00
John Akre 2e5692ae53 gui: Correctly set advanced disk config warnings
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>
2019-10-04 14:33:29 -07:00
John Akre 66a93b8668 network: Add HTTP warning to IsValidURI
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>
2019-10-03 13:36:47 -07:00
John Akre 13beab9625 main: Check for valid config file path
Resolve relative and absolute config file paths.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-10-03 13:36:47 -07:00
John Akre 3efc14c522 Add support to download config over network
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.yaml

Fixes: #524

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-10-02 16:46:40 -07:00
John Akre 10f1ecea4d Move IsValidMirror to network package
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>
2019-10-02 16:46:40 -07:00
John Akre 3d5aef88ad Log offline install version override
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>
2019-10-02 13:15:42 -07:00
John Akre 0b73c2d45a Update to latest when version is 0
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>
2019-10-02 13:15:42 -07:00
Tapani Pälli c0f32b3aff gui: pack content layout to a scrolled window if needed
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>
2019-10-01 14:57:40 -07:00
Tapani Pälli 77af98bab0 gui: make sure app fits the monitor size
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>
2019-10-01 14:57:40 -07:00
Mark D Horn 2fdace713c args: improve test coverage
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2.3.0
2019-09-30 17:32:36 -07:00
Mark D Horn cfe018a885 Ensure we default to software auto update for UI
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>
2019-09-30 17:32:36 -07:00
Mark D Horn 86c1881009 swupd: identify certificate errors
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-30 17:32:36 -07:00
Mark D Horn 2e3c5bf50b Support insecure updates over HTTP
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>
2019-09-30 17:32:36 -07:00
John Akre fb300cd92f Refactor main to handle errors without panics
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>
2019-09-30 08:53:05 -07:00
John Akre 5a71572850 main: Properly fail when encrypt.Crypt() fails
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>
2019-09-30 08:53:05 -07:00
John Akre bc8019fc3a storage: Sort partition numbers as integers
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>
2019-09-27 15:19:59 -07:00
Mark D Horn 6d33f72edf tui: Fix encryption enable bug
Fixes:: #541

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-26 09:32:14 -07:00
John Akre 8c6eea077b Makefile: Suppress deprecation warnings
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>
2019-09-26 09:25:07 -07:00
John Akre 182b834e87 Makefile: Add race condition support to coverage target
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>
2019-09-25 14:10:19 -07:00
John Akre d2e71c75a2 gui: Fix disk config menu description
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>
2019-09-24 16:52:18 -07:00
John Akre 980ed23cb2 gui: Preserve installation type
The installation type is now preserved when re-entering the disk config
page.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-09-24 16:52:18 -07:00
Mark D Horn 0e1188dee0 gui: tui: Reword messages for advanced disk config
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>
2019-09-23 18:06:43 -07:00
Mark D Horn 19c777aa5d storage: Fix minimum sizes to XiB
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-23 18:06:43 -07:00
Mark D Horn ddf2ded095 gui: Remove old comment
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-23 18:06:43 -07:00
Mark D Horn 2ffbd6e0e2 storage: Ensure swap fstype is correct
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-23 18:06:43 -07:00
Mark D Horn e05bbdf4a5 gui: Fix default disk selection bug
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>
2019-09-23 18:06:43 -07:00
Mark D Horn fe4ef72a91 gui: warning when no usable media
Fixes: #521

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-23 18:06:43 -07:00
Mark D Horn c00219c56c storage: Ensure safe is large enough
Fixes: #520

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-23 18:06:43 -07:00
Mark D Horn ed3eef5367 tui: warning when no usable media
Fixes: #521

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-23 18:06:43 -07:00
John Akre bca9042ec3 docs: Document offline and targetBundles
Signed-off-by: John Akre <john.w.akre@intel.com>
2019-09-23 16:08:10 -07:00
John Akre d0ec0371b6 swupd: Specify VerifyWithBundles steps
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>
2019-09-23 16:08:10 -07:00
John Akre ed62e96b51 install: Update indeterminate progress bar
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>
2019-09-23 16:08:10 -07:00
John Akre a7652005ef Add installation step to copy offline content
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>
2019-09-23 16:08:10 -07:00
John Akre 3aeef56341 test: reduced args coverage
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>
2019-09-23 16:08:10 -07:00
John Akre 320b807f20 gui: Remove precheck page
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>
2019-09-23 16:08:10 -07:00
John Akre 606112af4a gui: Add network check to install
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>
2019-09-23 16:08:10 -07:00
John Akre 6cb2d1ef52 gui: Add network check to bundle page
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>
2019-09-23 16:08:10 -07:00
John Akre 2b29ce834b gui: Add network check to menu
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>
2019-09-23 16:08:10 -07:00
John Akre 4cf88f9d25 tui: Add network check to install
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>
2019-09-23 16:08:10 -07:00
John Akre cd75d1a5f4 tui: Add network check to bundle page
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>
2019-09-23 16:08:10 -07:00