Grub broken after Debian 10 upgrade: "symbol `grub_calloc` not found"

edited November 2020 in AML-S805X-AC
I installed Debian 10 XFCE (libre-computer-aml-s805x-ac-debian-buster-xfce-mali-4.19.64+-2019-08-05.img) on the eMMC of my La Frite, and everything worked fine until I decided to apt-update && apt dist-upgrade.

Now every time I try to boot the board, I get this error while trying to load grub:
## Starting EFI application at 08080000 ...
error: symbol `grub_calloc` not found.
Entering rescue mode...
grub rescue>

I flashed the same image to a USB drive, and when I try to boot from there, for some reason it boots fine into the eMMC, so I don't have to chroot.
It seems to be mounting /dev/sda1 on /boot/efi, and /dev/mmcblk0p2 on /.

I think the main source of the problem is that grub is failing to install with a "Input/output error":
root@libre-computer:~# grub-install 
Installing for arm64-efi platform.
grub-install: warning: Cannot set EFI variable Boot0000.
grub-install: warning: efivarfs_set_variable: writing to fd 5 failed: Input/output error.
grub-install: warning: efivarfs_set_variable: failed to unlink /sys/firmware/efi/efivars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c: Invalid argument.
grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Input/output error.
grub-install: error: failed to register the EFI boot entry: Input/output error.
Does anyone have any idea about how to unbrick my system?  :#
Tagged:

Comments

  • efibootmgr fails as well:
    root@libre-computer:~# efibootmgr -v
    Skipping unreadable variable "Boot0000": Input/output error
    No BootOrder is set; firmware will attempt recovery

    Trying to remove the efivars file manually gives me the same error:
    root@libre-computer:~# rm /sys/firmware/efi/efivars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c 
    rm: cannot remove '/sys/firmware/efi/efivars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c': Invalid argument
    root@libre-computer:~# unlink /sys/firmware/efi/efivars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c  unlink: cannot unlink '/sys/firmware/efi/efivars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c': Invalid argument

    efivarfs is currently mounted on /sys/firmware/efi/efivars:
    root@libre-computer:~# mount | grep efivars
    efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)

    If I try to remount it, the error changes, I get a "status=8000000000000007" message on dmesg (and the behaviour of grub-install doesn't change):
    root@libre-computer:~# dmesg -cT
    root@libre-computer:~# umount /sys/firmware/efi/efivars
    root@libre-computer:~# mount -t efivarfs efivarfs /sys/firmware/efi/efivars
    root@libre-computer:~# dmesg -cT
    [Sun Nov 22 19:11:21 2020] efivars: get_next_variable: status=8000000000000007
    If I reinstall grub-efi-arm64, the message changes slightly:
    root@libre-computer:~# apt install --reinstall grub-efi-arm64
    (...)
    Setting up grub-efi-arm64 (2.02+dfsg1-20+deb10u2) ...
    Installing for arm64-efi platform.
    grub-install: warning: Cannot read EFI Boot* variables.
    grub-install: warning: efivarfs_get_variable: read failed: Input/output error.
    grub-install: warning: efi_get_variable: ops->get_variable failed: Input/output error.
    grub-install: error: failed to register the EFI boot entry: Input/output error.
    Failed: grub-install --target=arm64-efi  
    WARNING: Bootloader is not properly installed, system may not be bootable
    Generating grub configuration file ...
    Found background image: /usr/share/images/desktop-base/desktop-grub.png
    Found linux image: /boot/vmlinuz-4.19.64+
    Found initrd image: /boot/initrd.img-4.19.64+
    done
    Processing triggers for shim-signed:arm64 (1.33+15+1533136590.3beb971-7) ...
    
    root@libre-computer:~# grub-install Installing for arm64-efi platform.
    grub-install: warning: Cannot read EFI Boot* variables.
    grub-install: warning: efivarfs_get_variable: read failed: Input/output error.
    grub-install: warning: efi_get_variable: ops->get_variable failed: Input/output error.
    grub-install: error: failed to register the EFI boot entry: Input/output error.
    All this happened regardless of whered /boot/efi is mounted from /dev/sda1 (USB) or /dev/mmcblk0p1 (eMMC), so that doesn't seem to affect.
  • I ran into this problem myself today... after digging a bit and looking at /usr/local/sbin/lc_distro_transfer (another forum post I came across mentioned using this to copy an SD card to the EMMC, so I figured it was worth seeing exactly what steps it was taking), the following worked for me:
    After running "apt upgrade" but before rebooting, I did the following:
    root@libre-computer:/usr/local/sbin# grub-install --force-extra-removable --no-nvram --no-uefi-secure-boot --modules=part_msdos
    Installing for arm64-efi platform.
    Installation finished. No error reported.
    root@libre-computer:/usr/local/sbin#

    Hope this helps!
    --
    A-Ron
Sign In or Register to comment.