Skip to content

Commit

Permalink
Fixed bug in parsing of "efibootmgr -v".
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sakaki- committed Aug 18, 2014
1 parent 05044fb commit 9183bdd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion buildkernel
Original file line number Diff line number Diff line change
Expand Up @@ -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"))"
Expand Down Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion buildkernel.8
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildkernel.conf.5
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 9183bdd

Please sign in to comment.