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>
The indeterminate progress bar will continually move until the network
check completes. This type of progress bar makes more sense than the
multistep progress bar that incremented after each network retry.
Signed-off-by: John Akre <john.w.akre@intel.com>
When installing with offline content, the installed version must match
the version of the installer image so that the offline content can be
consumed.
Signed-off-by: John Akre <john.w.akre@intel.com>
When creating installer images with offline support, installation
content for a minimum set of bundles will be downloaded to the
/var/lib/clr-installer/offline-content directory inside the installer
image. The offline-content directory will be used instead of the network
to install bundles when it exists.
To generate images with offline support, the --offline command line
argument or the offline config file field can be set.
Signed-off-by: John Akre <john.w.akre@intel.com>
To support offline installs, the bundles listed in the default and
kernel configs from within the installer image must be known. This
change adds functions to read these config files from within a chroot
which can be used to read the config files within the installer image.
Signed-off-by: John Akre <john.w.akre@intel.com>
The targetBundles field in the config file specifies the minimum set of
bundles that the installer image's installer will install to the target
media. To achieve this functionality, a config file is generated and
inserted into the installer image at /var/lib/clr-installer.yaml. This
config file contains the list of bundles specified by targetBundles and
a minimum set of entries based on the config file used to generate the
installer image (keyboard, language, timezone, kernel).
Signed-off-by: John Akre <john.w.akre@intel.com>
This change removes the need for telemetrics bundle to be present for
the installer to work.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
This change executes opt-in when users agree to provide crash information
to the clear linux team and opt-out when users do not agree.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
The support for using encrypted file systems with advanced disk
configuration needs a lot more work.
Tracking new GitHub Issue in #512
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
The GUI need to be updated to ensure that the user defined state
was updated so that we store the user's answer in the (temp) YAML.
Make the GUI be consistent with the TUI and with the other
two selection labels for the Disk configuration.
Change advanced to warning
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Use new size checking for advanced partitioning.
Fix logic bug in checking for validation errors before
checking for encryption passphrase.
Code review fixes.
Make advanced description consistent with GUI
New min size and adv labels
Change advanced to warning
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
New label for labeled
New translation for passphrase encryption
Based on user feedback switched the tense of installation steps.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Since we have code which assumes we want autoUpdate to be true
unless it is added to the YAML file, we need to be sure it is
write to the YAML when false.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
We've added new functionality to storage which is only
exercised on media when running as root, so dropping
the basic coverage value for storage.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
The UUID is not set until after the file system is created.
We need to update the block device in memory with the new
UUID to properly create a fstab with UUID instead of device.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Write Partition table is setting the partition type
using the partition number, ensure it is set first.
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>