132 Commits
Author SHA1 Message Date
Brett T. Warden 5adb3150f5 Increase default EFI partition size to 512 MB
With increased initrd sizes, 150 MB is inadequate.
2024-10-10 16:49:49 -07:00
William Douglas 73d7f22c56 Update code for revive linter 2022-11-03 10:18:41 -07:00
William Douglas a9eb1fcc0f Fixup lint error 'unbuffered channel' for Notify 2022-11-03 09:14:37 -07:00
William Douglas e999af5e5b Fixup gofmt errors 2022-11-03 09:14:37 -07:00
Mark D Horn 718634761e 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.
- LVM always written in /etc/fstab with UUIDs
- Enable logging for all extra selected bundles.
- controller: Add clr-init with lvm usage

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-06-24 09:08:59 -07:00
Mark D Horn 46d525b565 storage: Use lsblk data for device path
Do not assume the path is /dev/<name>, use parsed path
from the output of lsblk.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-06-24 09:08:59 -07:00
Mark D Horn c004b7635d storage: make undetermined guid warning only
We were wrapping this in a error with trace back data
which puts a misleading message into the log file.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-06-24 09:08:59 -07:00
Mark D Horn 7e3feecccf storage: Fix bug in swapfile checking
Fix logic bug as we can not check the swapfile size
when we are using the default of '0' for the partition
size to use the remaining free media space.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-14 16:34:18 -07:00
Mark D Horn 33bae246b2 storage: refactor check for ext file systems
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-13 14:32:44 -07:00
Mark D Horn 5f78e5cbd2 storage: Validation fix
Legacy mode checks for root can not be overridden with
skipping validation checks, as it isn't supported.

Enabled the use of ext4 for boot with undocumented
validation override.

Additional test cases.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-13 14:32:44 -07:00
Mark D Horn f1d355a1f3 storage: Fix legacy mode mkfs bug
When adding the required options to mkfs for legacy
mode on ext, an extra null was being added when
options field was empty in the YAML.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-05-11 10:55:25 -07:00
Karthik Prabhu Vinod cc27345a72 storage: Add Misc capabilities
a.) By default, block destructive install affecting other disks
b.) Add way to report effects on other disks
c.) Add force-install option
d.) Add Cleanup progress
e.) Fixes

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-05-07 15:00:51 -07:00
Karthik Prabhu Vinod 00c73c4966 storage: Add support LVM destruction
Fixes: #633

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-05-07 15:00:51 -07:00
Karthik Prabhu Vinod 1b1020303a storage: Add support for destruction of sofware raids
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-05-07 15:00:51 -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
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
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 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
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
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 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 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 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 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 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 99b40ec1ac Fix Storage test
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-18 20:15:22 +00:00
Karthik Prabhu Vinod 086d3d030d Improve password checking
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-13 01:10:05 +00:00
Mark D Horn 02b30f1bd9 storage: f2fs uses lower case l for labels
Fixes: #681

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-12 15:11:46 -07:00
Mark D Horn ec6d983c26 Add legacy BIOS warning
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-02-27 15:06:20 -08:00
Mark D Horn f73d0d198e storage: ensure we read the partition table
A recent change in Clear Linux OS resulted in partprobe no longer
processing loop back devices by default. Adding --partscan to
losetup ensures we read the partition table changes.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-02-27 15:00:31 -08:00
ZVNexus 6272de6a21 Initial F2FS support for CLR Installer.
Signed-off-by: Alexander Koskovich <zvnexus@outlook.com>
2020-02-27 11:03:25 -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 be11cbca1e storage: remove logical volumes during wipe
Fixes: #623

If a whole disk is used that contains logical volumes, they
need to be removed before re-using the disk.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-12-11 15:01:51 -08:00
Mark D Horn 4c4de4c948 storage: Make mounted checks recursive
This will find sub-vols like LVM which might be mounted.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-12-02 09:57:35 -08:00