Skip to content

Commit

Permalink
Unnecessary test removed, inverse logic error fixed, code reordered f…
Browse files Browse the repository at this point in the history
…or readability local var name changed from efi_... to esp_mount_point
  • Loading branch information
ProBackup-nl committed Mar 8, 2017
1 parent 4a3e087 commit 640d3fa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions usr/share/rear/prep/default/320_include_uefi_env.sh
Expand Up @@ -52,15 +52,15 @@ if [[ -n $(find /boot -maxdepth 1 -iname efi -type d) ]]; then
return # not found
fi

local esp_mount_point=""

# next step, check filesystem partition type (vfat?)
local efi_mount_point=""
UEFI_FS_TYPE=$(awk '/\/boot\/efi/ { print $3 }' /proc/mounts)
esp_mount_point='/\/boot\/efi/'
UEFI_FS_TYPE=$(awk $esp_mount_point' { print $3 }' /proc/mounts)
# if not mounted at /boot/efi, try /boot
if [[ -z "$UEFI_FS_TYPE" ]]; then
UEFI_FS_TYPE=$(awk '/\/boot/ { print $3 }' /proc/mounts)
[[ -z "$UEFI_FS_TYPE" ]] && efi_mount_point='/\/boot/'
else
efi_mount_point='/\/boot\/efi/'
esp_mount_point='/\/boot/'
UEFI_FS_TYPE=$(awk $esp_mount_point' { print $3 }' /proc/mounts)
fi

# ESP must be type vfat (under Linux)
Expand All @@ -72,4 +72,4 @@ fi
USING_UEFI_BOOTLOADER=1
LogPrint "Using UEFI Boot Loader for Linux (USING_UEFI_BOOTLOADER=1)"

awk $efi_mount_point' { print $1 }' /proc/mounts >$VAR_DIR/recovery/bootdisk 2>/dev/null
awk $esp_mount_point' { print $1 }' /proc/mounts >$VAR_DIR/recovery/bootdisk 2>/dev/null

0 comments on commit 640d3fa

Please sign in to comment.