#!/bin/sh . /lib/partman/lib/base.sh have_efi=no new_efi_size= # Is there at least one efi-partition? for dev in $DEVICES/*; do [ -d "$dev" ] || continue cd $dev partitions= open_dialog PARTITIONS while { read_line num id size type fs path name; [ "$id" ]; }; do [ "$fs" != free ] || continue partitions="$partitions $id,$num,$size" done close_dialog for part in $partitions; do id=${part%,*} part=${part#*,} num=${part%,*} size=${part#*,} [ -f $id/method ] || continue method=$(cat $id/method) if [ "$method" = efi ] && [ -f $id/bootable ]; then have_efi=yes if [ -f $id/format ] && [ -z "$new_efi_size" ]; then new_efi_size="$size" fi fi done done # On Intel Macs, it isn't entirely clear that you have to have an EFI system # partition; see http://refit.sourceforge.net/myths/ for further details. In # the meantime, we only force an EFI system partition on ia64. if [ -e /var/lib/partman/efi ] && \ [ "$(udpkg --print-architecture)" = ia64 ] && \ [ "$have_efi" = no ]; then db_input critical partman-efi/no_efi || true db_go || exit 1 db_get partman-efi/no_efi if [ "$RET" = true ]; then exit 1 fi fi ARCH="$(archdetect)" # Experimentally-verified minimum size for a FAT32 filesystem created using # libparted. case $ARCH in i386/*|amd64/*) if [ "$new_efi_size" ] && longint_le "$new_efi_size" 34091007; then db_input critical partman-efi/too_small_efi || true db_go || true exit 1 fi ;; esac exit 0