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:
committed by
Lennart Poettering
parent
025762516f
commit
d90d0a1f63
@@ -5,14 +5,15 @@
|
||||
#include "alloc-util.h"
|
||||
#include "bootctl-uki.h"
|
||||
#include "kernel-image.h"
|
||||
#include "log.h"
|
||||
|
||||
int verb_kernel_identify(int argc, char *argv[], uintptr_t _data, void *userdata) {
|
||||
KernelImageType t;
|
||||
int r;
|
||||
|
||||
r = inspect_kernel(AT_FDCWD, argv[1], &t, NULL, NULL, NULL);
|
||||
r = inspect_kernel(AT_FDCWD, argv[1], &t);
|
||||
if (r < 0)
|
||||
return r;
|
||||
return log_error_errno(r, "Failed to inspect '%s': %m", argv[1]);
|
||||
|
||||
puts(kernel_image_type_to_string(t));
|
||||
return 0;
|
||||
@@ -23,9 +24,9 @@ int verb_kernel_inspect(int argc, char *argv[], uintptr_t _data, void *userdata)
|
||||
KernelImageType t;
|
||||
int r;
|
||||
|
||||
r = inspect_kernel(AT_FDCWD, argv[1], &t, &cmdline, &uname, &pname);
|
||||
r = inspect_kernel_full(AT_FDCWD, argv[1], &t, &cmdline, &uname, &pname);
|
||||
if (r < 0)
|
||||
return r;
|
||||
return log_error_errno(r, "Failed to inspect '%s': %m", argv[1]);
|
||||
|
||||
printf("Kernel Type: %s\n", kernel_image_type_to_string(t));
|
||||
if (cmdline)
|
||||
|
||||
Reference in New Issue
Block a user