Commit Graph

4808 Commits

Author SHA1 Message Date
Olivier Gayot caff5f7dd7 source: add support for autoinstall data
Since we added a search_drivers checkbox that is uncheckd by default,
there is no longer a way for users to install third-party drivers in an
autoinstall context.

We now implement the autoinstall support for source so that users can
specify what value they want for search_drivers.

Futhermore, to be backward compatible with existing autoinstall
configurations, we now make search_drivers default to true in
autoinstall contexts.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 8929197010 drivers: include source.search_drivers in GET /drivers
The search_drivers attribute is set at the source model level, not at
the the drivers model level.

Having said that, by adding its value in the response to GET /drivers,
we can avoid doing multiple HTTP calls in the make_ui function.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 79326cf2eb source: run answers when only one source is configured
Before, we would not run answers for the source controller if only one
source was specified. The controller would automatically get marked
configured.

Since we're adding a new "search drivers" option in this screen, we need
to make it interactive in integration tests now.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 5a4b66553c drivers: add button to go back when no drivers are available
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 6a2e8b6a49 drivers: show different words when online vs offline
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot d6048a6914 drivers: use radio buttons instead of checkbox to install drivers
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 595254159e source: use lazy string interpolation
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 57d5aef575 source: prevent to skip the drivers screen but allow to go back
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot 1ffff94eff drivers: show the drivers screen only if search drivers was checked
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Olivier Gayot c76a8f23e3 source: give the option to search for third-party drivers
The source screen now includes a checkbox that makes Subiquity search
for third-party drivers in a later stage.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Michael Hudson-Doyle 800801b7d0
Merge pull request #1280 from mwhudson/v2-boot-part-plan
make "can this be a boot partition" use v2 capabilities
2022-04-26 12:45:59 +12:00
Michael Hudson-Doyle 5fcf134408 fix parameterization parameters 2022-04-26 10:47:05 +12:00
Dan Bungert 0d0a922b28
Merge pull request #1283 from dbungert/gitignore
gitignore: .tags, .mypy
2022-04-25 08:14:00 -06:00
Dan Bungert f9b851533b
Update .gitignore
Co-authored-by: Olivier Gayot <duskcoder@gmail.com>
2022-04-25 07:23:01 -06:00
Olivier Gayot f75d80911b
Merge pull request #1282 from ogayot/tests-no-sh-c
tests: consistently run Subiquity commands
2022-04-25 11:14:46 +02:00
Dan Bungert 21d1bd29e1 gitignore: .tags, .mypy 2022-04-22 14:42:22 -06:00
Olivier Gayot fdd3ffdfa8 tests: use consistent order for subiquity cmdlines
In order we place:
 * the arguments that are for client & server
 * the arguments for the client only
 * the arguments for the server only

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-22 11:41:34 +02:00
Olivier Gayot 5d3e0b4675 tests: pass the subiquity commands directly without sh -c ''
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-22 11:34:48 +02:00
Olivier Gayot 3f07ca1b1b
Merge pull request #1266 from ogayot/FR-2237
Fix storage screen sometimes not refreshing after slow probing
2022-04-22 10:52:37 +02:00
Olivier Gayot 6ad9127300
Merge pull request #1272 from ogayot/LP1968729
drivers: prevent client crash if GET /drivers is closed from client side
2022-04-22 10:51:48 +02:00
Didier Roche 6d669b12d1
Merge pull request #1281 from CarlosNihelton/deeng-217-fix-syslog-wsl
Fix WSL crash on autoinstall due attempts to log to systemd journal
2022-04-21 14:15:11 +02:00
Carlos Nihelton f5e8fafdd4
Fix WSL crash on autoinstall due systemd-cat
EarlyController was still logging to systemd journal for WSL.
2022-04-21 08:51:06 -03:00
Olivier Gayot 962ea117c4 test/api: rely on drivers endpoint to block until APT is configured
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-21 11:54:37 +02:00
Michael Hudson-Doyle 2bd8a7281b add python3-parameterized to apt-deps.txt 2022-04-21 16:38:06 +12:00
Michael Hudson-Doyle bd1b284717 delete invalid test and code it required 2022-04-21 16:30:24 +12:00
Michael Hudson-Doyle 25d6079cd0 make boot part planning for UEFI & PREP v2-aware 2022-04-21 16:30:23 +12:00
Michael Hudson-Doyle ab7cb55a07 finally give up and use a test parameterization library 2022-04-21 16:29:43 +12:00
Michael Hudson-Doyle c313274566 add back a bit of v1 compatibility 2022-04-21 16:28:57 +12:00
Michael Hudson-Doyle dd25528712 make get_boot_device_plan_bios v2 compatible 2022-04-21 16:28:57 +12:00
Dan Bungert 6f5a0fdb15
Merge pull request #1278 from ogayot/lp-1969393-revert
Revert "Move to aiohttp for GeoIP requests"
2022-04-20 12:59:15 -06:00
Olivier Gayot 413cc87337 Revert "Move to aiohttp for GeoIP requests"
This reverts commit ebdf1db636.
2022-04-20 20:53:27 +02:00
Didier Roche 82776fdb63
Merge pull request #1277 from CarlosNihelton/deeng-216-fix-lang-tui
Sets with the prefilled language before starting controllers
2022-04-20 15:13:51 +02:00
Carlos Nihelton 940fceac33
Removes empty line in the end of file 2022-04-20 09:16:40 -03:00
Carlos Nihelton 8201e917c3
Sets with the prefilled language before starting controllers
TUI client was able to GET() the language before it was set with the prefilled option in production
2022-04-20 09:10:21 -03:00
Dan Bungert 30745e522f
Merge pull request #1275 from dbungert/v2-reformat-msdos
v2/reformat: accept ptable argument
2022-04-19 07:28:52 -06:00
Dan Bungert b8d9b5b141
Merge pull request #1273 from dbungert/snap-metadata
snapcraft: set source-code and issues fields
2022-04-18 19:14:58 -06:00
Dan Bungert f44fc5f39d
Merge pull request #1274 from dbungert/fix-guided-direct
Fix guided direct
2022-04-18 17:04:53 -06:00
Dan Bungert 3dcf213f60 partition: msdos table tests
Yes, MSDOS + BIOS does in fact boot just fine without the spacer.
2022-04-18 15:47:43 -06:00
Dan Bungert 3d8f1675a4 partition: fix offset of added partition
A scenario that should happen nearly always for guided direct, when we
add_boot_disk from partition_disk_handler we must update the gap or the
target partition is at the wrong offset.
2022-04-18 15:47:43 -06:00
Dan Bungert fbf4ea863e v2/reformat: accept ptable argument
Move storage/v2/reformat_disk to body instead of query args.
Add optional ptable arg, which can be used to format to a msdos table.
2022-04-15 13:54:26 -06:00
Dan Bungert 4418f4ebab filesystem: make it easier to create for unit test
In production use, start() will initialize this to the correct value.
2022-04-15 10:23:33 -06:00
Dan Bungert bd6647d6ec snapcraft: set source-code and issues fields 2022-04-14 14:02:21 -06:00
Dan Bungert 7310658de6 test/api: add drivers cancel test 2022-04-14 12:05:46 -06:00
Dan Bungert e9f3abc360
Merge pull request #1269 from dbungert/v2-delete
storage/v2: permit delete with storage-version=2
2022-04-14 09:45:22 -06:00
Olivier Gayot bacbe5d4bb drivers: prevent client crash if GET /drivers is closed from client side
When a HTTP client sends a query but closes the socket before an answer
is received,  aiohttp signals it on the server end by raising an
asyncio.CancelledError in the associated query handler.

