[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#729326: partman-auto: Installer doesn't reuse EFI system partitions when specified by recipe



Package: partman-auto
Version: 114
Severity: normal

Dear Maintainer,

During 4df358695167c0b6e2af5816f364d8a9a734ec05 some support for UEFI installs was added.
Within there was some support for reusing EFI system partitions, but the code was not
complete.

When preseeded with a recipe set to reuse the existing EFI system partition the installer
fails claiming it couldn't find an EFI system partition.  Examining closer it's apparent
that the EFI system partiiton was marked as to be formatted rather than reused.

Most of this code came from Ubuntu and this has already been fixed in Ubuntu's partman-auto
package.  I've pulled out the two relevant patches that will fix this problem.

I've also applied them to an install of my own and validated that they actually do fix the 
behavior.

-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-proposed'), (500, 'precise'), (100, 'precise-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-53-generic (SMP w/16 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From 3f84296e7db2a5fe12bcfe57d797f2fefbac58fe Mon Sep 17 00:00:00 2001
From: Mario Limonciello <mario_limonciello@dell.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
-- 
1.7.9.5


Reply to: