Unable to remount on the self build Android

Which Khadas SBC do you use?

VIM3 pro

Which system do you use? Android, Ubuntu, OOWOW or others?

Android

Which version of system do you use? Khadas official images, self built images, or others?

self built images

Please describe your issue below:

can’t remount on AOSP

Post a console log of your issue below:

D:>adb remount
avb_user_verity.c:179: ERROR: Data from ‘vbmeta’ does not look like a vbmeta header.
Error setting verity state
Could not acquire IImageManager: Invalid path


--------- beginning of kernel
01-01 00:15:08.673 0 0 I logd : logdr: UID=0 GID=0 PID=5244 b tail=0 logMask=99 pid=0 start=0ns deadline=0ns
--------- beginning of main
08-18 18:23:54.765 5248 5248 I remount : [libfstab] Using Android DT directory /proc/device-tree/firmware/android/
08-18 18:23:54.773 5248 5248 E remount : Error setting verity state
01-01 00:15:17.361 0 0 I servicemanager: Since ‘gsiservice’ could not be found (requested by debug pid 5248), trying to start it as a lazy AIDL service. (if it’s not configured to be a lazy service, it may be stuck starting or still starting).
01-01 00:15:17.376 0 0 I init : starting service ‘gsid’…
08-18 18:23:54.813 5253 5253 I AidlLazyServiceRegistrar: Registering service gsiservice
01-01 00:15:17.383 0 0 I init : … started service ‘gsid’ has pid 5253
01-01 00:15:17.385 0 0 I init : Control message: Processed ctl.interface_start for ‘aidl/gsiservice’ from pid: 269 (/system/bin/servicemanager)
01-01 00:15:17.397 0 0 I BpBinder: onLastStrongRef automatically unlinking death recipients:
01-01 00:15:17.404 0 0 I servicemanager: Notifying gsiservice they do (previously: don’t) have clients when we now have a record of a client
--------- beginning of system
08-18 18:23:54.833 5253 5253 E gsid : realpath failed for metadata: /metadata/gsi/remount: No such file or directory
08-18 18:23:54.833 5253 5255 I AidlLazyServiceRegistrar: Process has 1 (of 1 available) client(s) in use after notification gsiservice has clients: 1
08-18 18:23:54.833 5248 5248 E remount : Could not acquire IImageManager: Invalid path
08-18 18:23:54.833 5248 5248 W remount : Failed to allocate scratch on /data, fallback to use free space on super
08-18 18:23:54.833 5248 5248 E remount : [liblp] Device size does not match (got 1879048192, expected 2415919104)
08-18 18:23:54.834 5248 5248 I remount : [liblp] Partition scratch will resize from 0 bytes to 536870912 bytes
08-18 18:23:54.834 5248 5248 E remount : [liblp] Block device super size mismatch (expected2415919104, got 1879048192)
08-18 18:23:54.834 5248 5248 E remount : [libfs_mgr] add partition scratch
08-18 18:23:54.834 5248 5248 E remount : Failed to create scratch partition
08-18 18:23:54.834 5248 5248 E remount : Could not allocate backing storage for overlays
08-18 18:23:54.834 5248 5248 E remount : Overlayfs setup for /system failed, skipping
08-18 18:23:54.838 5253 5256 E gsid : realpath failed for metadata: /metadata/gsi/remount: No such file or directory
08-18 18:23:54.838 5248 5248 E remount : Could not acquire IImageManager: Invalid path
08-18 18:23:54.838 5248 5248 W remount : Failed to allocate scratch on /data, fallback to use free space on super
08-18 18:23:54.839 5248 5248 E remount : [liblp] Device size does not match (got 1879048192, expected 2415919104)
08-18 18:23:54.839 5248 5248 I remount : [liblp] Partition scratch will resize from 0 bytes to 536870912 bytes
08-18 18:23:54.839 5248 5248 E remount : [liblp] Block device super size mismatch (expected2415919104, got 1879048192)
08-18 18:23:54.839 5248 5248 E remount : [libfs_mgr] add partition scratch
08-18 18:23:54.839 5248 5248 E remount : Failed to create scratch partition
08-18 18:23:54.839 5248 5248 E remount : Could not allocate backing storage for overlays
08-18 18:23:54.839 5248 5248 E remount : Overlayfs setup for /vendor failed, skipping
08-18 18:23:54.839 5248 5248 W remount : No remountable partitions were found.
08-18 18:23:54.839 5248 5248 E remount : Remount failed
08-18 18:23:56.215 5253 5256 I AidlLazyServiceRegistrar: Process has 0 (of 1 available) client(s) in use after notification gsiservice has clients: 0
08-18 18:23:56.215 5253 5256 I AidlLazyServiceRegistrar: Trying to shut down the service. No clients in use for any service in process.
01-01 00:15:18.792 0 0 I servicemanager: Notifying gsiservice they don’t (previously: do) have clients when we now have no record of a client
01-01 00:15:18.799 0 0 I servicemanager: Unregistering gsiservice
01-01 00:15:18.803 0 0 I BpBinder: onLastStrongRef automatically unlinking death recipients:
08-18 18:23:56.227 5253 5256 I AidlLazyServiceRegistrar: Unregistered all clients and exiting
01-01 00:15:18.813 0 0 I init : Service ‘gsid’ (pid 5253) exited with status 0 oneshot service took 1.432000 seconds in background
01-01 00:15:18.821 0 0 I init : Sending signal 9 to service ‘gsid’ (pid 5253) process group…
01-01 00:15:18.829 0 0 I libprocessgroup: Successfully killed process cgroup uid 0 pid 5253 in 0ms

