From 6098bd3bcb701f6ac3cbac9e4598d65b409f8abc Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Wed, 14 Feb 2024 20:05:54 +0100 Subject: [PATCH] kernel: make get_image_version() work for rpm At some point in the past, the layout of the rpm package has changed. There is no file matching "/boot/vmlinuz-" there anymore, instead there is "vmlinuz" file at the root of the modules directory. For reference: deb: -rw-r--r-- root/root 11527168 2024-02-13 16:25 ./boot/vmlinuz-6.8.0-rc4-ga64ccd305b28 -rw-r--r-- root/root 72614 2024-02-13 16:25 ./lib/modules/6.8.0-rc4-ga64ccd305b28/modules.order rpm: /lib/modules/6.8.0-rc4-ga64ccd305b28/modules.order /lib/modules/6.8.0-rc4-ga64ccd305b28/vmlinuz Signed-off-by: Ilya Dryomov --- teuthology/task/kernel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index 70d49059c..ca4718784 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -1033,8 +1033,9 @@ def get_image_version(remote, path): raise UnsupportedPackageTypeError(remote) for file in files.split('\n'): - if '/boot/vmlinuz-' in file: - version = file.split('/boot/vmlinuz-')[1] + match = re.search('/lib/modules/(.*)/modules\.order$', file) + if match: + version = match.group(1) break log.debug("get_image_version: %s", version) -- 2.47.3