From e36d67f9b667b3d41676fc395eae580503081d9e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 7 Jan 2020 13:25:46 +0200 Subject: [PATCH] efibootmgr: Fix verbose --- extra/efibootmgr/build | 1 + extra/efibootmgr/checksums | 1 + extra/efibootmgr/patches/fix-verbose.patch | 85 ++++++++++++++++++++++ extra/efibootmgr/sources | 1 + extra/efibootmgr/version | 2 +- 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 extra/efibootmgr/patches/fix-verbose.patch diff --git a/extra/efibootmgr/build b/extra/efibootmgr/build index e15840ed..6a7bff9b 100755 --- a/extra/efibootmgr/build +++ b/extra/efibootmgr/build @@ -1,6 +1,7 @@ #!/bin/sh -e patch -p1 < efivar.patch +patch -p1 < fix-verbose.patch make \ EXTRA_CFLAGS=-Os \ diff --git a/extra/efibootmgr/checksums b/extra/efibootmgr/checksums index cb79ce74..84e3d55e 100644 --- a/extra/efibootmgr/checksums +++ b/extra/efibootmgr/checksums @@ -1,2 +1,3 @@ 22a95ebe0d5c9fb2915b3a100450f8f37484d1dbb8b296f55b343cc84f10397d 17.tar.gz 167ac36fb4bd59e90fede0422280117c0b50d0ac3c0c7d478fea427cb9a6944c efivar.patch +aba035327649b6b926b278ebe1613979f1923ff5963631c5e7dd7ebc6cfc5733 fix-verbose.patch diff --git a/extra/efibootmgr/patches/fix-verbose.patch b/extra/efibootmgr/patches/fix-verbose.patch new file mode 100644 index 00000000..2cbece61 --- /dev/null +++ b/extra/efibootmgr/patches/fix-verbose.patch @@ -0,0 +1,85 @@ +diff --git a/src/efibootmgr.c b/src/efibootmgr.c +index de38f01..2ebc312 100644 +--- a/src/efibootmgr.c ++++ b/src/efibootmgr.c +@@ -951,47 +951,64 @@ show_vars(const char *prefix) + dp = efi_loadopt_path(load_option, boot->data_size); + rc = efidp_format_device_path(text_path, text_path_len, + dp, pathlen); +- if (rc < 0) +- error(18, "Could not parse device path"); ++ if (rc < 0) { ++ warning("Could not parse device path"); ++ return; ++ } + rc += 1; + + text_path_len = rc; + text_path = calloc(1, rc); +- if (!text_path) +- error(19, "Could not parse device path"); ++ if (!text_path) { ++ warning("Could not parse device path"); ++ return; ++ } + + rc = efidp_format_device_path(text_path, text_path_len, + dp, pathlen); +- if (rc < 0) +- error(20, "Could not parse device path"); +- printf("\t%s", text_path); ++ if (rc >= 0) ++ printf("\t%s", text_path); + free(text_path); ++ if (rc < 0) { ++ warning("Could not parse device path"); ++ return; ++ } ++ + /* Print optional data */ + + rc = efi_loadopt_optional_data(load_option, + boot->data_size, + &optional_data, + &optional_data_len); +- if (rc < 0) +- error(21, "Could not parse optional data"); ++ if (rc < 0) { ++ warning("Could not parse optional data"); ++ return; ++ } + + if (opts.unicode) { + text_path = ucs2_to_utf8((uint16_t*)optional_data, optional_data_len/2); + } else { + rc = unparse_raw_text(NULL, 0, optional_data, + optional_data_len); +- if (rc < 0) +- error(22, "Could not parse optional data"); ++ if (rc < 0) { ++ warning("Could not parse optional data"); ++ return; ++ } + rc += 1; + text_path_len = rc; + text_path = calloc(1, rc); +- if (!text_path) +- error(23, "Could not parse optional data"); ++ if (!text_path) { ++ warning("Could not parse optional data"); ++ return; ++ } + rc = unparse_raw_text(text_path, text_path_len, + optional_data, optional_data_len); +- if (rc < 0) +- error(24, "Could not parse device path"); +- } ++ if (rc < 0) { ++ warning("Could not parse device path"); ++ free(text_path); ++ return; ++ } ++ } + printf("%s", text_path); + free(text_path); + } diff --git a/extra/efibootmgr/sources b/extra/efibootmgr/sources index 4afc6a0a..6bc05055 100644 --- a/extra/efibootmgr/sources +++ b/extra/efibootmgr/sources @@ -1,2 +1,3 @@ https://github.com/rhboot/efibootmgr/archive/17.tar.gz patches/efivar.patch +patches/fix-verbose.patch diff --git a/extra/efibootmgr/version b/extra/efibootmgr/version index 5e661b99..cadffb8e 100644 --- a/extra/efibootmgr/version +++ b/extra/efibootmgr/version @@ -1 +1 @@ -17 1 +17 2