695 Commits
Author SHA1 Message Date
Mark D Horn 59302346d6 linter: enable whitespace
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2.5.0
2020-04-24 14:53:17 -07:00
Mark D Horn 21dbcdf649 linters: Add goimports
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
Karthik Prabhu Vinod dfe03992ca Support software raid
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-21 20:46:58 -07:00
Karthik Prabhu Vinod 7ef32f9c2a Fix gocyclo coomplexity of main.go
Fixes #568

Reduced high 80s score to lower than 30

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-16 12:14:03 -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 b5aa17c3b7 locale: New translation
New warning translated.
Add creating message.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-15 17:23:59 -07:00
Mark D Horn af1076044e storage: Add XiB methods
When creating swapfiles we deal in XiB sizes and needed
these variants added.

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
Mark D Horn b1b702385e swapfile: Add new swap file size option
The size of the swapfile can be set in the YAML file
and overridden by the command line argument.

Update for usage of XiB or XB units.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-15 17:23:59 -07:00
Mark D Horn 87a138439f tui: Fix bug on media available
When Advanced was re-using the Warning label to display the
configuration it was not resetting the warning colors properly.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-15 17:23:59 -07:00
Mark D Horn a973a4fa4b tests: Fix bug with passing the URL
Added debug hook for no cleanup on success

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-10 11:58:14 -07:00
Karthik Prabhu Vinod f2c78d56e6 Make a tab(\t) count as 4 char
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-10 00:08:40 -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
Karthik Prabhu Vinod ee0e924de0 Lint: Add a target to check source line length
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-10 00:08:40 -07:00
Mark D Horn a1f4dd8299 tests: Enable use of mirror URL for image testing
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-08 14:00:27 -07:00
Mark D Horn 5123d7f116 storage: fix comment and logging message
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-08 12:53:17 -07:00
Karthik Prabhu Vinod 6bb45556b3 Clean AdvancedInstallation
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-08 11:11:25 -07:00
Karthik Prabhu Vinod d277803eed Storage: Abstract away partitioning mechanism for parted, mkpart
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-08 11:11:25 -07:00
Karthik Prabhu Vinod f6034ff258 Remove Unused method
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-08 11:11:25 -07:00
Karthik Prabhu Vinod 92c4963e25 Add Filters on BlockDevices List
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-08 11:11:25 -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
Karthik Prabhu Vinod 09c4303be7 Makefile: Remove exemptions for gocyclo
Removed exemptions for gocyclo lint for all
storage code except funcs: UnmarshalJSON
& NewDiskConfigPage have inevitable
function exemptions

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-31 18:30:45 -07:00
Karthik Prabhu Vinod 2dfda8750b Remove removed partitoning code, structure field
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-31 18:30:45 -07:00
Karthik Prabhu Vinod 059fc9f9bf Reduce cyclomatic complexity of WritePartitionTable
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-31 18:30:45 -07:00
Karthik Prabhu Vinod 3ac6130dc5 Removed high cyclomatic complexity for validatepartitions
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-31 18:30:45 -07:00
Karthik Prabhu Vinod d67c1ab57c Refactor storage code
a.) Break storage code into smaller readable units with each structure
and operations around it in the same file
b.) Remove commented code
c.) Rename storage.go, storage.go to
block_devices.go
block_devices_ops.go respectively
d.) Remove unused function FreeSpace

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-31 18:30:45 -07:00
Mark D Horn 8e20c46e9c vendor: Update to latest release vendor code
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2.4.3
2020-03-30 16:43:07 -07:00
Mark D Horn 9c308f26a3 make: Fix the vendor update target
Need to ensure we download any updated vendor code
and pull the changes into our vendor path for check-in.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-30 16:43:07 -07:00
Mark D Horn 646db5ab0f tests: Add new test to build all DevOps Images
This is a good regression test to ensure that all of the previously
released DevOps images will still build correctly with the latest
clr-installer code.

Two new make targets.
check-all-images:
    Run a long time as each is built in parallel

check-all-images-screen:
    Run all the image builds using screen which can
    be detached and allowed to run in the background.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-30 13:07:39 -07:00
Mark D Horn 294c518911 kernel: Drop extra LTS kernels
We only want to offer the latest LTS kernel which is a
meta bundle around the official latest kernel. User can
manually switch to any available kernel after install.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:10:11 -07:00
Mark D Horn 636e4804fc model: refactor method name IsDesktopInstall
Renaming method to be more clear.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Mark D Horn e77a32f4c6 Disable media size validation in UI
Use the new --skip-validation-size flag to ignore the size
sanity minimums during the user interface installations.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Mark D Horn f6f51ffa9e storage: refactor logs and warnings
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Mark D Horn 9283a120fd Enable override for partition validation
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Mark D Horn 90b5e36769 massinstaller: Add partition checking
Ensure validation is done for both standard and
advanced partitioning methods.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -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 30a7017e93 tui: Need to determine boot mode early
We need to know if we are legacy mode before we parse the disk
partition information as legacy mode trigger different checking.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Mark D Horn ef45a32849 args: model: New options for partition checks
Add command line arguments and YAML file configurations for settings
skipping partition size checks during validation.

Skip Validation All implies Skip Size.

Never write skip validation options to YAML

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Mark D Horn deb3bbfc3e storage: dead code clean-up
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Mark D Horn 79680a63fa telemetry: Added coverage
Add fail test for bad binary path.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-25 18:30:27 -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 9b1204f36c log: Fix formatting issues in output log file
Fixes several problems in the output of the log file.
- Escaping percent signs
- Wrong format for data type
- Unnecessary format strings

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-25 18:29:57 -07:00
Karthik Prabhu Vinod 8925d04ec0 Clean of storage code
1.) Move some code to test so that they are not part of executable
2.) Remove unused code

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-24 16:13:15 -07:00
Mark D Horn 144f870e55 Non-zero exit status for error conditions
Fixes: #687

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-24 15:16:43 -07:00
Mark D Horn 264aced1c9 storage: lower coverage during refactor
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-24 15:16:21 -07:00
Mark D Horn b99ff9135a storage: Enable Advanced Media Partition for CLI
Fixes: #628

Allow the use of the Advanced Media Partition labels from the command
line interface if no targetMedia is found in the YAML file.
The primary use case for this feature is PXE booting for installation.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-24 15:16:21 -07:00
Karthik Prabhu Vinod 5244585e59 Fix missing telemetry spool dir
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-18 20:15:22 +00:00
Karthik Prabhu Vinod 69d9806262 Build: Make failing test break builds
make check should capture exit code of go test to fail make check if a
test fails

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-18 20:15:22 +00:00
Karthik Prabhu Vinod 99b40ec1ac Fix Storage test
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-18 20:15:22 +00:00