Commit Graph

5135 Commits

Author SHA1 Message Date
Didier Roche 32fb73b4eb
Merge pull request #1259 from canonical/wsl_remove_systemd
Wsl remove systemd
2022-04-07 11:06:12 +02:00
Jean-Baptiste Lallement a3a21da408 Removed systemd from the UI
We won't ship systemd officially in 22.04, hence remove it from the UI.
However it's still there and distributed and can be enabled manually.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2022-04-07 10:55:30 +02:00
Jean-Baptiste Lallement 9ff8e10ef5 Do not run apt update in dry-run mode
update requires root access to the machine and there is no --simulate
option so skip it in dry-run mode.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2022-04-07 10:54:18 +02:00
Didier Roche 3deddf76ed
Merge pull request #1258 from CarlosNihelton/fix-snap-path
Ensures snap_dir='/' if not better specified.
2022-04-07 09:06:15 +02:00
Carlos Nihelton d3e2544875
Ensures snap_dir='/' if not better specified.
UDI sets the SNAP env var to '.' for development purposes.

See: https://github.com/canonical/ubuntu-desktop-installer/commit/9eb6f04

It is unlikely that under test or production that env var will
ever by just '.'. On the other hand in dry-run we want this controller
to interpret it as '/' if not properly set, thus discarding the '.'.
2022-04-06 13:25:35 -03:00
Olivier Gayot f3634dc242 Add type hints where necessary to make mypy happy
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-06 11:23:34 +02:00
Olivier Gayot 56192938a9 network: fixed typo addressesses -> addresses
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-06 11:23:10 +02:00
Didier Roche 1b7ab29e25
Merge pull request #1256 from CarlosNihelton/autoinstall-tui-cli
Enables passing the autoinstall CLI to the server.
2022-04-06 08:46:41 +02:00
Carlos Nihelton c2b6be3cd3
Enables passing the autoinstall CLI to the server.
The server was prepared to receive this CLI option.
TUI was not. When not in dry-run that option had no effect.
2022-04-05 18:12:47 -03:00
Olivier Gayot be9a064c0a
Merge pull request #1254 from ogayot/raid-lvm-enable-eval-once
filesystem: evaluate only once the status of the raid / LVM creation buttons
2022-04-05 16:06:28 +02:00
Olivier Gayot c8c5eb501c filesystem: evaluate only once the status of the raid / LVM creation button
When refreshing the filesystem GUI, we used to set the status (i.e.,
enabled or disabled) of the "Create LVM volume group" and "Create
software RAID" buttons multiple times ; once for each disk found.

When multiple disks are listed, this creates intermediate status changes
that are not wanted, e.g.:
 * "Create software RAID" button gets set to disabled after finding a first
unpartitioned disk ;
 * "Create software RAID" button is set again to disabled after finding
   a partitioned disk (with no unmounted partitions) ;
 * "Create software RAID" button is set to enabled after finding a
   second unpartitioned disk.

