Ensure that the / mount point is always first
but returning an explict value (0) for / mount action.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
RAID devices require special handling since they cannot be partitioned.
Adjust the blockdev model to accomodate this.
Fix sorting of our actions to handle proper ordering when using RAID devices
Implement whole-disk formatting view and controller
Update cloud-init configuration to ensure repeated runs of installer work
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
The spec calls for invoking hdparm -i on the device, but not all of our
devices will display hdparm data (virtual, ceph, or other such devices).
Additionally the bulk if the data in hdparm itself is not really useful
in helping users identify a specific device. Instead, display a short
set of helpful info about the device:
- /dev/XXXX
- Vendor
- Model
- Serial
- Size (in human-readable and bytes)
- devpath (/devices/XXXX)
- rotational (true or false)
The current UX requires us to select another disk after returning to
the list, with this patch though we enable switching between the
available disks via 'n' and 'p', or 'j' and 'k', which will be switched
to 'tab' and 'shift tab'.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- add blockdev tests on available_partitions
- fix type issue in Disk.partition OrderedDict keys, always use integers
- Add __repr__ for Disk related Actions
- Fix issue with available partition logic, ensure we and them together
- Filter out 'leave unformatted' fstype, set to None as needed.
- Whitespace cleanup in unittests
- add fsm test on get_partitions
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- Use nosetests3 to call unit tests
- Ensure all Actions use the 'type' property
- Implement remaining Blockdev unit tests
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Forgot to add __init__.py in tests subdir to make module.
Add a few blockdev partition tests and fixes for their issues.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
mdadm supports using whole disks and empty partitions.
Update model to define empty disks and empty partitions.
This allows one to construct a raid, and then use that raid
to construct further raid (raid0 multiple raid1s).
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- Update filesystem model to check if we have an existing device
that's marked bootable.
- Update look at all disk mount points, not just the current one
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Introduce a new Raiddev class to hold raid virtual device.
Add RaidAction to emit correct storage config
Tested with raid level 0 only.
Not sure if we can allow partitioning of raid devices. Documentation
says it can be done but curtin will need to 'make it correctly'.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Enhance our mounted disk detection. Don't display these
devices unless we're in dry-run mode. Add support for
the case where we don't have any disks and prevent
the installer from progressing.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- Fix up issues with efi mode grub serial configuration
- Modify blockdev model to order storage configuration output
- Handle when we're running in uefi mode
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Break out curtin configuration data into multiple configuration files
This sets up our initial install (network +storage) and our secondary
run (postinstall user config).
- encrypt the users password and never log the original value
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Conflicts:
subiquity/controllers/filesystem.py
Curtin uses sgdisk to create partitions. To avoid sgdisk
fixing alignment issues we ensure that all partitions are
1M aligned.
GPT partitions also require space at the end, reserve the
same number of sectors (1K, 2048 512b sectors) at the
start and end of the disk.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- Fix max size partition edge case
- Ensure if nothing is entered we select the max size
- Adjust offset and size calculations for actions
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Allow user to specify a probert machine configuration file to be
used during the installer. If presented with the config file
no probing of the host will occur.
In the case that disks don't have a size in the data collected then
they'll be marked as USED.
Add a few example machines and update the README on how to specify.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Using parted required root privileges since it opened the underlying device.
Instead create our own Disk model and use sysfs interface for extracting
size information.
This also clears the way for providing device data via probert input. This
means we can feed subiquity a probert dump and have it present that to
the installer UI even if we're running on a different system.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Don't let user pass the same mount twice. TODO is to
include an error message widget and place the error
there instead of in the mountpoint widget value.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- Remove the (1-4) since GPT partition doesn't have a limit
- Calculate the lastpartition value and handle the case where
we don't have any at first
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- Remove the error when converting sizes between input and initial value
there is a rounding error in the floating point convertion when
passing values between humanize() and dehumanize().
- Fix the error when using the full size of the disk as the first
partition and not accounting for the GPT bios size
- Implement percentage used in Filesystem Views
- Consolidate on unit keywords (single char only)
- use humanize() to append the correct unit size, remove all
hard-coded sizes when fetching size
- fix bug in calculating total disk size by only asking for the
largest available partition from parted.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
The previous organization was in place to reduce the number of open
files when working on getting the demo into shape. Since we've completed
the demo revert back to our MVC model incorporating the latest changes
that were made during that time leading up to the demo.
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
Partial implementation using parted to model new partitions.
Add a method to track sequential actions taken against block
device and can write out a storage config file for curtin.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>