From 19134b1f31ba457113bca53000f0ba5fca002413 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 18 Jul 2023 16:07:16 +1200 Subject: [PATCH] oem: check variant before waiting for apt configuration because if we add support for variant == 'core' (spoilers!), then apt may never be configured. --- subiquity/server/controllers/oem.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/subiquity/server/controllers/oem.py b/subiquity/server/controllers/oem.py index 283a4d7d47..7ed24608fa 100644 --- a/subiquity/server/controllers/oem.py +++ b/subiquity/server/controllers/oem.py @@ -69,6 +69,10 @@ def __init__(self, app) -> None: self.kernel_configured_event = asyncio.Event() def start(self) -> None: + self._wait_confirmation = asyncio.Event() + self.app.hub.subscribe( + InstallerChannels.INSTALL_CONFIRMED, + self._wait_confirmation.set) self._wait_apt = asyncio.Event() self.app.hub.subscribe( InstallerChannels.APT_CONFIGURED, @@ -121,8 +125,8 @@ async def wants_oem_kernel(self, pkgname: str, @with_context() async def load_metapackages_list(self, context) -> None: - with context.child("wait_apt"): - await self._wait_apt.wait() + with context.child("wait_confirmation"): + await self._wait_confirmation.wait() # Only look for OEM meta-packages on supported variants and if we are # not running core boot. @@ -138,6 +142,9 @@ async def load_metapackages_list(self, context) -> None: self.model.metapkgs = [] return + with context.child("wait_apt"): + await self._wait_apt.wait() + apt = self.app.controllers.Mirror.final_apt_configurer try: async with apt.overlay() as d: