Mounting /usr file system fails after moving it to SD card

Thanks @doitright. I had to modify uefi-flash-all.sh [1] as it uses variables ANDROID_BUILD_TOP and ANDROID_PRODUCT_OUT, and various build products that I don’t have e.g.:

#	fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img
#	fastboot flash system "${ANDROID_PRODUCT_OUT}"/system.img
#	fastboot flash vendor "${ANDROID_PRODUCT_OUT}"/vendor.img
#	fastboot flash cache "${ANDROID_PRODUCT_OUT}"/cache.img
#	fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img

Unfortunately, flashing the Linux rootFS after that didn’t work. (I think that system is perhaps different for AOSP and Linux.)

Right now I am just wondering if there is a way to reformat the whole internal flash, and then start with the Linux instructions from scratch.

[1] installer/hikey960/uefi-flash-all.sh - device/linaro/hikey - Git at Google

That’s what I was suggesting that you do. Flash all of AOSP to bring it to a clean working state running Android. You then follow the procedure to I stall debian.

@doitright I must be thick, or something, but how can I get the files under "${ANDROID_PRODUCT_OUT}": boot.img, system.img, vendor.img, cache.img, userdata.img. As I mentioned, trying to flash without them, didn’t work for me.

You really have two options: either build AOSP, or supply the files from some other location, perhaps a snapshot, and edit the script to their path.

OK, I will try to download them from here: https://snapshots.linaro.org/96boards/hikey960/linaro/aosp-master/latest/:

However, cache.img is not there. Maybe an empty file will do?..

Or should I try flash-all.sh which doesn’t need cache.img but also needs dt.img:

Cache can probably be left out. It basically just formats the partition ext4.

1 Like

@doitright This has nearly worked! I mean, I was able to boot the board again. Unfortunately, it wouldn’t work properly with an SD card inserted. But I’ll track that issue separately. Many thanks for your help again!

[1] Hikey 960 UEFI boot hangs when SD card present - #3 by psyhtest