Commit Graph

5513 Commits

Author SHA1 Message Date
Dan Bungert 6134d3d3df filesystem: expand side by side unittest for gpt 2022-08-11 13:15:15 -06:00
Dan Bungert fe46f3ce39 filesystem: refactor guided related methods 2022-08-11 13:15:15 -06:00
Dan Bungert fe0745a83e gaps: move gaps.within() to method 2022-08-11 13:15:15 -06:00
Olivier Gayot 319259f6ac ubuntu-pro: spell "how to register" consistently
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-11 11:29:23 +02:00
Olivier Gayot 324ff0bc8f Merge pull request #1372 from ogayot/FR-2475
install: invoke curtin multiple times with different stages
2022-08-11 11:11:51 +02:00
Olivier Gayot 10f570394e install: write logs and error-file to a single known location
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-11 09:44:26 +02:00
Olivier Gayot 559b904f54 install: don't run curtin install for hook stage
The hook stage does not do anyting in Ubuntu. Let's skip it.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-11 09:24:09 +02:00
Olivier Gayot 4c70b78fba install: invoke curtin multiple times with different stages
We now invoke curtin install in a step-by-step mode. Before, we would
perform a single invocation of curtin install for the following stages:

 * early (but no early_commands configured)
 * partitioning
 * extract
 * curthooks
 * hook
 * late (but no late_commands configured)

We now run multiple invocations of curtin install, in 5 different steps:

 * initial: does not run any stage per se but prepares curtin
   for the next invocations (this invocation is not strictly necessary
   and could be merged with the next step but having it separate makes
   the flow easier to understand, I think)
 * partitioning: runs the partitioning stage
 * extract: runs the extract stage
 * curthooks: runs the curthooks stage

The early and late stages were dropped since they would act as no-ops.
We also dropped the hook stage since it does nothing in Ubuntu.

The configuration files for each step ends up in
/var/log/installer/curtin-install/subiquity-{step_name}.conf

The log files for each step end up in
/var/log/installer/curtin-install/{step_name}.log

If errors occur, a tarball of the necessary logs end up in
/var/log/installer/curtin-install/{step_name}-error.tar

All files (i.e. configuration files, log files, error-files) are bundled
in the apport report in case of crash.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-11 09:16:06 +02:00
Olivier Gayot 5151dc76ee
Merge pull request #1381 from ogayot/FR-2594
Execute run-parts on /etc/subiquity/postinst.d before executing any other late_commands
2022-08-10 17:39:54 +02:00
Dan Bungert b2510de9a1
Merge pull request #1384 from dbungert/fsobj-ids-v2
filesystem: part ids are not part nums
2022-08-09 17:26:04 -06:00
Dan Bungert 5fcd6776c1 filesystem: part ids are not part nums
The filesystem object IDs are really only meant to be a semireadable
unique string, and not for display to end users.  Partitions in
particular were bad in this respect, as they could look like the number
on the end was the partition number.

Uglify the object IDs a bit to try to convey the above.
2022-08-09 16:32:36 -06:00
Dan Bungert 54531c242b
Merge pull request #1379 from dbungert/guided-create-logical
filesystem: guided creates logicals if in_extended
2022-08-09 11:48:59 -06:00
Dan Bungert 60378fc7bf filesystem: guided creates logicals if in_extended 2022-08-09 11:23:53 -06:00
Dan Bungert 8841807104 gap: respect ebr_space 2022-08-09 10:28:21 -06:00
Dan Bungert f67c6f9d2a
Merge pull request #1378 from dbungert/boot-respect-primaries
boot: fix too many primaries case
2022-08-09 08:19:51 -06:00
Olivier Gayot 483529d935
Merge pull request #1361 from jpnurmi/setxkbmap
Run setxkbmap as the ubuntu user
2022-08-09 16:04:27 +02:00
J-P Nurmi 9ce42f3bc1 Run setxkbmap as the ubuntu user
This is a partial fix to canonical/ubuntu-desktop-installer#832. The
last missing piece is to set the DISPLAY environment variable but this
can be done in the subiquity startup script in UDI.
2022-08-09 15:55:36 +02:00
Olivier Gayot 8785d8ffc1 cmdlist: use shlex to get a user friendly repr. of a cmd
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-09 09:47:26 +02:00
Olivier Gayot 34d4acd264 hooks: execute hook scripts as builtin late commands
When executing late commands, we now start by executing run-parts over
the /etc/subiquity/postinst.d directory (by default) if it exists.

A failure in run-parts is not considered critical so any other
late_commands will run no matter what.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-09 09:47:26 +02:00
Olivier Gayot e33640371b cmdlist: refactorize early/late/error commands
A new class called Command is introduced. A Command instance has
arguments (i.e., either a string or an sequence of strings) and a
boolean called "check" that tells if an error should stop the
installation.

A Command instance also has helper methods to simplify its usage.

The early/late/error command controllers now have a sequence of Command
instances.

