52 Commits
Author SHA1 Message Date
Mark D Horn 27ccfc8820 iso: Pass all options through to ISO generation
We need to pass the full suite of options to the ISO
generation code to ensure the call to swupd has all
of the requested options.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-05-07 12:01:54 -07:00
Reagan Lopez 7dae3a782e gui: Handle errors in the Install page
Handle errors during installation.
Displays an error message on screen instead of panic and crashing.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-05-06 13:31:50 -07:00
Reagan Lopez 86b8a0464b gui: Add third set of translations
Add the third set of translations and optimize screen size further.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-05-02 18:08:00 -07:00
Reagan Lopez 7e0d6fe955 gui: Implements disk encryption
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-05-01 19:11:23 -07:00
Mark D Horn bed70bbb0f gui/tui: Display installation complete step
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-29 19:45:03 -07:00
Reagan Lopez 105cb92d9c gui: Add/update localization strings
- Adds localization for bundle description
- Adds localization for variables
- Removes unsused localization strings
- Adds missing localization strings
- Standardize the strings used for rules

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-04-26 18:04:30 -07:00
Mark D Horn 0c176e7623 swupd: Speed up install
Use new bundle option to swupd verify instead of bundle adds.

Optimize the flow to only have a single swupd verify call.

Reduces the desktop image build from 40 minutes to 10 minutes.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-26 15:00:20 -07:00
Mark D Horn a7cee24878 network: Add restart to the retry loop
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-23 19:14:55 -07:00
Brian J Lovin 511a8600f3 controller: Enable ISO generation
Add execution of MakeIso() to controller's Install routine, after all
other image creation tasks are complete.

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
2019-04-19 15:06:47 -07:00
Brian J Lovin 9c7820f3c3 swupd: Add verifyOnly flag to swupd.Verify()
When building an initrd it's convenient to only install the 'os-core'
bundle, because any extra bundles are not required and bloat
intird.

This commit adds an option to only run the 'verify' command and not
install the extra bundles listed as 'core-bundles'.

Approved to reduce coverage for swupd library.

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
2019-04-19 15:06:47 -07:00
Mark D Horn cff36aa736 Generate ISO Framework hook
Create the command line argument and configuration file changes
to support generating an ISO from the raw image.

TODO: Integrate the ISO generation code

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-19 15:06:47 -07:00
Reagan Lopez 4c1f7a9dfe gui: Introduces localization
- Modifies the screen flow to first launch the Welcome (Language) page
- Adds localization package "gotext"
- Enables localization for "en_US", "zh_CN" and "es_MX"
- Modifies the strings to use localized version

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-04-19 15:04:57 -07:00
Mark D Horn 3945c9aeb2 network: Add support for Network Manager
Now check for which service is handling wired network interfaces.
Needed by the TUI which still handles static IP configurations for
wired connections.

TODO: Once NetworkManager is the new OS default, we can explore
configuring wireless interfaces via the TUI as well.

TODO: Consider change the other systemctl calls to use new dbus.

Dropping coverage requirement for this build

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-19 10:57:15 -07:00
Mark D Horn 49529add0c storage: refactor for manual partitioning
Always store the current partition table, with free space,
in the disk block device information.
Find free space from the already loaded partition table.

This information will be used for manual disk partitioning.

Use separate mkpart and format flags

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -07:00
Mark D Horn 3334c1ff67 storage: Identify Install Target types
Safe: gpt disk with sufficient space
Destructive: All media (expect mounted)
Modify: all gpt disks

When adding new partitions, ensure we store the new
partition number and update the device name.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -07:00
Mark D Horn 5dbee42d7d Fix Network Interface Copy
Fixes Issue: #261

Pull Request #236 introduced a bug where local network interfaces
are always copied to the target media.
This PR correct this by only copying when copyNetwork is set to
true; this is enabled in the UI when the users changes a network
interface (for static).

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-03-12 15:17:58 -07:00
Mark D Horn 786a1f27b5 Download User Messages
New functionality to download Pre and Post Installer messages
TODO: Display the messages as pop-ups
- Need to use system curl command to handle proxies for now

Refactoring for enabling:
- Moved FetchRemoteConfigFile from conf to network
- Move code for Clear Linux Version parsing until a utility function
  which is called early in the flow for reuse

Now that use external curl FILE protocol passes.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-03-11 17:11:55 -07:00
Mark D Horn f424bdb143 Track user selected bundle separately
Fixes Issue: #242

Only show user selected bundles on the summary menu item for
bundle selection; not core, required bundles.

Make the latest user bundle changes more evident by prepending
them to the list of bundles to install.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-03-06 13:20:26 -08:00
Mark D Horn a53dc00958 Fix setting static IP
We also need to set either proxies or the
DNS search domain to enable pacdiscovery
if network testing does not pass.

Need to add:
    systemctl enable pacdiscovery on target
    Ensure we copy the /etc/systemd/network settings

- Fixed bug in showing dns server per interface
- Add new DNS Domain field per interface
- Mask out (skip) Wireless and Bridge interfaces
- Update Network Interface TUI
  - Added DNS Domain
  - Widen screen for error messages
  - Moved Error labels before field

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-03-06 11:27:53 -08:00
Mark D Horn 8c99371179 Relocate preConf file name for logging use
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-02-19 09:28:18 -08:00
Mark D Horn 4667cb8dac New Option to clean-up swupd state directory
Fixes #215

We already default to placing the swupd state cache directory
in the installation target. This change implements the only
missing part of the request to allow removing the state directory.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-02-14 16:59:21 -08:00
Mark D Horn 53fb6f0f8a Only archive records when telemetry is enabled
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-01-22 13:03:19 -08:00
Mark D Horn 3a4f3100cf Remove Network information from clean model
Ensure we do not send any network information if telemetry
is enabled for the installation results.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-01-08 16:03:23 -08:00
Mark D Horn 4cab6465fe Remove Drive Serial Numbers from clean model
Ensure we do not send media serial numbers if telemetry
is enabled for the installation results.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-01-08 16:03:23 -08:00
Mark D Horn 929505fc49 Add new environment variable for hooks
Create a new environment variable 'yamlDir' which locates
the directory containing the configuration YAML file being
used using the installation. This can then be used for
pre-install and post-install hooks to locate the scripts
to be run.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-01-04 16:11:04 -08:00
Mark D Horn 1743f1822e Set the boot mode on intended partition
Need to ensure we set the boot mode correctly on the targeted
boot partition.

1. Ensure boot flag is set, was getting removed by the follow-on
sgdisk command.
2. Need to set legacy_boot, not just boot when selected in YAML

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-01-04 16:10:47 -08:00
Mark D Horn c55b3602bd debug: Save config before stating install
Save a copy of the current configuration prior to starting
the installation. This provides a YAML containing the configuration
in case of a crash or failure during the install.
It is placed in the same directory as the clr-installer.log file as
both of these files should be submitted in case of failures.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-12-07 22:24:58 -08:00
Mark D Horn b84566ff08 Prevent boot timeout for encryption
By default, the prompt for the encryption passphrase will timeout
and drop into the rescue shell. This prevents the timeout and
waiting forever for the passphrase.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-29 12:35:26 -08:00
Mark D Horn c43135f6ee Support Encrypted partitions
Fixes #10

Enable encrypted partitions for all but /boot.

A single passphrase is used for all partitions which enable encryption
expect swap, which currently uses a random password each boot.
NOTE: If we need to support a large swap for laptop suspend/restore, we
should change from a random passphrase to the same known passphrase.

/etc/crypttab will attempt to use either the disk label or the
UUID to identify the disk instead of the physical disk name.

Swap partition would normally loose its UUID or Label each boot
due to dm-crypt and mkswap overwriting the connect. To maintain
identification of the partition, we use a trick from here:
https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption
of creating a small (1M) ext2 partition with label at the beginning
of the swap partition, then use an offset in the /etc/crypttab to
prevent overwriting this information.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-29 12:35:26 -08:00
Mark D Horn 64451ee854 Check for root early
Change the timing where we check for the root user.