Did you solve this? I can see the same with AOSP_14_r1 as well.

Hello,

I had the same problem:

[liblp] Device size does not match (got 1879048192, expected 2147483648)
[liblp] Block device super size mismatch (expected2147483648, got 1879048192)
[libfs_mgr] add partition scratch
Failed to create scratch partition
Could not allocate backing storage for overlays

I fixed this problem synchronizing the super partition on bootloader side

At the AOSP side, there is a variable on BoardConfig.mk:
—> BOARD_SUPER_PARTITION_SIZE := 2147483648 #2048M

This value should match with partition SUPER on bootloader size. As below:

PATH: include/configs/khadas-vim3_android.h

#define PARTS_DEFAULT
“uuid_disk=${uuid_gpt_disk};”
“name=logo,start=512K,size=2M,uuid=” LOGO_UUID
“name=misc,size=512K,uuid=${uuid_gpt_misc};”
“name=dtbo,size=8M,uuid=${uuid_gpt_dtbo};”
“name=vbmeta,size=512K,uuid=${uuid_gpt_vbmeta};”
“name=boot,size=32M,bootable,uuid=${uuid_gpt_boot};”
“name=recovery,size=64M,uuid=${uuid_gpt_recovery};”
“name=cache,size=256M,uuid=${uuid_gpt_cache};”
“name=super,size=2048M,uuid=${uuid_gpt_super};” \ <-----------THIS LINE
“name=userdata,size=12786M,uuid=${uuid_gpt_userdata};”
“name=rootfs,size=-,uuid=” ROOT_UUID
#endif

2 Likes

Thanks for the solution. I still have a question. After compiling uboot.bin according to the README of /device/amlogic/yukawa/bootloader, how to generate u-boot_kvim3_noab.bin similar to the original directory?

As you can see in the README.

Compile:
        export PATH=<path-to-toolchain>/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-elf/bin:$PATH
        export CROSS_COMPILE=aarch64-elf-
        git clone https://gitlab.baylibre.com/baylibre/amlogic/atv/u-boot.git
        cd u-boot
        git checkout u-boot/v2021.07/integ-20210712
        make [sei510|sei610|sei610_ab|khadas-vim3_android|khadas-vim3_android_ab|khadas-vim3l_android|khadas-vim3l_android_ab]_defconfig  <----- THIS LINE----
        make

There are many defconfigs, for VIM3 exist: khadas-vim3_android_defconfig and khadas-vim3_android_ab_defconfig.

To generate u-boot_kvim3_noab.bin, you need to pick the khadas-vim3_android_defconfig.

The final binary name is u-boot.bin, you can just rename to u-boot_kvim3_noab.bin (after FIP process).

PS: I never compiled u-boot using the Baylibre repository (just u-boot mainline), but the steps described in the README is very close that I use. So, I believe that is the result is the same.

Yes, that’s how I compiled it.
It seems that I need to refer to the README file to package the fip binary. Can I use the generate-bins-new.sh script to generate it? Or do you have a recommended FIP process script?

I am using this script to generate FIP binary:

Usage: ./build-fip.sh <bl33/u-boot.bin path> [output directory]

