From 41b9e144213443ff9c2b4a1c10e1d60ae04f6003 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Wed, 3 Jan 2024 16:09:25 +0100 Subject: [PATCH] ubuntu-core-initramfs: Fix discovery of compressed modules Now modules are compressed and have extension .ko.zstd. We need to ignore the compression extension. The module database was not properly generated, and was causing spurious error messages. (That database is only to find errors). --- bin/ubuntu-core-initramfs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/ubuntu-core-initramfs b/bin/ubuntu-core-initramfs index 3e90542d..535ea921 100755 --- a/bin/ubuntu-core-initramfs +++ b/bin/ubuntu-core-initramfs @@ -80,9 +80,13 @@ class ModuleDb: for root, dirs, files in os.walk(module_path): for f in files: - name, ext = os.path.splitext(f) - if ext == '.ko': - self._modules[name] = ModuleDb.ModuleInfo(False, [], []) + if f.endswith('.ko'): + name, _ = os.path.splitext(f) + elif '.ko.' in f: + name, _ = f.split('.ko.', maxsplit=1) + else: + continue + self._modules[name] = ModuleDb.ModuleInfo(False, [], []) for alias, target in ModuleDb.__each_alias(os.path.join(module_path, "modules.alias")): try: