From 52946ea3d3b4ddf59e460fe08c15368f44ca50bd Mon Sep 17 00:00:00 2001 From: sakaki Date: Fri, 25 Jul 2014 12:25:35 +0100 Subject: [PATCH] Fixed bug where presence of LUKS keyfile was being checked for on disk, even though the user had elected (by setting LUKSKEYFILE variable to the empty string) to use a fallback passphrase only. Version bumped accordingly to 1.0.2. --- buildkernel | 22 ++++++++++++---------- buildkernel.8 | 2 +- buildkernel.conf.5 | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/buildkernel b/buildkernel index b8373f0..c8555b0 100755 --- a/buildkernel +++ b/buildkernel @@ -31,7 +31,7 @@ shopt -s nullglob # ********************** variables ********************* PROGNAME="$(basename "${0}")" CONFFILE="/etc/${PROGNAME}.conf" -VERSION="1.0.1" +VERSION="1.0.2" DEFAULTEFIBOOTFILE="bootx64.efi" EFIBOOTFILE="${DEFAULTEFIBOOTFILE}" NEWVERSION="$(basename $(realpath "/usr/src/linux"))" @@ -1267,16 +1267,18 @@ conform_efi_boot_order_if_possible() { check_key_file_if_on_efi_system_partition () { # We check for the presence of a key file ONLY if it is on the EFI system # partition, as this must be mounted on entry to this function - if [[ "${KEYFILEPARTUUID}" == "${EFIPARTUUID}" ]]; then - # keyfile should be on our already-mounted partition - if [ ! -s "${EFIROOTDIR}/${LUKSKEYFILE}" ]; then - die "The ${EFIPARTNAME} does not contain a LUKS key file" + if [ -n "${LUKSKEYFILE}" ]; then + if [[ "${KEYFILEPARTUUID}" == "${EFIPARTUUID}" ]]; then + # keyfile should be on our already-mounted partition + if [ ! -s "${EFIROOTDIR}/${LUKSKEYFILE}" ]; then + die "The ${EFIPARTNAME} does not contain a LUKS key file" + fi + else + warning "Your keyfile partition is != the EFI system partition" + warning "Please ensure that ${LUKSKEYFILE} is present, on partition" + warning "${KEYFILEPARTUUID}," + warning "before attemping to reboot" fi - else - warning "Your keyfile partition is != the EFI system partition" - warning "Please ensure that ${LUKSKEYFILE} is present, on partition" - warning "${KEYFILEPARTUUID}," - warning "before attemping to reboot" fi } ensure_efi_partition_mounted() { diff --git a/buildkernel.8 b/buildkernel.8 index 2f8d8c5..a784d95 100644 --- a/buildkernel.8 +++ b/buildkernel.8 @@ -1,4 +1,4 @@ -.TH BUILDKERNEL 8 "Version 1.0.1: July 2014" +.TH BUILDKERNEL 8 "Version 1.0.2: July 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 8f6ea18..f9a4bbd 100644 --- a/buildkernel.conf.5 +++ b/buildkernel.conf.5 @@ -1,4 +1,4 @@ -.TH BUILDKERNEL 5 "Version 1.0.0: July 2014" +.TH BUILDKERNEL 5 "Version 1.0.2: July 2014" .SH NAME buildkernel.conf \- a configuration file for \fBbuildkernel\fR(8) .SH SYNOPSIS