Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions usr/share/rear/lib/uefi-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,23 @@ function build_bootx86_efi {
}

# estimate size of efibooot image
function efiboot_img_size {
local size=32000
function efiboot_img_size_MiB {
local size=32
if [[ $(basename $ISO_MKISOFS_BIN) = "ebiso" ]]; then
case "$(basename $UEFI_BOOTLOADER)" in
# we will need more space for initrd and kernel if elilo is used
# if shim is used, bootloader can be actually anything (also elilo)
# named as grub64.efi (follow-up loader is shim compile time option)
# http://www.rodsbooks.com/efi-bootloaders/secureboot.html#initial_shim
(shim.efi|elilo.efi) size=128000 ;;
(*) size=32000
(shim.efi|elilo.efi) size=128 ;;
(*) size=32
esac
fi
# this is purely experimental value.
# FIXME: calculating size dynamically would be more robust.
if [[ $BACKUP = "TSM" ]]; then
size=$((size + 96))
fi

echo $size
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 20_mount_efibootimg.sh
is_true $USING_UEFI_BOOTLOADER || return

dd if=/dev/zero of=$TMP_DIR/efiboot.img count=$(efiboot_img_size) bs=1024
dd if=/dev/zero of=$TMP_DIR/efiboot.img count=$(efiboot_img_size_MiB) bs=1048576
# make sure we select FAT16 instead of FAT12 as size >30MB
mkfs.vfat $v -F 16 $TMP_DIR/efiboot.img >&2
mkdir -p $v $TMP_DIR/mnt >&2
Expand Down