Bug#776782: x86/mac: false warning about being in EFI mode
Package: partman-efi
Version: 62
Severity: normal
Tags: d-i patch
If you boot an x86/mac in legacy BIOS mode with a pre-existing non-UEFI OS
installed, you will get the following warning:
"This machine's firmware has started the installer in UEFI mode but it looks
like there may be existing operating systems already installed using "BIOS
compatability mode".
..
"Force UEFI Installation?"
The following patch resolves the issue for me.
diff --git a/init.d/efi b/init.d/efi
index 7b71990..42f95dd 100755
--- a/init.d/efi
+++ b/init.d/efi
@@ -8,7 +8,11 @@ ARCH="$(archdetect)"
# Give the kernel a chance to create /proc/efi if appropriate.
modprobe efivars >/dev/null 2>&1 || true
-if [ -d /proc/efi ] || [ -d /sys/firmware/efi ]; then
+in_efi_mode() {
+ [ -d /proc/efi ] || [ -d /sys/firmware/efi ]
+}
+
+if in_efi_mode; then
> /var/lib/partman/efi
else
case $ARCH in
@@ -86,7 +90,7 @@ done
log "Found $NUM_ESP ESPs, $NUM_NO non-ESPs"
-if [ $NUM_ESP = 0 ] && [ $NUM_NO -gt 0 ]; then
+if in_efi_mode && [ $NUM_ESP = 0 ] && [ $NUM_NO -gt 0 ]; then
case $ARCH in
i386/*|amd64/*)
db_input critical partman-efi/non_efi_system || true
-- System Information:
Debian Release: 8.0
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Reply to: