From e683bb9b94a28e872be4d04085fa6ee601f5c076 Mon Sep 17 00:00:00 2001 From: Enrico Jorns Date: Wed, 22 Nov 2017 16:45:51 +0100 Subject: [PATCH 1/3] src: provide more targeted error message for invalid slot format Signed-off-by: Enrico Jorns --- src/config_file.c | 2 +- src/mark.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config_file.c b/src/config_file.c index 8f2a89ec9..f1aa26b58 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -183,7 +183,7 @@ gboolean load_config(const gchar *filename, RaucConfig **config, GError **error) error, R_CONFIG_ERROR, R_CONFIG_ERROR_INVALID_FORMAT, - "Invalid slot name format"); + "Invalid slot name format: %s", groups[i]); res = FALSE; goto free; } diff --git a/src/mark.c b/src/mark.c index 98b25f93b..a8d4f8293 100644 --- a/src/mark.c +++ b/src/mark.c @@ -66,7 +66,7 @@ static RaucSlot* get_slot_by_identifier(const gchar *identifier, GError **error) g_set_error(error, R_SLOT_ERROR, R_SLOT_ERROR_FAILED, - "Invalid slot name format"); + "Invalid slot name format: '%s'", identifier); } g_strfreev(groupsplit); From a81a73a4f2609a904011ddc782f64a10acd86e06 Mon Sep 17 00:00:00 2001 From: Enrico Jorns Date: Tue, 5 Dec 2017 11:24:50 +0100 Subject: [PATCH 2/3] src/main: do not print 'Trying to contact rauc service' by default This message is quite irritating and not verfy helpful for normal usgae of RAUC. Thus let it appear in debug mode only. Signed-off-by: Enrico Jorns --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 5c879c33f..f3cb8c517 100644 --- a/src/main.c +++ b/src/main.c @@ -168,7 +168,7 @@ static gboolean install_start(int argc, char **argv) g_printerr("Failed to connect completed signal\n"); goto out_loop; } - g_print("Trying to contact rauc service\n"); + g_debug("Trying to contact rauc service"); if (!r_installer_call_install_sync(installer, bundlelocation, NULL, &error)) { g_printerr("Failed %s\n", error->message); @@ -945,7 +945,7 @@ static gboolean status_start(int argc, char **argv) r_exit_status = 1; goto out; } - g_print("trying to contact rauc service\n"); + g_debug("Trying to contact rauc service"); if (!r_installer_call_mark_sync(proxy, state, slot_identifier, &slot_name, &message, NULL, &ierror)) { message = g_strdup(ierror->message); From e5719f5075b2850bbf6e29745698098a0768ba85 Mon Sep 17 00:00:00 2001 From: Enrico Jorns Date: Tue, 5 Dec 2017 12:01:00 +0100 Subject: [PATCH 3/3] src/main: rename --override-boot-slot named argument Use BOOTNAME instead of SLOTNAME as this better reflects the required content of the argument. You must not give a slot name here (as 'rootfs.0') but instead the 'bootname' (i.e. the name the bootloader identifies this slot with) of the slot, such as 'A' or 'system0'. Signed-off-by: Enrico Jorns --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index f3cb8c517..ab013dc27 100644 --- a/src/main.c +++ b/src/main.c @@ -1036,7 +1036,7 @@ static void cmdline_handler(int argc, char **argv) {"keyring", '\0', 0, G_OPTION_ARG_FILENAME, &keyring, "keyring file", "PEMFILE"}, {"intermediate", '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &intermediate, "intermediate CA file name", "PEMFILE"}, {"mount", '\0', 0, G_OPTION_ARG_FILENAME, &mount, "mount prefix", "PATH"}, - {"override-boot-slot", '\0', 0, G_OPTION_ARG_STRING, &bootslot, "override auto-detection of booted slot", "SLOTNAME"}, + {"override-boot-slot", '\0', 0, G_OPTION_ARG_STRING, &bootslot, "override auto-detection of booted slot", "BOOTNAME"}, {"handler-args", '\0', 0, G_OPTION_ARG_STRING, &handlerextra, "extra handler arguments", "ARGS"}, {"debug", 'd', 0, G_OPTION_ARG_NONE, &debug, "enable debug output", NULL}, {"version", '\0', 0, G_OPTION_ARG_NONE, &version, "display version", NULL},