From f043f1f94b7f671e7e8d4fa3963a47e045d94f59 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 6 Jul 2017 12:31:27 -0500 Subject: [PATCH] uefi: record boot variables to system log during updates (#152) This doesn't strictly resolve the encountered issue, but it will aide in debugging these types of issues in the future. --- plugins/uefi/fu-plugin-uefi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/uefi/fu-plugin-uefi.c b/plugins/uefi/fu-plugin-uefi.c index 86410c2df..34f3c19bc 100644 --- a/plugins/uefi/fu-plugin-uefi.c +++ b/plugins/uefi/fu-plugin-uefi.c @@ -182,6 +182,8 @@ fu_plugin_update_offline (FuPlugin *plugin, int rc; g_autoptr(fwup_resource_iter) iter = NULL; const gchar *str; + g_autofree gchar *efibootmgr_path = NULL; + g_autofree gchar *boot_variables = NULL; /* get the hardware we're referencing */ fwup_resource_iter_create (&iter); @@ -221,6 +223,16 @@ fu_plugin_update_offline (FuPlugin *plugin, filename, line, function, message, strerror(err)); return FALSE; } + + /* record boot information to system log for future debugging */ + efibootmgr_path = g_find_program_in_path ("efibootmgr"); + if (efibootmgr_path != NULL) { + if (!g_spawn_command_line_sync ("efibootmgr -v", + &boot_variables, NULL, NULL, error)) + return FALSE; + g_message ("Boot Information:\n%s", boot_variables); + } + return TRUE; }