When loaded from an autoinstall config, the commands inherit the value
of the "check" attribute from the controller itself.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-09 09:35:06 +02:00
Olivier Gayot 9db6a0e658 snapcraft: bump version of curtin to bring step-by-step install
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-09 09:04:31 +02:00
Dan Bungert 29c12fb152
Merge pull request #1380 from dbungert/udi-keyboard-layouts
kbds: add layout info for u-d-i
2022-08-08 10:29:54 -06:00
Dan Bungert 3b8b618d8b kbds: add entries for UDI 2022-08-08 07:54:09 -06:00
Dan Bungert cfb95df343 kbds: sort&normalize keyboard-configuration.yaml 2022-08-08 07:53:42 -06:00
Dan Bungert d5e739a79b boot: fix too many primaries case 2022-08-05 16:05:54 -06:00
Dan Bungert 434d90bbd3 filesystem: remove is_primary
This was used in one place, and was misleading.
2022-08-05 16:05:04 -06:00
Olivier Gayot 542ca36c1f
Merge pull request #1375 from ogayot/FR-2399
source: allow to specify source ID in autoinstall config
2022-08-04 11:15:26 +02:00
Olivier Gayot 3ca78bf07b source: explain why the autoinstall data can be null/None
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-04 10:58:59 +02:00
Olivier Gayot 566f32b01e source: don't mark search_drivers required
In the source autoinstall section, the search_drivers key was marked
required. This made sense at the time when it was the only supported
key. However, now that we also support the source ID, we don't want
to force the user to supply search_drivers as well.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-04 10:58:59 +02:00
Olivier Gayot 0c73bf9b86 source: add ability to select source in autoinstall
The source autoinstall section now supports the "id" field where the
user can supply the ID of a source, e.g., "ubuntu-server" or
"ubuntu-server-minimal".

If the field is not supplied, the installation will use the source
declared default: true (if any) in the source catalog. Otherwise, it the
first source declared will be used.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-04 10:58:59 +02:00
Olivier Gayot 4658247542
Merge pull request #1376 from ogayot/ubuntu-pro-missing-return
ubuntu-pro: fix missing return statement
2022-08-03 20:50:41 +02:00
Dan Bungert 4a4828934f
Merge pull request #1373 from dbungert/no-esp-on-logical
boot: do not place an ESP on a logical part
2022-08-03 09:40:56 -06:00
Dan Bungert ea712d8e6e filesystem: fix test extended partsize assumptions 2022-08-03 09:21:51 -06:00
Dan Bungert 6f523b4568 boot: do not place an ESP on a logical part 2022-08-03 09:21:08 -06:00
Olivier Gayot a3b0c48426 ubuntu-pro: fix missing return statement
The function is_token_added_overlay supposedly returns a boolean. But
the absence of a final return False statement made it return None by
accident.

In practice, it should not make a difference because returning False or
None evaluate to False in a boolean context. But returning False is
cleaner (sorry Perl).

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-03 14:55:39 +02:00
Michael Hudson-Doyle 5c0e8bf8f2
Merge pull request #1374 from dbungert/curtin-kname
curtin: rev for kname fix
2022-08-03 09:06:48 +12:00
Dan Bungert 0707dae62e curtin: rev for kname fix 2022-08-02 09:15:35 -06:00
Dan Bungert 5378b5298c
Merge pull request #1370 from dbungert/keyboard-scraper
keyboard: layout data & generation script
2022-08-01 17:17:46 -06:00
Dan Bungert cb251acfaf
Merge pull request #1347 from blackboxsw/cloud-init/emit-clean-script
cloud_init_files: render a clean script to /etc/cloud/clean.d
2022-08-01 15:22:39 -06:00
Olivier Gayot c59a116f5d curtin-replay: update expected syslog identifier for curtin log lines
In the past, curtin log lines had the syslog identifier matching
"curtin_log.xxx". Nowadays, curtin commands are started via
systemd-run so they end up inheriting from the default
"subiquity_log.xxx" syslog identifier.

When updating the examples/curtin-*.json files, one must make sure to
filter out the entries that have the "subiquity_log.xxx" but are not
related to curtin invocations.

In the future, maybe we need to consider overriding the syslog
identifier when invoking curtin commands.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-01 09:26:12 +02:00
Olivier Gayot 3efed0e211 curtin-replay: improve CLI of replay-curtin-log
We now use argparse on replay-curtin-log, which provides the --help
option along with named parameters for what used to be positional
parameters only.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-01 09:26:11 +02:00
Dan Bungert 450b65601a update languagelist and layout suggestions 2022-07-29 14:13:27 -06:00
Dan Bungert 73e4ee6fe5 keyboards: include layout config file in snap 2022-07-29 14:02:45 -06:00
Dan Bungert afb8099f66 keyboard: load suggestions from file 2022-07-29 13:01:26 -06:00
Dan Bungert 271a1b2d29 scripts: add keyboard-scraper.sh
This script runs keyboard-configuration.config in a chroot.  By running
interesting locales against it, we can obtain keyboard suggestions.
2022-07-29 13:01:18 -06:00
Dan Bungert d1dc7d4844
Merge pull request #1368 from dbungert/default-kb-from-lang
keyboard: lookup layout & variant from language
2022-07-27 18:18:37 -06:00
Dan Bungert dbb8be4e72 keyboard: suggest language / variant for locale 2022-07-27 17:23:42 -06:00
Dan Bungert 7bb4a1a5f3 keyboard: restructure unit test for async 2022-07-27 17:23:42 -06:00
Michael Hudson-Doyle 57fb6b8072
Merge pull request #1366 from mwhudson/lp-1982903
add .path to Raid so for_client(raid-with-partitions) works
2022-07-28 09:25:41 +12:00
Dan Bungert 6b13c84e4c
Merge pull request #1354 from dbungert/ptable-msdos-more-betterification
filesystem: logical part numbering and related
2022-07-27 09:05:19 -06:00