Commit Graph

4980 Commits

Author SHA1 Message Date
Ryan Harper 18f3e33f7f Go ahead and sort the partition list
We were using sorted but not storing the result. Do so now.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 16:34:57 -05:00
Ryan Harper 410ff1da07 unittest: add tests, filesystemmodel, blockdev
- 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>
2015-10-07 15:24:19 -05:00
Ryan Harper 3e605f3b3b unittest: add filesystemmodel add_device
- add add_device test

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper 55b3f33f15 unittest: filesystemmodel
- get_disk with partition name
- get_all_disks
- get_available_disks

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper fc3fe29b93 Add equality for Actions, Disks and Blockdev classes
Unittest on filesystem model require equality methods for
the various storage classes.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper b7885dc480 unittests for FilesystemModel
Add some probing data to use with the FilesystemModel
Add fakes class to handle fetching mock data
Add initial unittest

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper f8141cc259 Blockdev and unit test cleanups
- 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>
2015-10-07 08:48:07 -05:00
Ryan Harper e9a7a0be52 Add tests/__init__.py and add new blockdev partition tests
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>
2015-10-07 08:48:07 -05:00
Ryan Harper b5a8876038 Fix handling of empty disks and partitions for raid menu
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>
2015-10-07 08:48:07 -05:00
Ryan Harper 0e549dec40 Fix raid cancel, return to filesystem
Raid cancel quit, instead return to the filesystem view.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper ee8e25818a Don't allow multiple devices to be bootable
- 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>
2015-10-07 08:48:07 -05:00
Ryan Harper a0b3471084 First cut on raid ux and model integration
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>
2015-10-07 08:48:07 -05:00
Adam Stokes 8a9b38fb7d Merge pull request #65 from CanonicalLtd/find_curtin
Dynamically find path to curtin and install source
2015-10-07 00:14:35 -04:00
Ryan Harper 3ac50f6f83 Dynamically find path to curtin and install source
subiquity may invoke curtin either from an embedded location
or from /usr/bin depending on how curtin was installed into the
running system.  Check for the right location depending on what
files are found on the filesystem.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-06 22:09:08 -05:00
Ryan Harper fd3ddff832 Fix handling of empty disks and partitions for raid menu
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>
2015-10-05 10:56:59 -05:00
Ryan Harper 37be0c65ee Fix raid cancel, return to filesystem
Raid cancel quit, instead return to the filesystem view.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-05 08:49:39 -05:00
Ryan Harper dc48e976a6 Don't allow multiple devices to be bootable
- 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>
2015-10-02 13:49:10 -05:00
Ryan Harper 3666d47dad First cut on raid ux and model integration
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>
2015-10-01 19:03:54 -05:00
Adam Stokes 4494bcb6ca Merge pull request #60 from CanonicalLtd/geninstaller_find_source
Geninstaller find source
2015-09-30 16:10:46 -04:00
Ryan Harper 8cb8eddb19 geninstaller: try a bit harder to tar up subiquity installer
Subshell cd to source dir was silently failing.  Instead use
tar -C and add an additional check on that we did generate
a subiquity tarball for the installer image.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-30 14:19:02 -05:00
Ryan Harper f59187b290 runinstaller: Add format= qemu command
qemu doesn't like to probe formats, specify raw.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-30 14:02:50 -05:00
Ryan Harper 095d6b0644 Add info on how to enable multiverse for UEFI support
UEFI mode testing in VMs requires package from Multiverse:
  ovmf (license issue)

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-30 14:01:17 -05:00
Ryan Harper ac3fd86bb5 Remove offline mode for installer
Make offline mode default.  We always want to
install the packages required to run the installer in the
image we generate.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-30 12:58:11 -05:00
Ryan Harper 1ec30081f7 fix string assignment in runinstaller variable
Assign package string to variable correctly.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-30 12:49:06 -05:00
Ryan Harper a5e14bcad9 Always make subiquity-tui available in /usr/local/bin
The subiquity service always expects subiquity-tui to be in
/usr/local/bin.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-30 12:48:21 -05:00
Ryan Harper 6fe10c0a1a Make sure we tar up either in-tree or installed subuiquity source
We want geninstaller to acquire the subiquity source from either
the in-tree directories, or if running installed from a deb, the
path where it was installed.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-30 12:44:36 -05:00
Adam Stokes 55f1c30b24 Merge pull request #59 from CanonicalLtd/sign_deb_src_release
Change dpkg-build flags to sign source deb
2015-09-30 11:01:35 -04:00
Ryan Harper 8d7e9aca48 Change dpkg-build flags to sign source deb
Don't include -us -uc when creating deb source and dpkg will
actually sign the source package.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-30 09:57:49 -05:00
Adam Stokes 5102f943a7 Update README.md
Small typo that stood out because of the heading :)
2015-09-29 20:34:45 -04:00
raharper 8dd720eee8 Merge pull request #58 from CanonicalLtd/fix-runinstaller
Fix runinstaller to work after installed
2015-09-29 16:24:00 -05:00
raharper 349edfc7f5 Merge pull request #57 from CanonicalLtd/fix-show-disk-info
Fix is_root check on sudo
2015-09-29 16:23:42 -05:00
raharper 3dc2af13da Merge pull request #56 from CanonicalLtd/fix-tui-rename
Unbreak make and installer script with subiquity-tui rename
2015-09-29 16:23:28 -05:00
Ryan Harper aef1858e69 Unbreak make and installer script with subiquity-tui rename
After renaming bin/subiquity to bin/subiquity-tui we broke a
few things that invoked subiquity via bin/subiquity which is
now bin/subiquity-tui

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-29 16:17:00 -05:00
Ryan Harper ce133c6b06 Fix is_root check on sudo
Add debugging and logging for is_root check.
Fix up logic so we check if sudo_user is non None
Now we can see disk info when running as root in the installer.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-29 16:15:14 -05:00
Ryan Harper 141066c786 Fix runinstaller to work after installed
Cleanup runinstaller to be usable after install via package.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-29 15:55:07 -05:00
raharper 176e3727bc Merge pull request #55 from CanonicalLtd/fix-geninstaller-path
Fix geninstaller to be runnable outside of source tree
2015-09-29 09:59:30 -05:00
Ryan Harper 8b228d05a8 Fix geninstaller to be runnable outside of source tree
geninstaller, which is installed as /usr/bin/subiquity-geninstaller
needed some changes to allow it to run outside of the build tree.
Quieted the output from geninstaller a lot and redirect the verbosity
into the log file.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-29 09:56:47 -05:00
raharper d4f8394123 Merge pull request #54 from CanonicalLtd/documentation_v1
Update documentation on using subiquity
2015-09-29 09:10:13 -05:00
Ryan Harper 8342a654ae Update documentation on using subiquity
Expand on how to get and use subiquity.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-28 15:02:51 -05:00
Adam Stokes d488a9d1fa Dont let setuptools manage scripts
We handle our scripts through the Debian packaging.

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-09-28 14:42:19 -04:00
Adam Stokes 80ca9c1cae Merge pull request #52 from CanonicalLtd/fix-avail-disk-view
Don't display mounted disks except during dry-run
2015-09-28 14:04:54 -04:00
Adam Stokes d4aad9fab0 Merge pull request #51 from CanonicalLtd/switch-to-packages
Switch to packages
2015-09-28 14:04:48 -04:00
Ryan Harper f5aff668c5 Don't display mounted disks except during dry-run
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>
2015-09-28 11:28:26 -05:00
Adam Stokes b16374fa8e Rename to subiquity-tui for package install
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-09-28 11:20:22 -04:00
Adam Stokes a4f8bc9cf4 Merge pull request #50 from CanonicalLtd/patch-password-validate
Add password match validator
2015-09-28 11:05:55 -04:00
Adam Stokes c6628911d4 Add password match validator
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-09-28 11:03:01 -04:00
Adam Stokes b97e51d70a Merge pull request #49 from CanonicalLtd/patch-is_root-hdparm
Checks if run as root before accessing hdparm
2015-09-28 10:49:54 -04:00
Adam Stokes b0f7e29cde Checks if run as root before accessing hdparm
Fixes #46

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-09-28 10:45:54 -04:00
Ryan Harper 23d644037a Switch to single overlay dir
Instead of tracking many directories, we'll use only one
overlay directory to hold any scripts or change we want to
see applied over the base image.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-28 09:01:46 -05:00
Ryan Harper 4f344714f9 Use probert package from subiquity-dev ppa
Use the packaged version of probert.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-28 09:01:46 -05:00