grub-efi-riscv64-bin 2.06-2ubuntu7.1 makes D1 unbootable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Invalid
|
Undecided
|
Heinrich Schuchardt |
Bug Description
I have been running the Ubuntu 22.04 image on a Nezha D1 board for a few months, and until recently installation of updates did not cause problems. However, after a recent dist-upgrade the board failed to boot. I reinstalled the system from a new image and then installed updates again batch by batch doing a successful reboot after each batch, until only the following packages remained:
grub-common
grub-efi-
grub-efi-riscv64
grub2-common
u-boot-nezha
As it turned out after the next step, it was the grub2 packages that break the boot (it does not make any difference if you upgrade all 4 or just the 2 packages below). This seems consistent with the fact both FAT filesystems on the card become damaged after the upgrade, which is possible to see if you move the SD card to a working Linux host and try to run fsck. As the result, GRUB never starts (note the "invalid FAT entry" message in the log) and the previous bootloader resorts to a network boot, which does not work.
Steps to reproduce:
1. Flash ubuntu-
2. apt-get install grub-efi-riscv64 grub-efi-
4. reboot
root@ubuntu:~# xargs apt-get -y install
grub-common
grub-efi-
grub-efi-riscv64
grub2-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libflashrom1 libftdi1-2
Use 'apt autoremove' to remove them.
Suggested packages:
multiboot-doc mtools xorriso desktop-base
The following packages will be upgraded:
grub-common grub-efi-riscv64 grub-efi-
4 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 3905 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Fetched 3905 kB in 3s (1498 kB/s)
Preconfiguring packages ...
1;-1fplymouth-
Stopping User Runtime Directory /run/user/1000...
[ OK ] Unmounted /run/user/1000.
[ OK ] Stopped User Runtime Directory /run/user/1000.
[ OK ] Removed slice User Slice of UID 1000.
Stopping Permit User Sessions...
[ OK ] Stopped Permit User Sessions.
[ OK ] Stopped target Network.
[ OK ] Stopped target Remote File Systems.
[ OK ] Stopped target Preparation for Remote File Systems.
Stopping Network Name Resolution...
Stopping WPA supplicant...
[ OK ] Stopped WPA supplicant.
[ OK ] Stopped target Basic System.
[ OK ] Stopped Forward Password R…s to Plymouth Directory Watch.
[ OK ] Stopped target Path Units.
[ OK ] Stopped target Slice Units.
[ OK ] Removed slice User and Session Slice.
[ OK ] Stopped target Socket Units.
[ OK ] Closed cloud-init hotplug hook socket.
[ OK ] Closed Open-iSCSI iscsid Socket.
[ OK ] Closed Syslog Socket.
[ OK ] Closed UUID daemon activation socket.
[ OK ] Stopped target System Initialization.
[ OK ] Unset automount Arbitrary â¦s File System Automount Point.
[ OK ] Stopped target Local Encrypted Volumes.
[ OK ] Stopped Forward Password Râ¦uests to Wall Directory Watch.
[ OK ] Stopped target Swaps.
[ OK ] Stopped target Local Verity Protected Volumes.
[ OK ] Stopped Initial cloud-initâ¦ob (metadata service crawler).
[ OK ] Stopped Wait for Network to be Configured.
Stopping Network Time Synchronization...
Stopping Record System Boot/Shutdown in UTMP...
[ OK ] Stopped Network Time Synchronization.
[ OK ] Stopped Network Name Resolution.
[ OK ] Stopped Record System Boot/Shutdown in UTMP.
Stopping Network Configuration...
[ OK ] Stopped Create Volatile Files and Directories.
[ OK ] Stopped Network Configuration.
[ OK ] Stopped target Preparation for Network.
[ OK ] Closed Network Service Netlink Socket.
[ OK ] Stopped Initial cloud-init job (pre-networking).
[ OK ] Stopped Apply Kernel Variables.
[ OK ] Stopped Load Kernel Modules.
[ OK ] Stopped Create final runtime dir for shutdown pivot root.
[ OK ] Stopped target Local File Systems.
Unmounting /boot/efi...
Unmounting /run/credential
[ OK ] Unmounted /boot/efi.
[ OK ] Unmounted /run/credential
[ OK ] Reached target Unmount All Filesystems.
[ OK ] Stopped File System Check on /dev/disk/
[ OK ] Removed slice Slice /system/
[ OK ] Stopped target Preparation for Local File Systems.
Stopping Monitoring of LVMâ¦meventd or progress polling...
Stopping Device-Mapper Multipath Device Controller...
[ OK ] Stopped Create Static Device Nodes in /dev.
[ OK ] Stopped Create System Users.
[ OK ] Stopped Device-Mapper Multipath Device Controller.
[ OK ] Stopped Remount Root and Kernel File Systems.
[ OK ] Stopped Monitoring of LVM2⦠dmeventd or progress polling.
[ OK ] Reached target System Shutdown.
[ OK ] Reached target Late Shutdown Services.
[ OK ] Finished System Reboot.
[ OK ] Reached target System Reboot.
[ 602.551100] reboot: Restarting system
[27]HELLO! BOOT0 is starting!
[30]BOOT0 commit : 20220228+g0ad88b
[33]set pll start
[35]periph0 has been enabled
[38]set pll end
[39]board init ok
[41]DRAM only have internal ZQ!!
[44]get_pmu_exist() = -1
[46]ddr_efuse_type: 0x0
[49][AUTO DEBUG] two rank and full DQ!
[53]ddr_efuse_type: 0x0
[56][AUTO DEBUG] rank 0 row = 15
[59][AUTO DEBUG] rank 0 bank = 8
[62][AUTO DEBUG] rank 0 page size = 2 KB
[66][AUTO DEBUG] rank 1 row = 15
[69][AUTO DEBUG] rank 1 bank = 8
[72][AUTO DEBUG] rank 1 page size = 2 KB
[75]rank1 config same as rank0
[78]DRAM BOOT DRIVE INFO: V0.24
[81]DRAM CLK = 792 MHz
[83]DRAM Type = 3 (2:DDR2,3:DDR3)
[86]DRAMC ZQ value: 0x7b7bfb
[89]DRAM ODT value: 0x42.
[91]ddr_efuse_type: 0x0
[94]DRAM SIZE =1024 M
[98]DRAM simple test OK.
[100]dram size =1024
[102]card no is 0
[104]sdcard 0 line count 4
[106][mmc]: mmc driver ver 2021-04-2 16:45
[115][mmc]: Wrong media type 0x0
[118][mmc]: ***Try SD card 0***
[127][mmc]: HSSDR52/SDR25 4 bit
[130][mmc]: 50000000 Hz
[132][mmc]: 59392 MB
[134][mmc]: ***SD/MMC 0 init OK!!!***
[181]Loading boot-pkg Succeed(index=1).
[185]Entry_name = opensbi
[188]Entry_name = dtb
[190]Entry_name = u-boot
[194]Adding DRAM info to DTB.
[199]Jump to second Boot.
OpenSBI v1.0
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|____
| |
|_|
Platform Name : Allwinner D1 Nezha
Platform Features : medeleg
Platform HART Count : 1
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 24000000Hz
Platform Console Device : uart8250
Platform HSM Device : ---
Platform Reboot Device : sunxi-wdt-reset
Platform Shutdown Device : ---
Firmware Base : 0x40000000
Firmware Size : 252 KB
Runtime SBI Version : 0.3
Domain0 Name : root
Domain0 Boot HART : 0
Domain0 HARTs : 0*
Domain0 Region00 : 0x0000000014008
Domain0 Region01 : 0x0000000014000
Domain0 Region02 : 0x0000000040000
Domain0 Region03 : 0x0000000000000
Domain0 Next Address : 0x000000004a000000
Domain0 Next Arg1 : 0x0000000044000000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Boot HART ID : 0
Boot HART Domain : root
Boot HART ISA : rv64imafdcvsux
Boot HART Features : scounteren,
Boot HART PMP Count : 16
Boot HART PMP Granularity : 2048
Boot HART PMP Address Bits: 38
Boot HART MHPM Count : 0
Boot HART MIDELEG : 0x0000000000000222
Boot HART MEDELEG : 0x000000000000b109
U-Boot 2022.04 (Jun 16 2022 - 10:37:21 +0000)
CPU: rv64imafdc
Model: Allwinner D1 Nezha
DRAM: 1 GiB
sunxi_set_gate: (CLK#24) unhandled
Core: 56 devices, 20 uclasses, devicetree: board
MMC: mmc@4020000: 0, mmc@4021000: 1
Loading Environment from nowhere... OK
In: serial@2500000
Out: serial@2500000
Err: serial@2500000
Net:
Warning: ethernet@4500000 (eth0) using random MAC address - 4a:e4:a4:d3:38:6e
eth0: ethernet@4500000
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc@4020000.blk...
Scanning disk mmc@4021000.blk...
Disk mmc@4021000.blk not ready
Found 7 disks
** Unable to read file ubootefi.var **
Failed to load EFI variables
BootOrder not defined
EFI boot manager: Cannot load any image
Scanning mmc 0:f...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
BootOrder not defined
EFI boot manager: Cannot load any image
Found EFI removable media binary efi/boot/
Invalid FAT entry
** Unable to read file efi/boot/
Failed to load 'efi/boot/
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No UEFI binary known at 0x40080000
EFI LOAD FAILED: continuing...
starting USB...
Bus usb@4101000: USB EHCI 1.00
Bus usb@4101400: USB OHCI 1.0
Bus usb@4200000: USB EHCI 1.00
Bus usb@4200400: USB OHCI 1.0
scanning bus usb@4101000 for devices... 1 USB Device(s) found
scanning bus usb@4101400 for devices... 1 USB Device(s) found
scanning bus usb@4200000 for devices... 1 USB Device(s) found
scanning bus usb@4200400 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Device 0: unknown device
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
DHCP client bound to address 10.80.0.219 (3022 ms)
*** Warning: no boot file name; using '0A5000DB.img'
Using ethernet@4500000 device
TFTP from server 10.80.1.254; our IP address is 10.80.0.219
Filename '0A5000DB.img'.
Load address: 0x4a000000
Loading: T T T T T T T
affects: | grub (Ubuntu) → grub2 (Ubuntu) |
Thanks for reporting the issue. I will look into it once back home from a business trip.
Best regards
Heinrich