Ex: ./build-fip.sh khadas-vim3 …/u-boot/out/u-boot.bin out

hi, I am also getting the same problem on Android 14 for VIM3 (A311D) board , I followed the README in Android 14 source and created the u-boot.bin but its not working for me. I also notice that the prebuilt “u-boot_kvim3_noab.bin” is around 1.2Mbs and my u-boot.bin come out to be 744Kbs.
I have followed the following steps:

export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-elf/bin:$PATH
export CROSS_COMPILE=aarch64-elf-
git clone https://gitlab.baylibre.com/baylibre/amlogic/atv/u-boot.git
cd u-boot
git checkout u-boot/v2021.07/integ-20210712
make khadas-vim3_android_defconfig
make

./generate-bins-new.sh AND-14/device/amlogic/yukawa/bootloader/fip_packages/fip-collect-g12b-kvim3-khadas-vims-pie-20210111-211833/ UBoot/u-boot/

fastboot flash bootloader uboot-bins/u-boot.bin

After flash the board doesn’t reboot to bootloader and I cannot see any fastboot device detected.

I have also tried to create the new fip package but the results are same.

./collect-khadas_binaries-git-refboard.sh khadas-vims-pie g12b kvim3
./generate-bins-new.sh AND-14/device/amlogic/yukawa/bootloader/scripts/fip-collect-g12b-kvim3-khadas-vims-pie-20231204-145241/ UBoot/u-boot/

What could be done wrong here?

Here are the debug from new u-boot :

