[PATCH] Add the rest of the support necessary to allow reusing EFI partitions
>From 3f84296e7db2a5fe12bcfe57d797f2fefbac58fe Mon Sep 17 00:00:00 2001
From: Mario Limonciello <superm1@ubuntu.com>
Date: Mon, 4 Nov 2013 18:22:35 -0600
Subject: [PATCH] Add the rest of the support necessary to allow reusing EFI
partitions.
In 4df358695167c0b6e2af5816f364d8a9a734ec05 Steve McIntyre added
initial support for UEFI leveraging a lot of code from Ubuntu.
The modifications made in lib/auto-shared.sh from Ubuntu are also
necessary however for the installer to allow the EFI System Partition
to be reused.
---
lib/auto-shared.sh | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/lib/auto-shared.sh b/lib/auto-shared.sh
index 2b9c42a..4302738 100644
--- a/lib/auto-shared.sh
+++ b/lib/auto-shared.sh
@@ -92,9 +92,29 @@ ensure_primary() {
)"
}
-create_primary_partitions() {
+reuse_partitions() {
cd $dev
+ local scheme
+
+ scheme="$scheme_reused"
+ foreach_partition '
+ id="$(echo " $*" | sed -n '\''s/.* \$reuse{ \([^}]*\) }.*/\1/p'\'')"
+ if [ -z "$id" ]; then
+ db_progress STOP
+ autopartitioning_failed
+ fi
+ setup_partition $id $*
+ # Hack to stop EFI partitions showing up as formatted when
+ # they will actually not be. We do not have a good
+ # interface for this yet.
+ if [ -f $id/method ] && [ "$(cat $id/method)" = efi ] && \
+ [ -f $id/detected_filesystem ]; then
+ rm -f $id/format
+ fi'
+}
+create_primary_partitions() {
+ cd $dev
while [ "$free_type" = pri/log ] && \
echo $scheme | grep -q '\$primary{'; do
pull_primary
Reply to: