From 9183bdd67bd61351bc2c730ddb00d8a99567050f Mon Sep 17 00:00:00 2001 From: sakaki Date: Mon, 18 Aug 2014 09:03:14 +0100 Subject: [PATCH] Fixed bug in parsing of "efibootmgr -v". Previous version did not check that all necessary fields were non- blank before assigning to associative arrays, which could cause the script to fail (in the conform_efi_boot_order_if_possible() fn) for some BIOSes. Version bumped accordingly to 1.0.4 --- buildkernel | 6 +++++- buildkernel.8 | 2 +- buildkernel.conf.5 | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/buildkernel b/buildkernel index c5078e7..fc6ba3e 100755 --- a/buildkernel +++ b/buildkernel @@ -31,7 +31,7 @@ shopt -s nullglob # ********************** variables ********************* PROGNAME="$(basename "${0}")" CONFFILE="/etc/${PROGNAME}.conf" -VERSION="1.0.3" +VERSION="1.0.4" DEFAULTEFIBOOTFILE="bootx64.efi" EFIBOOTFILE="${DEFAULTEFIBOOTFILE}" NEWVERSION="$(basename $(realpath "/usr/src/linux"))" @@ -484,6 +484,10 @@ find_all_efi_boot_entries() { NEXTPATH="${NEXTPATH:5:-1}" local NEXTNAME="$(efibootmgr | grep "^${NEXTSIG}" | cut -c11-)" NEXTUUID="${NEXTUUID,,}" + if [[ -z "${NEXTID}" || -z "${NEXTNAME}" || -z "${NEXTPATH}" || -z "${NEXTUUID}" || -z "${NEXTISACTIVE}" ]]; then + # one of the required strings is empty, we cannot use this line + continue + fi # assign results (Bash treats arrays as unset if not assigned a value) EBOOTIDS=("${EBOOTIDS[@]:+${EBOOTIDS[@]}}" "${NEXTID}") EBOOTNAMES=("${EBOOTNAMES[@]:+${EBOOTNAMES[@]}}" "${NEXTNAME}") diff --git a/buildkernel.8 b/buildkernel.8 index 7c1536a..4ce4b5d 100644 --- a/buildkernel.8 +++ b/buildkernel.8 @@ -1,4 +1,4 @@ -.TH BUILDKERNEL 8 "Version 1.0.3: July 2014" +.TH BUILDKERNEL 8 "Version 1.0.4: August 2014" .SH NAME buildkernel \- build secure boot kernel, save to EFI system partition .SH SYNOPSIS diff --git a/buildkernel.conf.5 b/buildkernel.conf.5 index 7cf64be..aab1be3 100644 --- a/buildkernel.conf.5 +++ b/buildkernel.conf.5 @@ -1,4 +1,4 @@ -.TH BUILDKERNEL 5 "Version 1.0.3: July 2014" +.TH BUILDKERNEL 5 "Version 1.0.4: August 2014" .SH NAME buildkernel.conf \- a configuration file for \fBbuildkernel\fR(8) .SH SYNOPSIS