Android partitioning lost after UEFI adventure

Hi.
I experimented with Linux on hikey960. Now I can’t get back to Android.
The usual aosp/device/linaro/hikey/installer/hikey960/flash-all.sh script does not work any more.
I’m trying to restore the partitioning that aosp expects. Following the instructions in tools-images-hikey960/README-technical.md I did “fastboot flash ptable ptable.img”
That is apparently not sufficient.
In section 3. “Burn Images”/"# extra images" the following happens:
$sudo ./hikey_idt -c config -p /dev/ttyUSB0
target reported max download size of 134217728 bytes
sending ‘nvme’ (128 KB)…
OKAY [ 0.060s]
writing ‘nvme’…
FAILED (remote: No such partition.)
finished. total time: 0.063s

Several other attempted downloads fail with “No such partition”.
How can I get the required partitions back again?

Are you able to flash xloader (sec_xloader.img) and fastboot (fastboot.img) correctly ?

Yes and no.
I can flash sec_xloader.img (which is identical to hisi-sec_xloader.img) without problem
but:
$ sudo fastboot flash fastboot fastboot.img
target reported max download size of 134217728 bytes
sending ‘fastboot’ (3346 KB)…
OKAY [ 1.432s]
writing ‘fastboot’…
FAILED (remote: No such partition.)
finished. total time: 1.435s

A summary of the result from “flash-al.sh”:
OK:
xloader
ptable

NOK:
fastboot
nvme
fw_lpm3
trustfirmware
boot
dts

Looking more closely I now see that flash-all.sh also tries to erase some partitions, but fails that too:
erasing ‘system’…
FAILED (remote: Check device console.)
erasing ‘cache’…
FAILED (remote: Check device console.)
erasing ‘userdata’…
FAILED (remote: Check device console.)

It seems the partition table doesn’t become effective. We can run “flash-all.sh” successfully. So I don’t know what’s wrong at your side.

If you could boot Linux, you could just replace “system”, “cache”, “userdata” for AOSP. Then android is back.

I meet same kind of issue passing from rpb/uefi to android. The hikey-idt is sucessful but the flash-all script fails for xloader. I have to reboot with hikey idt and then flash ptable and xloader manually, after that the other blobs are flashed normally with flash-all script. Maybe there is a kind of race condition when flashing a blob too quickly after the partition table.

1 Like

Thanks Loic. The relevant documentation page seems to be https://github.com/96boards/documentation/wiki/Reference-Bootloader-Hikey ?
Unfortunately many of the links there are dangling.
Example: The reference to
http://builds.96boards.org/snapshots/reference-platform/components/uefi/latest/release/hikey/ is obsolete.
There seem to have been an unfortunate reorganisation of the file structure at 96boards.org that is hitting the documentation pages hard. It also makes the advice that have been administrated in the forum over the months difficult to follow. I think it would be great if someone spent an afternoon fixing stale links.

Anyway, I’ll try the hikey-idt tool.

Confirming that the instructions on https://github.com/96boards-hikey/tools-images-hikey960/blob/master/README-technical.md brought Android back to me. It wasn’t quite plain sailing but eventually it worked. Thanks.