By default, when a task is cancelled with asyncio, the task(s) that it
is currently awaiting on are cancelled as well.

The GET handler for /drivers?wait=true awaits on the "list drivers"
task. Therefore, if the GET handler gets cancelled, so will be the "list
drivers" task.

When that happens, any subsequent call to GET /drivers?wait=true will
make the server raise an asyncio.CancelledError because the "list
drivers" task has already been cancelled. This results in:

 * the socket being closed from the server end
 * an aiohttp.client_exceptions.ServerDisconnectedError exception raised
   on the client end. This type of exception is unhandled and makes the
   client crash.

Fixed by preventing the "list drivers" task from being cancelled when
the GET /drivers query handler gets cancelled.

https://bugs.launchpad.net/subiquity/+bug/1968729

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-14 15:48:25 +02:00
Michael Hudson-Doyle c101e63521
Merge pull request #1268 from mwhudson/translations-update
update translations from https://translations.launchpad.net/subiquity
2022-04-14 11:58:23 +12:00
Dan Bungert 9ba3ef52f8
Merge pull request #1263 from dbungert/lp-1968160
filesystem: going back to guided also does reset
2022-04-13 17:04:56 -06:00
Dan Bungert 569335ef81 storage/v2: permit delete with storage-version=2
On preserved disks, we can now allow partition deletes without requiring
a wholesale format of the disk, if using storage-verison=2.
2022-04-13 16:27:26 -06:00
Michael Hudson-Doyle a2dbc23a4b update from newer export 2022-04-14 10:02:51 +12:00
Olivier Gayot cb132611c2 ui: get rid of unreachable else block
The following commit added an unconditional return statement in the try
block of _move_screen, effectively making the associated else block
unreachable.

  a7bcc7fa add a way to wait for something with notification after 0.1s

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-13 18:34:46 +02:00