Skip to content

Commit

Permalink
system/kernel: Find kernel in ostree case
Browse files Browse the repository at this point in the history
  • Loading branch information
travier committed May 30, 2024
1 parent 15f22aa commit 8d46a4b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions kiwi/system/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ def get_kernel(
filename=kernel_file,
version=version
)

boot_ostree_dir = os.sep.join([self.root_dir, 'boot/ostree'])
kernel_ostree_pattern = '.*/boot/ostree/.*/vmlinuz-(.*)'
if os.path.isdir(boot_ostree_dir):
for deployment in sorted(os.listdir(boot_ostree_dir)):
deployment_dir = os.sep.join([self.root_dir, 'boot/ostree', deployment])
if os.path.isdir(deployment_dir):
files = sorted(os.listdir(deployment_dir))
for f in files:
kernel_file = os.sep.join([self.root_dir, 'boot/ostree', deployment, f])
version_match = re.match(kernel_ostree_pattern, kernel_file)
if version_match:
version = version_match.group(1)
return kernel_type(
name=os.path.basename(
os.path.realpath(kernel_file)
),
filename=kernel_file,
version=version
)

if raise_on_not_found:
raise KiwiKernelLookupError(
'No kernel found in {0}, searched for {1}'.format(
Expand Down

0 comments on commit 8d46a4b

Please sign in to comment.