Bug#708430: EFI Bug

Steve McIntyre steve at einval.com
Wed May 15 23:12:02 UTC 2013


retitle 708430 need to also install grub to the removable media fallback path?
thanks

On Wed, May 15, 2013 at 06:28:52PM +0000, Alberaan ...y seré por siempre Alberaan wrote:
>Package: grub-efi-amd64
>Version: 1.99-27+deb7u1

Hi Alberaan,

Thanks for reporting the bug as I requested. :-)

>We have been having trouble trying to boot to a debian system. Just
>after a correct installation, debian didn't boot. The "Toshiba" logo
>from my pc was stuck. Someone on #debian-boot told me he thought this
>is what was happening:
>
>http://mjg59.dreamwidth.org/4125.html

Yep, it seems this was the core of your problem. The suggestion to use
Ubuntu's rescue-boot script only confused things further, hence why it
took so long to diagnose the problem.

>Using debian installer in rescue mode, we did (sda1 being boot
>partition, sda2 the / partition):
>
>mkdir /target
>mount /dev/sda2 /target
>mount /dev/sda1 /target/boot/efi
>mount --bind /sys /target/sys
>mount --bind /proc /target/proc
>mount --bind /dev /target/dev
>chroot /target
>
>cd /boot/efi/EFI
>mkdir boot
>cp debian/grubx64.efi boot/bootx64.efi
>
>We then rebooted and it worked.

Yes. grub-installer was correctly creating and installing the
grubx64.efi executable in a valid path and attempting to instruct your
laptop's firmware to boot it. BUT: it seems that the firmware is buggy
and ignores EFI boot entries when they are created. By copying the
grub executable to the fallback removable media path, your machine
will now boot. This temporarily solves your problem with booting.

The problem with doing this is that at some point in the future when
you upgrade to a newer version of the grub package, things will stop
working. Newer versions of the grub-efi-amd64-bin package will replace
the debian/grubx64.efi file and the modules that it loads, but *won't*
replace the temporary copy we've made in boot/bootx64.efi. At some
point, compiler changes or internal grub changes are likely to break
compatibility between the old grub binary and new modules and at that
point your bootloader will break again.

Fundamentally, the bug here is in the firmware of your Toshiba
laptop. Alberaan, Could you please tell us more details of the laptop?
Ideally we would like to have the model number and the firmware
revision so that we can log that information somewhere for future
users.

Secondly (and this is more to Colin): as we've now seen this failure
mode in the wild in more than one case, I think that we need to add
(optional?) code to grub-install to tell it to *also* install to the
fallback removable media path. We could do a few things here:

 (a) use a blacklist of known-bad make/model/firmware versions and
     automatically trigger the fallback installation when we detect
     one

 (b) do the Windows thing: always install to the fallback path if
     nobody else already has; we'd need to detect if the
     previously-installed fallback file is from an older version of
     grub-efi and if so upgrade it 

 (c) ask the user the question (and store their answer in /etc or
     debconf or *somewhere*): "do you want to install to the fallback
     path too?"

What do you think?

-- 
Steve McIntyre, Cambridge, UK.                                steve at einval.com
"Because heaters aren't purple!" -- Catherine Pitt



More information about the Pkg-grub-devel mailing list