Fixes: 171

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-28 19:38:06 -08:00
Mark D Horn 34d00abc41 Ensure PATH set correctly for hook scripts
Added the '-l' to run bash as a login script.
Previously gcc was not on the path when executed
without '-l'.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-15 11:23:40 -08:00
Leandro Dorileo 536f80ea30 swupd: add new flags
Add the swupd's --format, --contenturl and --versionurl arguments.
These arguments are mapped with the --swupd prefix such as:
--swupd-format, --swupd-contenturl and --swupd-versionurl

And are used for constrained environments dealing with local installs,
specially with image generation in a network isolated environment.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-11-08 15:41:02 -08:00
Leandro Dorileo b48d707fdc model: add env configuration
Now users may defined environment variables to be used in the image
generation. Also, these variables are passed down to the pre and post
install hook scripts.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-11-08 14:30:00 -08:00
Leandro Dorileo f90094f609 kernel: add "none" key for kernel config
There're some use cases for images without kernel definition, to
pass over the configuration the user may define, kernel: none.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-11-08 14:30:00 -08:00
Mark D Horn fec570770e Add bundle only when non-root users defined
Be consistent with ister_gui and only add the sysadmin-basic
bundle when non-root users are added. Previous we were always
adding the sudo bundle.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-26 09:29:14 -07:00
Mark D Horn b7fe01d5f8 Set the language on target system
Also change to using 'locale -a' to generate possible languages
installed as 'localectl' is currently broken due to the relocation
of the locales from /usr/lib to /usr/share.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-23 10:03:34 -07:00
Mark D Horn b6589ef0bd Set the keyboard on target system
- No longer set the keyboard on the host system in main

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-23 10:03:34 -07:00
Mark D Horn 3339c19a50 Set the time zone on target system
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-23 10:03:34 -07:00
Mark D Horn 55512b1bf0 Refactor the telemetry bundle into the package
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-23 10:03:34 -07:00
Leandro Dorileo b44176d93b args: add StubImage argument
With this argument (either -S or --stub-image) we create the image
- if that's the case - and create the target file systems but don't
actually install content.

It's useful for pre-release validation where the content is generated
and dealt by the release tooling.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-19 10:42:55 -07:00
Mark D Horn f6e0b2ba63 Add Install Steps as Info log messages
When the default logging is set to Info, have a baseline of
the installation steps logged.

Add additional testing to storage to ensure metrics do not slip.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-16 16:47:50 -07:00
Leandro Dorileo 1074784a7a args: add --swupd-state
When creating images it's useful to have a --swupd-state to provide
an state dir outside the image so we don't duplicate the target's
content.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo 63b6dba299 Add required bits to make image and install a target system into it.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 10:04:10 -07:00
Leandro Dorileo b1334c2648 storage: add block-devices alias support
With this the user can add alias block devices and use these alias
to expand target media's Name values, i.e:

block-devices: [
   {name: "target", file: "/dev/sda"}
]

targetMedia:
- name: ${target}
  type: disk
  ...

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 10:04:10 -07:00
Leandro Dorileo f5e8d7e33b controller: simplify cleanup code
Simplify the cleanup code and move the SaveInstallResults() call to
the controller code, removing this knowledge from the front end
implementations.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-01 09:48:43 -07:00
Leandro Dorileo a36f80bfec controller: fix a missing format argument
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-01 09:48:33 -07:00
Leandro Dorileo a26b5415a1 model: add Version field
The mass-installer use case for image generation requires to specify
the target system version. This patch allows the configuration of
an arbitrary version.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-27 14:50:33 -07:00
Leandro Dorileo a58c12d5d9 post-install: add post-install hooks support
Introduce the initial support to post-install hooks. The code also
expands a set of pre-defined variables, for now the only exposed
variable is the chrootDir (the directory where the target system is
mounted).

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-27 14:32:50 -07:00
Leandro Dorileo 3ed4c7ddfa kernel arguments: add "remove kernel arguments" support
We are relying on clr-boot-manager's cmdline-removal feature which
prevents a kernel argument to be added to the boot manager kernel
entry.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-20 16:39:35 -07:00
Mark D Horn a614c66c03 Optimize Network Testing
- Do not rerun network test if network known to be passing
- Run Network PopUp testing if any Network Interface is modified

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-09-11 16:49:29 -07:00