1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00

portable: when logging about attaching, include the used profile

Useful information to have in the logs.

Mar 14 16:45:27 H systemd-portabled[510]: Successfully attached ephemeral '/usr/share/minimal_0.raw' and its extension(s) '/usr/share/app0.raw' using profile 'default'
This commit is contained in:
Luca Boccassi 2024-03-14 16:52:21 +00:00 committed by Luca Boccassi
parent 681b1645b4
commit e82131bf7f

View File

@ -1473,6 +1473,7 @@ static void log_portable_verb(
const char *verb,
const char *message_id,
const char *image_path,
const char *profile,
OrderedHashmap *extension_images,
char **extension_image_paths,
PortableFlags flags) {
@ -1531,12 +1532,14 @@ static void log_portable_verb(
LOG_CONTEXT_PUSH_STRV(extension_base_names);
log_struct(LOG_INFO,
LOG_MESSAGE("Successfully %s%s '%s%s%s'",
LOG_MESSAGE("Successfully %s%s '%s%s%s%s%s'",
verb,
FLAGS_SET(flags, PORTABLE_RUNTIME) ? " ephemeral" : "",
image_path,
isempty(extensions_joined) ? "" : "' and its extension(s) '",
strempty(extensions_joined)),
strempty(extensions_joined),
isempty(profile) ? "" : "' using profile '",
strempty(profile)),
message_id,
"PORTABLE_ROOT=%s", strna(root_base_name));
}
@ -1653,6 +1656,7 @@ int portable_attach(
"attached",
"MESSAGE_ID=" SD_MESSAGE_PORTABLE_ATTACHED_STR,
image->path,
profile,
extension_images,
/* extension_image_paths= */ NULL,
flags);
@ -1974,6 +1978,7 @@ int portable_detach(
"detached",
"MESSAGE_ID=" SD_MESSAGE_PORTABLE_DETACHED_STR,
name_or_path,
/* profile= */ NULL,
/* extension_images= */ NULL,
extension_image_paths,
flags);