48 Commits
Author SHA1 Message Date
Reagan Lopez a656d4149f gui: Scan Media in the background
In order to avoid delay in loading the installer, scan the media in the
background as a separate go routine.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-05-28 13:47:21 -07:00
Mark D Horn de5120148e storage: remove fatal partprobe
We were part probing all of the devices at once, then again
one at a time. Remove the second probing.

Also make the probing only log on fail.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-05-02 14:24:45 -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
Reagan Lopez 6f9b0a8d0c gui: Prompts user for confirmation before install
Also disables exit button during installation and
re-enables it after installation is complete.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-04-29 19:39:51 -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
Reagan Lopez 9ee68d0a3e Initialize localization in test files
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-04-23 18:52:18 -07:00
Reagan Lopez 281449eb17 gui: Applies localization to additional strings
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-04-23 18:52:18 -07:00
Mark D Horn 0ae0b24ad0 tui: Refactor shared strings from TUI
Move strings from TUI to storage for use by all interfaces.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-22 12:52:05 -07:00
Brian J Lovin 24c29d7d31 Storage: Ignore boot devices, probe early
When booting off of a generated ISO image, the boot devices were showing
up as installible media. This patch fixes this issue by ignoring
squashfs filesystems and labels that contain CLR_ISO.

A second issue was found where the filters above would not work during
the first visit to the "Configure Media" window, and all devices would
be erroniously displayed. By adding partprobe above the lsblk, the issue
is resolved. This has a side-effect where we can remove the individual
partprobe commands usually run after lsblk.

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
2019-04-19 15:11:15 -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 7fe0567d68 tui: Rename Manual to Advanced
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-19 08:56:28 -07:00
Mark D Horn e0693dd2ec ui: Change Full Disk to Entire Disk
User feedback suggested that Full disk was not clear enough

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -07:00
Mark D Horn 658dcb9866 debug: Remove extra debug
A lot of leftover detailed debug during engineering which
no longer needs to be present.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -07:00
Mark D Horn a904be6d09 storage: Size checking in xB, not xiB
Fix the error checking to compare against human readable size

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -07:00
Mark D Horn b45bf00a04 storage: bug fix for the partition name
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -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 98af1958c8 storage: Do not panic for partprobe issues
We will log the message, but not crash the program as most
non-zero error was really warning about the partition table
or media details.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -07:00
Mark D Horn 5c37d53f1f storage: Improve error message for mount
Show the device name and file system type in the error message.
We have had mapping issue on some device names.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -07:00
Mark D Horn 9454805bf7 storage: Correct comment spelling
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-18 12:48:36 -07:00
Reagan Lopez f61d7092ab Add support for ister json config
- The new -j flag detects ister json config format and converts it to yaml
- The existing -c flag also detects ister json config format, converts it to yaml
  and continues as usual
- Handles the ister "rest" option for physical targets
- Handles multiple targets

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-03-05 13:55:44 -08:00
Mark D Horn b5f66460cc Ensure properly partition alignment
We should use 0%, not 0 for the start location
to ensure proper partition alignment.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-02-27 11:47:02 -08:00
Mark D Horn b336ccb67a Add support for mmcblk devices
Fixes #195

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-01-11 17:26:26 -08:00
Mark D Horn 05864f068c Revert "storage: don't unmarshal storage's serial number"
This reverts commit 6b6bcfe4ed.
2019-01-08 16:03:23 -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
Leandro Dorileo 6b6bcfe4ed storage: don't unmarshal storage's serial number
This information is actually useless for future references and could
also endup in the telemetry records. Since we have no good reason to
store it we don't want to marshal this data.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-12-12 13:40:41 -08:00
Mark D Horn 443cfa7ebf Ensure unique crypt labels
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-29 12:35:26 -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 037d4991ef Improve Test Coverage for new features
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 a58eb66e28 Add support for Partition Labels
Fixes #101

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-29 12:35:26 -08:00
Mark D Horn dd603b37be Update for changes to lsblk
lsblk changed their JSON output format for booleans from strings
to actual booleans and for number from strings to actual numbers
in release 2.33.

Updated the code to work with both the new and old formats.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-29 09:55:42 -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 7e32032744 Only check diskSize if non-zero
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-14 12:54:42 -08:00
Mark D Horn 0903296bda storage: bug fix for calculating image size
Size is either set at the parent level or it is a
sum of the children.

Add error checking and new test cases.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-13 10:07:16 -08:00
Leandro Dorileo c718ef5dcb storage: guid is not mandatory
We should not panic if we could not determine the guid, with this we
emit a log warning and move forward.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-11-08 14:30:00 -08:00
Leandro Dorileo 8202c362fb storage: change default swap size
Adjust the swap partition size for the auto partition and the installer
image size.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-26 16:22:10 -07:00
Leandro Dorileo 8bbaff2bd7 storage: support LegacyBios mode
With legacy bios mode the storage will not require EFI partition.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-26 16:03:11 -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 83105836d3 tui: support loop device
Loop devices are valid then don't exclude it when reading block device's
configuration, also make sure tui reacts properly.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 13:26:50 -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 911ba9e793 storage: add options field to block device structure
With this users may provide custom arbitrary mkfs.* options. Also,
the patch attempts to simplify the ops.go code and reduce code
duplication.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-27 14:08:53 -07:00
Mark D Horn 002970e6fd New Disk Partition Page
Fixes Issues #26

- Build header and scrolling frame
- Populate the scrolling frame with a row frame for each disk
- Only enable one disk at a time for changes
- Prevent changes to other disks once configuration begins
  - Added Warning PopUp dialog
- Implement ReScan and Revert of media
- Add Disk Serial number to block device
  - Needed to track selected disk in case of a rescan
- Handle no usable media
- Fix size error when size unchanged

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-09-25 15:33:15 -07:00
Mark D Horn bfd800d3db Properly Remove Partition
Ensure when a partition is removed that the remaining
partitions as named properly.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-09-21 14:19:54 -07:00
Leandro Dorileo 5c1b69c8d4 testsuite: prepare to enable check-coverage.sh on CI
This patch fixes the tests coverage regressions and add a small fix
to the script where it doesn't remove the temporary coverage report
file if it fails. Now it can be enabled on the CI and avoid adding
new testsuite regressions.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-19 15:56:54 -07:00
Mark D Horn 751af3a5dc Allow Rescanning of Media
If a USB drive is added or removed, this allow discovery without
restarting the installation program.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-08-31 14:23:53 -07: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