Bug#776782: x86/mac: false warning about being in EFI mode
On Sun, Feb 01, 2015 at 10:13:27AM -0700, dann frazier wrote:
>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
>
Looks good to me, I guess... :-)
--
Steve McIntyre, Cambridge, UK. steve@einval.com
"C++ ate my sanity" -- Jon Rabone
Reply to: