Commit Graph

110 Commits

Author SHA1 Message Date
Mark D Horn f51c2d4093 storage: Enable use of LVM for root file system
- Add suspend lvm state for offline volumes.
- Need to check all children for possible install targets.
- controller: Add clr-init with lvm usage
- LVM always written in /etc/fstab

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-06-17 16:38:34 -07:00
Mark D Horn f3b943149c controller: Fix hang bug for cbm fails
Fix issue where we failed and then returned where
we waited on the fail again.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-06-09 15:34:46 -05:00
Mark D Horn 384b1d8598 controller: Offline content ignore
Only show ignoring offline content if it exists and we
can not use it for this install.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-06-08 18:39:44 -05:00
Mark D Horn 1a732b1d9f controller: Visual fail for copy content
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-19 13:16:19 -07:00
Mark D Horn 0d72ca36a5 Rework model conversion and latest check
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-19 13:16:19 -07:00
Mark D Horn 544c824a82 swupd: controller: check network if offline not usable
Adding testing coverage for Offline

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-19 13:16:19 -07:00
Mark D Horn 1a059fb08f controller: Use offline content by default
If the user has not explicitly requested 'latest' from the
command line, use version of the available offline content.
This is the default case for generated installer ISOs.

This functionality was broken by a previous fix.
Ref: 6dc97671d3

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-19 13:16:19 -07:00
Mark D Horn 13b28fd349 yaml: switch to strict unmarshal
Enable Strict Unmarshal to ensure that we fail on unknown
tokens and duplicate tokens.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-08 15:03:31 -07:00
Mark D Horn 2c5af619ef boolset: switch PostArchive from bool to boolset
Change the PostArchive model type from bool to boolset to account
for default of true and state if the value was explicitly set.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-07 17:04:00 -07:00
Mark D Horn 4f2caf0e33 boolset: switch AutoUpdate from bool to boolset
Change the AutoUpdate model type from bool to boolset to account
for default of true and state if the value was explicitly set.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-07 17:04:00 -07:00
Mark D Horn 6dc97671d3 controller: Version overrides offline content cache
If the user forces a version to be installed, we ignore any
offline swupd content cache (standard for Installer ISOs) which
might be present.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-07 17:04:00 -07:00
Mark D Horn a639650dee storage: find and set boot partition
Refactor the boot partition login to central code.
Search all target install media for the boot partition.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-29 15:45:30 -07:00
Mark D Horn 59302346d6 linter: enable whitespace
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-24 14:53:17 -07:00
Mark D Horn ff8c2dea5c storage: Include clr-init for software RAID
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-22 10:18:23 -07:00
Mark D Horn 4244fbaf43 storage/ui: swapfile instead of swap partition
New default is the creation of a /var/swapfile if not
swap partition is explicitly defined in the YAML file
or via Advanced Configuration.

Now use and report media sizes in XiB

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-15 17:23:59 -07:00
Mark D Horn b4f5d0f6bc storage: generate swapfile
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-15 17:23:59 -07:00
Karthik Prabhu Vinod 8da9febcd4 Fix long line issues
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-10 00:08:40 -07:00
Mark D Horn 2885e8ed44 lint: Only ignore the few problem functions
Instead of skipping whole files, just exclude the few
complex functions.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-31 19:51:47 -07:00
Mark D Horn be9d9bc64e Update partitioning support in legacy mode
Fixes: #517

Enable the possibility of no /boot partition in legacy mode.
- add warning if no /boot and legacy
  Warn the user that installing in legacy mode without a /boot
  partition means the install will never boot in UEFI mode.
- Force off 64bit mode
  When an ext file system is used for the /boot content
  (no /boot partition, and booting legacy mode) we need to
  disable 64bit flag or the image file system not boot.
  https://wiki.syslinux.org/wiki/index.php?title=Filesystem#ext
- Blocked use of XFS due to partition table requirement to use MBR.
- Do not allow encryption of / w/o /boot

Refactor validation code for reuse by both standard and advanced
disk partitioning. Add new standard Desktop and Server wrapper
functions.

Move validation to common function, remove from Find Targets, and
remove redundant validation function.

Enable the skip size for advanced partitions.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Mark D Horn 9addbc449a telemetry: Prevent error when not present
We were attempting to run the telemetry command to opt out
on the target when the binary was not present.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-25 18:30:27 -07:00
Mark D Horn b54dcfb3fb Add complete step to the task list
Add a final step that confirms for the user that the installation
has completed.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-04 10:45:51 -08:00
Mark D Horn 44335ee0cc controller: Make hooks indeterminate
It is unknown how long each shell command can take or there may
be only a single call to a long-running script so make this
indeterminate to output spinner progress.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-02-27 15:00:31 -08:00
Mark D Horn 7e277776a9 controller: Add post-image YAML hook
Fixes: #531

Add new hook to be called after image generation is completed.

Update base image test to use post-image hook

This is useful for image manipulation such as compression, format
modification, etc.
2020-02-27 15:00:31 -08:00
Mark D Horn 8169fe5e7c controller: Enable networking in a chroot
Fixes: #649

When post-install hooks are run in a chroot, the network is
inherited from the host, but DNS is not configured.
This work-around temporarily copy's the hosts /etc/resolv.conf
to enable DNS in the chroot.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-02-14 12:08:18 -08:00
Leandro Dorileo 2348394fd4 args: add --cbm-path
With the new flag we can easily instruct clr-installer to use an arbitrary
build/install, this flag eases the clr-boot-manager's CI by testing image generation
before we land new features.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-02-04 14:22:56 -08:00
Mark D Horn 96c9087d14 UI: Ensure we properly flag fails
Fixes: #447

Some failures with media left the progress bar active
and did not give a visual failure cue.

Add the executable to the message

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-01-17 09:39:23 -08:00
Mark D Horn b9970047f9 Allow skipping swupd configuration file copy
Fixes: #600

Only copy the swupd configuration files from the host to the target
by default when running the interactive installer (gui or tui).
Otherwise, observe the setting from the configuration YAML or the
command line (highest) argument.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-12-11 10:47:05 -08:00
Mark D Horn a4f83fd0fe model: controller: Keep Image default
--keep-image defaults to true, we only try to remove an
image file if it is set to false.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-26 14:50:47 -08:00
Mark D Horn f2e376e179 Ignore flags when installing onto physical media
Ignore the --iso and --keep-image flags for the massinstaller
when installing onto physical media as they do not logically apply.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-25 17:23:40 -08:00
Mark D Horn b7a52f2d67 controller: Keep image if disabling ISO
If an ISO can not be generated due to multiple kernels, then
ensure that we keep the raw image file.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-19 18:18:05 -08:00
Reagan Lopez eb828da9de Skip ISO generation if additional kernels are present
Currently, ISO image generation supports only a single kernel.
Hence, skip ISO generation if multiple kernel bundles are present.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-11-19 11:06:17 -08:00
Mark D Horn af49072ac4 boot: use image mode
We should be using image mode when invoking clr-boot-manager
as we want changes implemented on the target image.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-06 13:09:44 -08:00
John Akre c7fae814b5 swupd: Concatenate printPrefix with description
Now printPrefix is concatenated into the progress bar description. The
printPrefix is only intended for the mass installer, so it is removed
from the gui/tui progress bar descriptions.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-10-16 09:15:21 -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 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
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 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 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 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 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 1add9c9a5c Use indeterminate progress bar for network check
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>
2019-09-23 16:08:10 -07:00
John Akre 8ffe58328d Don't update to latest version for offline installs
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>
2019-09-23 16:08:10 -07:00
John Akre 1527c25d6d Add offline install support
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>
2019-09-23 16:08:10 -07:00
John Akre bf89aeaa40 Add targetBundles support to config
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>
2019-09-23 16:08:10 -07:00
Alex Jaramillo 8e3af8152c telemetry: do not fail if bundle is not installed
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>
2019-09-23 15:43:27 -07:00
Alex Jaramillo 21fb4ed6c9 telemetry: execute additional telemetry steps
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>
2019-09-18 14:00:20 -07:00
Mark D Horn 7098434b5a storage: Change InstallSelected to be a map
Change InstallSelected to be a map with the key being
the name of the TargetMedias from the model to support
installing across multiple disks.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-12 19:20:47 -07:00
Mark D Horn 2a130e1897 storage: determine detailed changes to media
Detect the details of the changes to the media to be presented
to the user during the final confirmation step.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-12 19:20:47 -07:00
Mark D Horn 25d2144c7c install: save mount point even if not formatting
Previously the mount point would not be saved if formatting
was skipped for the partition.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-12 19:20:47 -07:00