[17:42:07.398] G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;0.•
[17:42:07.617] bl2_stage_init 0x01
[17:42:07.617] bl2_stage_init 0x81
[17:42:07.617] hw id: 0x0000 - pwm id 0x01
[17:42:07.617] bl2_stage_init 0xc1
[17:42:07.617] bl2_stage_init 0x02
[17:42:07.617] 
[17:42:07.617] L0:00000000
[17:42:07.617] L1:20000703
[17:42:07.617] L2:00008067
[17:42:07.617] L3:14000000
[17:42:07.617] B2:00402000
[17:42:07.617] B1:e0f83180
[17:42:07.617] 
[17:42:07.617] TE: 187197
[17:42:07.617] 
[17:42:07.617] BL2 Built : 19:23:21, Sep 18 2020. g12b g9fde858 - gongwei.chen@droid11-sz
[17:42:07.617] 
[17:42:07.617] Board ID = 8
[17:42:07.617] Set A53 clk to 24M
[17:42:07.617] Set A73 clk to 24M
[17:42:07.617] Set clk81 to 24M
[17:42:07.617] A53 clk: 1200 MHz
[17:42:07.617] A73 clk: 1200 MHz
[17:42:07.617] CLK81: 166.6M
[17:42:07.617] smccc: 00032420
[17:42:07.617] eMMC boot @ 1
[17:42:07.617] sw8 s
[17:42:07.617] board id: 8
[17:42:07.617] Load FIP HDR DDR from eMMC, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 1
[17:42:07.617] Get wrong ddr fw magic! Error!!
[17:42:07.617] fw parse done
[17:42:07.728] PIEI prepare done
[17:42:07.728] ddr saved addr:00016000
[17:42:07.728] Load ddr parameter from eMMC, src: 0x02c00000, des: 0xfffd0000, size: 0x00001000, part: 0
[17:42:07.728] 00000000
[17:42:07.728] emmc switch 0 ok
[17:42:07.728] fastboot data verify
[17:42:07.728] result: 255
[17:42:07.728] Cfg max: 12, cur: 1. Board id: 255. Force loop cfg
[17:42:07.728] LPDDR4 probe
[17:42:07.728] 
[17:42:07.728] LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep  1 2020. g12b g3c95fed - gongwei.chen@droid11-sz
[17:42:07.728] ddr clk to 1608MHz
[17:42:07.728] 00000000
[17:42:07.728] emmc switch 1 ok
[17:42:07.852] 
[17:42:07.852] dmc_version 0001
[17:42:07.852] Check phy result
[17:42:07.852] INFO : End of CA training
[17:42:07.852] INFO : End of initialization
[17:42:07.852] INFO : Training has run successfully!
[17:42:07.852] Check phy result
[17:42:07.852] INFO : End of initialization
[17:42:07.852] INFO : End of read enable training
[17:42:07.852] INFO : End of fine write leveling
[17:42:07.852] INFO : End of read dq deskew training
[17:42:07.852] INFO : End of MPR read delay center optimization
[17:42:07.852] INFO : End of Write leveling coarse delay
[17:42:07.852] INFO : End of read delay center optimization
[17:42:07.852] INFO : Training has run successfully!
[17:42:07.852] Check phy result
[17:42:07.852] INFO : End of initialization
[17:42:07.852] INFO : End of MPR read delay center optimization
[17:42:07.852] INFO : End of write delay center optimization
[17:42:07.852] INFO : End of read delay center optimization
[17:42:07.852] INFO : End of max read latency training
[17:42:07.852] INFO : Training has run successfully!
[17:42:07.852] 1D training succeed
[17:42:07.899] Check phy result
[17:42:07.899] INFO : End of initialization
[17:42:07.930] INFO : End of 2D read delay Voltage center optimization
[17:42:07.945] INFO : End of 2D read delay Voltage center optimization
[17:42:08.008] INFO : End of 2D write delay Voltage center optimization
[17:42:08.147] INFO : End of 2D write delay Voltage center optimization
[17:42:08.147] INFO : Training has run successfully!
[17:42:08.147] 
[17:42:08.147] soc_vref_reg_value 0x 00000026 00000027 00000026 00000027 00000027 00000024 00000026 00000024 00000023 00000024 00000026 00000025 00000027 00000025 00000027 00000026 00000026 00000026 00000026 00000024 00000026 00000025 00000025 00000025 00000026 00000027 00000025 00000025 00000027 00000024 00000024 00000026 dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0004 
[17:42:08.147]  dram_vref_reg_value 0x 00000015
[17:42:08.147] 2D training succeed
[17:42:08.147] auto size-- 65535DDR cs0 size: 2048MB
[17:42:08.147] DDR cs1 size: 2048MB
[17:42:08.147] DMC_DDR_CTRL: 00e00024DDR size: 3928MB
[17:42:08.147] cs0 DataBus test pass
[17:42:08.147] cs1 DataBus test pass
[17:42:08.147] cs0 AddrBus test pass
[17:42:08.147] cs1 AddrBus test pass
[17:42:08.147] 
[17:42:08.147] non-sec scramble use zero key
[17:42:08.147] ddr scramble enabled
[17:42:08.147] 
[17:42:08.147] 100bdlr_step_size ps== 431
[17:42:08.147] result report
[17:42:08.147] boot times 0Enable ddr reg access
[17:42:08.147] 00000000
[17:42:08.147] emmc switch 3 ok
[17:42:08.147] Authentication key not yet programmed
[17:42:08.147] get rpmb counter error 0x00000007
[17:42:08.147] 00000000
[17:42:08.147] emmc switch 1 ok
[17:42:08.147] Load FIP HDR from eMMC, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 1
[17:42:08.147] Load BL3X from eMMC, src: 0x00078200, des: 0x01768000, size: 0x0003de00, part: 1
[17:42:08.178] 0.0;M3 CHK:0;cm4_sp_mode 0
[17:42:08.241] 
[17:42:08.241] [Image: g12b_v1.1.3396-c893a7153 2020-11-11 13:54:36 gongwei.chen@droid11-sz]
[17:42:08.241] 
[17:42:08.241] OPS=0x10
[17:42:08.241] 
[17:42:08.241] ring efuse init
[17:42:08.241] 
[17:42:08.241] chipver efuse init
[17:42:08.241] 
[17:42:08.241] 29 0b 10 00 01 20 0d 00 00 15 31 34 32 58 33 50 
[17:42:08.241] 
[17:42:08.241] [0.016071 Inits done]
[17:42:08.241] 
[17:42:08.241] secure task start!
[17:42:08.241] high task start!
[17:42:08.241] low task start!
[17:42:08.241] run into bl31
[17:42:08.241] NOTICE:  BL31: v1.3(release):5c909a099
[17:42:08.241] NOTICE:  BL31: Built : 17:18:21, Nov 20 2020
[17:42:08.241] NOTICE:  BL31: G12A normal boot!
[17:42:08.241] NOTICE:  BL31: BL33 decompress pass
[17:42:08.241] ERROR:   Error initializing runtime service opteed_fast
1 Like

Hi, I don’t know if this is still an issue, but I think you need to flash the bootloader properly (using pyamlboot or the update tool – see this post for detailed instructions).
For me, creating the new bootloader worked flawlessly.