%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
#!/bin/sh
DISTRIBUTOR=ubuntu
efi_vars_dir=/sys/firmware/efi/vars
EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c
SB="$efi_vars_dir/SecureBoot-$EFI_GLOBAL_VARIABLE/data"
#if we have SB enabled, don't bother to install the unsigned file
if [ -e "$SB" ] && \
[ "$(( $(printf 0x%x \'"$(cat $SB | cut -b1)") & 1 ))" = 1 ]; then
SECURE_BOOT="1"
fi
if [ ! -d "$efi_vars_dir" ]; then
echo "System not running in EFI mode, not installing to EFI system partition."
exit 0
fi
for BINARY in $(find /usr/lib/fwupdate -name '*.efi' -printf "%f\n"); do
ESP="/boot/efi/EFI/$DISTRIBUTOR"
ESP_FILE="$ESP/$BINARY"
SIGNED_FILE="/usr/lib/fwupdate/$BINARY.signed"
UNSIGNED_FILE="/usr/lib/fwupdate/$BINARY"
if [ -f "$ESP_FILE" ]; then
ESP_MD5=$(md5sum $ESP_FILE | sed 's, .*,,')
fi
if [ -f "$SIGNED_FILE" ]; then
COMPARE=$SIGNED_FILE
elif [ -z "$SECURE_BOOT" ]; then
COMPARE=$UNSIGNED_FILE
fi
mkdir -p $ESP/fw
if [ -n "$COMPARE" ]; then
COMPARE_MD5=$(md5sum $COMPARE | sed 's, .*,,')
if [ "$COMPARE_MD5" != "$ESP_MD5" ]; then
rm -f $ESP_FILE
echo "Installing $BINARY to EFI system partition."
cp $COMPARE $ESP_FILE
fi
else
echo "Signed binary for $BINARY is not available, not installing binary to EFI system partition."
fi
done