do not display a message about OEM configuration if no metapackages

This commit is contained in:
Michael Hudson-Doyle 2023-08-03 08:36:19 +12:00
parent d2f3db6463
commit 81bad123d0
1 changed files with 22 additions and 12 deletions

View File

@ -224,8 +224,8 @@ class InstallController(SubiquityController):
device_map = json.load(fp) device_map = json.load(fp)
self.app.controllers.Filesystem.update_devices(device_map) self.app.controllers.Filesystem.update_devices(device_map)
@with_context(description="configuring OEM packages")
async def pre_curthooks_oem_configuration(self, context): async def pre_curthooks_oem_configuration(self, context):
async def install_oem_metapackages(ctx):
# For OEM, we basically mimic what ubuntu-drivers does: # For OEM, we basically mimic what ubuntu-drivers does:
# 1. Install each package with apt-get install # 1. Install each package with apt-get install
# 2. For each package, run apt-get update using only the source # 2. For each package, run apt-get update using only the source
@ -236,9 +236,11 @@ class InstallController(SubiquityController):
# NOTE In ubuntu-drivers, this is done in a single call to apt-get # NOTE In ubuntu-drivers, this is done in a single call to apt-get
# install. # install.
for pkg in self.model.oem.metapkgs: for pkg in self.model.oem.metapkgs:
await self.install_package(package=pkg.name) 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: for pkg in self.model.oem.metapkgs:
source_list = f"/etc/apt/sources.list.d/{pkg.name}.list" source_list = f"/etc/apt/sources.list.d/{pkg.name}.list"
await run_curtin_command( await run_curtin_command(
@ -263,6 +265,14 @@ class InstallController(SubiquityController):
for pkg in self.model.oem.metapkgs: for pkg in self.model.oem.metapkgs:
await self.install_package(package=pkg.name) 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 # If we already have a kernel installed, don't bother requesting
# curthooks to install it again or we might end up with two # curthooks to install it again or we might end up with two
# kernels. # kernels.