Fixed by evaluating the status of the buttons only once after looping
through all disks.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-05 11:42:15 +02:00
Michael Hudson-Doyle ce4316fc23 move partitions around on deletion and resize 2022-04-01 16:04:26 +13:00
Michael Hudson-Doyle f24f508796 use movable_trailing_partitions_and_gap_size to compute max_size in PartitionStretchy 2022-04-01 15:56:43 +13:00
Michael Hudson-Doyle f4cd20446a change api to return size, not gap 2022-04-01 15:55:00 +13:00
Michael Hudson-Doyle ebeda433ad teach gaps.movable_trailing_partitions_and_gap about preserved partitions 2022-04-01 15:44:47 +13:00
Michael Hudson-Doyle f8e30f7125 teach gaps.movable_trailing_partitions_and_gap about logical/extended partitions 2022-04-01 15:33:55 +13:00
Michael Hudson-Doyle 0d1f1e2d3c very bare bones version of gaps.movable_trailing_partitions_and_gap 2022-04-01 15:11:39 +13:00
Michael Hudson-Doyle 1e833a5402
Merge pull request #1232 from mwhudson/boot-part-plan
Combine "can this be" and "make this a" boot disk logic
2022-03-31 12:54:22 +13:00
Michael Hudson-Doyle 53bb482541 fix test_v2_add_boot_partition to pass a current gap 2022-03-31 12:47:02 +13:00
Michael Hudson-Doyle f16648b656 make add_boot_disk tests more readable and less repetitive 2022-03-31 12:30:37 +13:00
Michael Hudson-Doyle 58d9670372 refuse to add a boot partition if it means shrinking a partition by more than 50% 2022-03-31 12:30:37 +13:00
Michael Hudson-Doyle fd0a7954e4 do checks for misplaced preserved partitions in validators 2022-03-31 12:30:37 +13:00
Michael Hudson-Doyle 2c942ae9ee factor out common bits of get_boot_device_plan_prep and get_boot_device_plan_uefi 2022-03-31 12:30:37 +13:00
Michael Hudson-Doyle 5e6c845b89 add some typing stuff and docstrings 2022-03-31 12:30:37 +13:00
Michael Hudson-Doyle 6cc1f50af0 Combine "can this be" and "make this a" boot disk logic for PREP
As this is the last bootloader implementation to be folded into this
style, this includes some additional cleanup.
2022-03-31 12:30:37 +13:00
Michael Hudson-Doyle 4108c5e581 Combine "can this be" and "make this a" boot disk logic for UEFI
This one does change behaviour in that if it has to resize a partition
to make room for the ESP it puts it before the partition, not after.
This lets us put an assertion back in an API test.
2022-03-31 12:30:37 +13:00
Michael Hudson-Doyle dfc4a32b0a Combine "can this be" and "make this a" boot disk logic for BIOS
No behaviour change yet, this all assumes version 1 partitioning, i.e.
no mix of new and old partitions on a device. But it means we only have
to edit one batch of logic when that stops being true.
2022-03-31 12:30:37 +13:00
Dan Bungert c226d4e2b5
Merge pull request #1219 from dbungert/offsets-and-stretchy
Offsets and stretchy
2022-03-30 16:46:09 -06:00
Dan Bungert 8c6888f775 ui/filesystem: PartitionStretchy require keyword
A useful concept in other areas of partition / gap handling has to
require a keyword for specifying if we're sending gap or a partition.
Implement that here for the partition and gap keywords, and also on the
downstream partition_disk_handler.
2022-03-30 16:26:26 -06:00
Dan Bungert 8596ea96f1
Merge pull request #1248 from dbungert/no-largest-gap-size
disk: drop free_for_partitions
2022-03-30 16:23:52 -06:00
Dan Bungert e78b3fa089 disk: drop free_for_partitions 2022-03-30 16:09:32 -06:00
Dan Bungert 55fb68fa6e
Merge pull request #1245 from dbungert/v2-add-part-need-gap
storage/v2: add_partition takes a gap arg
2022-03-30 14:04:20 -06:00
Dan Bungert 868e272de2 test/api: better test_use_free_space_after_existing 2022-03-30 11:26:12 -06:00
Dan Bungert ce321526f6 storage/v2: add_partition takes a gap 2022-03-30 11:14:16 -06:00
Dan Bungert 3c0814897e storage/v2: enable test using space at end 2022-03-30 10:11:17 -06:00
Dan Bungert efd62ea380
Merge pull request #1243 from dbungert/add-part-require-offset
filesystem: add_partition requires offset
2022-03-30 09:39:34 -06:00
Dan Bungert 5e463d2a45
Merge pull request #1241 from dbungert/lp-1965110
probert: use os-prober only if asked
2022-03-29 15:18:54 -06:00
Dan Bungert a3e1cfa6e4 probert: implement os prober arg 2022-03-29 15:09:21 -06:00
Dan Bungert 9829c14e6e probert: update for 'os' probe_type 2022-03-29 15:09:21 -06:00
Dan Bungert 3fb16487cf
Merge pull request #1246 from dbungert/faster-curtin-replay-tests
Faster curtin replay tests
2022-03-24 13:37:59 -06:00
Dan Bungert d4e755c0e9 command runner: prefer term allowlist 2022-03-24 11:53:15 -06:00
Dan Bungert 407d87d8bb command runner: allow SUBIQUITY_REPLAY_TIMESCALE
SUBIQUITY_REPLAY_TIMESCALE should be passed to replay-curtin-log.py,
which speeds up test_server_flow (11s -> 2s), and probably others.

For the unit test, by clearing the environment and using a known set,
we can avoid having to keep a second copy of the allow list in test.
2022-03-24 11:52:35 -06:00
Didier Roche 689a7fd5f1
Merge pull request #1244 from CarlosNihelton/deeng-199-fix-wsl-apt
Removes apt python library from system_setup
2022-03-23 06:59:51 +00:00
Carlos Nihelton ef18564eca
Cleans comments and adresses test.
- Under dry-run apt is run with --simulate.
- That can still fail if a package does not exist, for instance.
- If so, a file will not be written.
2022-03-22 19:41:37 -03:00
Carlos Nihelton c9f90dffb3
Fix stylistic flake8 warnings. 2022-03-22 18:04:37 -03:00
Carlos Nihelton f4a2b916a7
Removes dependency on apt python lib.
It seemed far too much complicated find the proper way to deal with
apt Python library under the snap environment.

Opted for running the system apt command without the LD_*
customisations, similar to what an installer does when chroot into the
taget system.
2022-03-22 17:50:54 -03:00
Carlos Nihelton a950d9e98f
Removes __recomended_language_packs() env argument
That function will not require a custom environment.
Also simplified snap_dir variable assignment.
2022-03-22 17:47:53 -03:00
Carlos Nihelton a36120e0bb
apply_locale() and create_user() accept custom env
This allows for running subprocess outside of the snap environment.
Both functions now receive a custom env without the LD_ related vars.
Renamed _create_user() to create_user() to make explicit that it has the
same semantic level as apply_locale().
2022-03-22 17:46:25 -03:00
Dan Bungert d2c7a21fc2 filesystem: add_partition requires size as keyword
Goal is to reduce ambiguity in reading calls.
2022-03-22 13:48:41 -06:00
Dan Bungert 36241271a5 filesystem: add_partition requires an offset 2022-03-22 13:42:35 -06:00