Make sure we continue to use 1M alignment, this helps
parted shift things around properly. Don't reserve
space for root in installer image since it's read-only.
Add some fudge factor to the root image to allow for
sparse expansion.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Wily images and newer now contain a lxcbr0 by default.
Ignore this interface and don't attempt to dhcp autostart it.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
The size of the rootfs fluxuates and sometimes does not fit in the
pre-allocated sizes. Instead, calculate the size needed for the
rootfs read-only partition (+ 100M padding) and use the remaining
space for the overlay partition as it's needed when the install
image updates it's apt repository.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
validate the empty disks/partitions. Note that blockdev
class makes use of poking host's mounts which triggers some
transient failures.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
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>
Speed up install time by pre-installing required curtin packages
in the installer image. Do this by optionally exploiting a
curtin feature which handles preparing the target for installation
of services that we don't want running during the image build.
Fallback on simple apt-get install but filter out daemon services
as this will break the image build.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Instead of packing up curtin via source, build a
deb from the source and inject that into the installer.
This also means we always are consuming an 'installed'
curtin (aka /usr/bin/curtin).
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>
man 8 useradd says:
It is usually recommended to only use usernames that begin with a
lower case letter or an underscore, followed by lower case
letters, digits, underscores, or dashes. They can end with a
dollar sign. In regular expression terms: [a-z_][a-z0-9_-]*[$]?
On Debian, the only constraints are that usernames must neither
start with a dash ('-') nor plus ('+') nor tilde ('~') nor
contain a colon (':'), a comma (','), or a whitespace (space: ' ',
end of line: '\n', tabulation: '\t', etc.). Note that using a
slash ('/') may break the default algorithm for the definition
of the user's home directory.
Usernames may only be up to 32 characters long.
In this patch we implement most of this. Subset of the regular
expression suggested above is used to limit input into the username
field. We've not yet determined how to provide a fixed width widget
so at this time, user can input more than 32 characters, but upon
selectin done, we raise and error and reset the state.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- Switch to yaml.safe_load() which throws errors when fed /dev/zero.
- Add a new ProberExecption and bubble that up to the main program
- Update unit tests to mock out repeated calls to safe_load which slowed
down the unittest run.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
When we encounter an error before we invoke curtin, emit
a new signal, filesystem:error and present an error
UI for the user and return them to main, from there they
can quit.
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>
The single key 'Q' or 'q' was a bridge too far since we take
input at anytime and can surprise users. Instead use a key
combination, control-x. Clean up keypress handlers to match
urwid requirements (return None when handled, otherwise False,
or pass to super.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Some disk devices (virtio) don't have serial numbers by default.
This breaks curtin which requires a serial or a path to uniquely
find the target disks. Add a fallback to device path if the
current device includes the eye catcher 'Unknown Serial' which
is set by probert for devices that do not have a serial number.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
If we fail to find curtin, we don't return a valid path
and this confuses the run async, so instead return
/bin/false which will return non-zero and trip the
async failure detection.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Testing this out, I never saw any of the utf-8 output.
Instead use simple ascii ala kirby. Also replace the
try:except with a modulo operation to index the list.
Drop the futures import.
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>