kernel-image: minor refactoring to inspect_kernel()

Let's add make three arguments optional, by splitting inspect_kernel()
from inspect_kernel_full().

Let's also downgrade logging to debug, so that this becomes more
library-like. Let's log on the call-site instead.
This commit is contained in:
Lennart Poettering
2026-04-03 08:15:27 +02:00
committed by Lennart Poettering
parent 025762516f
commit d90d0a1f63
5 changed files with 30 additions and 20 deletions
+10 -1
View File
@@ -750,12 +750,21 @@ static int context_from_cmdline(Context *c, Action action) {
}
static int context_inspect_kernel(Context *c) {
int r;
assert(c);
if (!c->kernel)
return 0;
return inspect_kernel(c->rfd, c->kernel, &c->kernel_image_type, NULL, NULL, NULL);
r = inspect_kernel(
c->rfd,
c->kernel,
&c->kernel_image_type);
if (r < 0)
return log_error_errno(r, "Failed to inspect kernel image '%s': %m", c->kernel);
return 0;
}
static int context_ensure_layout(Context *c) {