diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index 30e6915f..066a9fe2 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -224,21 +224,23 @@ class InstallController(SubiquityController): device_map = json.load(fp) self.app.controllers.Filesystem.update_devices(device_map) - @with_context(description="configuring OEM packages") async def pre_curthooks_oem_configuration(self, context): - # For OEM, we basically mimic what ubuntu-drivers does: - # 1. Install each package with apt-get install - # 2. For each package, run apt-get update using only the source - # installed by said package. - # 3. Run apt-get install again for each package. This will upgrade - # them to the version found in the OEM archive. + async def install_oem_metapackages(ctx): + # For OEM, we basically mimic what ubuntu-drivers does: + # 1. Install each package with apt-get install + # 2. For each package, run apt-get update using only the source + # installed by said package. + # 3. Run apt-get install again for each package. This will upgrade + # them to the version found in the OEM archive. - # NOTE In ubuntu-drivers, this is done in a single call to apt-get - # install. - for pkg in self.model.oem.metapkgs: - await self.install_package(package=pkg.name) + # NOTE In ubuntu-drivers, this is done in a single call to apt-get + # install. + for pkg in self.model.oem.metapkgs: + await self.install_package(package=pkg.name, context=ctx) + + if not self.model.network.has_network: + return - if self.model.network.has_network: for pkg in self.model.oem.metapkgs: source_list = f"/etc/apt/sources.list.d/{pkg.name}.list" await run_curtin_command( @@ -263,6 +265,14 @@ class InstallController(SubiquityController): for pkg in self.model.oem.metapkgs: await self.install_package(package=pkg.name) + if not self.model.oem.metapkgs: + return + + with context.child( + "install_oem_metapackages", "installing applicable OEM metapackages" + ) as child: + await install_oem_metapackages(child) + # If we already have a kernel installed, don't bother requesting # curthooks to install it again or we might end up with two # kernels.