Bug#995091: d-i: partman-efi allows method "efi" on wrong device types
Package: partman-efi
Version: 94
Tags: patch
Hello d-i team,
Partman allows to use any type of device as "EFI System Partition": not
only regular partition but also LVM logical volume, encrypted device,
RAID array... It should be allowed only on partitions which actually
support an "EFI System Partition" type.
The attached patch enables method "efi" only if flag "esp" is valid for
the partition. I hope the patch has the proper format.
diff -ur a/choose_method/efi/choices b/choose_method/efi/choices
--- a/choose_method/efi/choices 2021-09-13 22:12:05.000000000 +0200
+++ b/choose_method/efi/choices 2021-09-26 00:42:06.655800689 +0200
@@ -1,6 +1,6 @@
#!/bin/sh
-. /usr/share/debconf/confmodule
+. /lib/partman/lib/base.sh
dev=$1
id=$2
@@ -13,6 +13,19 @@
exit 0
fi
+cd "$dev"
+
+valid_esp=no
+open_dialog VALID_FLAGS $id
+while { read_line flag; [ "$flag" ]; }; do
+ if [ "$flag" = esp ]; then
+ valid_esp=yes
+ fi
+done
+close_dialog
+
+[ "$valid_esp" = yes ] || exit 0
+
db_metaget partman-efi/text/efi description
printf "efi\t${RET}\n"
Reply to: