32 Commits
Author SHA1 Message Date
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
Mark D Horn 1866154f30 Network Testing PopUp
Switch to using a model PopUp window for Network testing.

This should be re-used for all network testing:
- Manual
- Change of Proxy
- Change of Interface
- Before starting Install

Added URL checking to the Proxy setting

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-09-06 18:37:10 -05:00
Mark D Horn e84bb0e403 First Open Source push of code base
This is code is still alpha. The Text-based User Interface is
undergoing a resign of the layout before beta.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-08-13 14:14:30 -07:00