[PATCH 1/6] uefi: uefidump: Dump out variables containing kernel messages

IvanHu ivan.hu at canonical.com
Wed Sep 5 07:21:45 UTC 2012


On 09/03/2012 11:52 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The kernel can stash kernel log messages into UEFI variables,
> so add ability to dump these out too.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/uefi/uefidump/uefidump.c |   20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
>
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 1f71107..a9a0433 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -490,6 +490,25 @@ static void uefidump_info_bootdev(fwts_framework *fw, fwts_uefi_var *var)
>   	free(path);
>   }
>
> +/*
> + *  Dump kernel oops log messages
> + */
> +static void uefidump_info_dump_type0(fwts_framework *fw, fwts_uefi_var *var)
> +{
> +	char *ptr = (char*)var->data;
> +
> +	while (*ptr) {
> +		char *start = ptr;
> +		while (*ptr && *ptr != '\n')
> +			ptr++;
> +
> +		if (*ptr == '\n') {
> +			*ptr++ = 0;
> +			fwts_log_info_verbatum(fw, "  KLog: %s.", start);
> +		}
> +	}
> +}
> +
>   static uefidump_info uefidump_info_table[] = {
>   	{ "PlatformLangCodes",	uefidump_info_platform_langcodes },
>   	{ "PlatformLang",	uefidump_info_platform_lang },
> @@ -507,6 +526,7 @@ static uefidump_info uefidump_info_table[] = {
>   	{ "Lang",		uefidump_info_lang },
>   	{ "Timeout",		uefidump_info_timeout },
>   	{ "Boot0",		uefidump_info_bootdev },
> +	{ "dump-type0-",	uefidump_info_dump_type0 },
>   	{ NULL, NULL }
>   };
>
>

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list