(SOLVED) Android 12.1 Build: super partition Fix Size

I know there is android 13, but I wanted to Build android 12.1 Tablet Mode. which I have done.
My problem is, I want to flash gapps onto it, Which I can do, that isnt the problem.
The problem is Gapps flashing gives me error, that there is not enough space.
I have tried to reserve space under the system which I can max out to reserve only 424 megs…
anything higher then that… I get error that super wont fit on device… I have
the Khadas Vim3 Pro Edition… Why is userdata limited to 10 gigs and super limited to 1.3 gigs
while system is 1.2 gigs and rest vendor. This is no way the amount of space being used correctly
on this device. Since my device is 4/32, then how come official AOSP device tree has it limited to nearlly a device with 2/16 gigs. and thats without using A/B Partitioning…

  • ALSO * Note: I built 64bit Build of Android Tablet. Which I understand that 6bit builds use more space since its bulding 32libs as well as 64 libs.
    Is there a way to resize super to fit on the device? There should be more then enough space to
    fully build android 12.1 64bit edition and add gapps, even basic gapps.

I know that AOSP builds will take system and vendor in super partition and max shrink the system and vendor to use as min as possible upon final build. But if you use the reserve command, you can reserve space. but upon flashing, again. It goes to flash super 1/13 and fails on 12, saying not enough space left for partition. Is there a way to Fix the Partition table to inlarge the super partition or something I can do so I can build a useable android box with gapps and all installed.?

you would have to recompile the u-boot to and flash said u-boot to get what you’re looking for. the thing is that baylibre, i am guessing, was testing with the vim3 basic and so set hard sizes that accommodated that device. This is the file with the config for the partitions and ive already edited it to give more space on the userdata and super partitions, and you will only need to put it into the /include/configs folder of the source code that you can find by following these instructions, just scroll down, its below the files.

just a note, these havent been updated in a bit but id say it should be safe to use “u-boot/v2022.01/integ”, but if you run into issues with that version, you can use the version in the instruction instead. hope this helps

Thanks for the help… I kinda thought it would be bootloader issue. but wasnt sure… but you pretty much verified it for me. Thanks much for the help. I will get that file and. Cant get to it for a bit… but ill get to it soon for sure. and small note, you are right, seems the official building for AOSP used sizes meant for
the basic vim3 rather then Pro as well. I thought the bootloader was setup to know the different between
the basic and pro.
thanks again…

I built this, and your file, the userdata wouldnt flash because of the - you had there… I had to add the M size back
and then once I got all that… I get some other crazy errors.

U-Boot 2021.01-00035-gde44e287b6 (Feb 02 2021 - 18:02:13 +0100) khadas-vim3

Model: Khadas VIM3
SoC: Amlogic Meson G12B (A311D) Revision 29:b (10:2)
DRAM: 3.8 GiB
MMC: sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from MMC… *** Warning - bad CRC, using default environment

In: serial@3000
Out: serial@3000
Err: serial@3000
Net: eth0: ethernet@ff3f0000
Partition super size: 5242880 does not match 3670016!
Verify GPT: error!
Hit any key to stop autoboot: 0
Partition super size: 5242880 does not match 3670016!
Verify GPT: error!
Broken MMC partition scheme
crq->brequest:0x0

for userdata, what i did with “-” basically tells the system to use the remainder for the unallocated storage for userdata, and there is no need to ad an M at the end of that. what it looks like to me is that something is assuming the storage size is larger than it should be. try this one i compiled with the included userdata and tell me if it works for you. tested it on my own device and works for me.

I am not sure if my device tree is a bit screwed up or what, maybe I need to make some minor changes to this device tree,

But here is the Error I get with using your u-boot and userimage… BTW: got the same error with my own as well:

Here is my device tree that I used: My Device Tree For AOSP 12.1

U-Boot 2021.01-00035-gde44e287b6 (Feb 02 2021 - 18:02:13 +0100) khadas-vim3

Model: Khadas VIM3
SoC:   Amlogic Meson G12B (A311D) Revision 29:b (10:2)
DRAM:  3.8 GiB
MMC:   sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial@3000
Out:   serial@3000
Err:   serial@3000
Net:   eth0: ethernet@ff3f0000
Partition name: rootfs does not match super!
Verify GPT: error!
Hit any key to stop autoboot:  0 
Partition name: rootfs does not match super!
Verify GPT: error!
Broken MMC partition scheme
crq->brequest:0x0

I am thinking maybe I need to adjust the device tree a bit as well.

I think the issue may be the method of flashing U-Boot and the bootloader. I use the method listed on the baylibre wiki under flashing. This should fix your issue i think.

that is the exact method I use, Have always used that way. Also remember im not flashing
Android PIE, I been creating my images from the Official AOSP.

https://source.android.com/docs/setup/create/devices#vim3_and_vim3l_boards

and building android 12.1 Not 13.x, Always had better luck with that then 13 anyhow…
I know my images work. because I flashed them under the original bootloader with no issue…
and I have tried your build as well as my own builds of the bootloader with said changes…
I am sure you compiled from the baylibre site as I have compiled from the main u-boot site…
and I get same results with both…

What changes did you make to device tree for the android build, after you built your new bootloader?
Maybe im missing something… I am sure you made proper changes to the device tree as well.
I might be missing something.

other than the making sure the partitions match on the android side, i didnt do anything else the last time i did build android for the vim3 so im not too certain whats going on. also couldnt see your device tree, github give me 404

sorry it was marked private for some reason. I forgot github defaults to private and you must make sure you mark it public before going on from there… I fixed it… its now public…

My Device Tree For AOSP-12

aside from the reserve space, the device tree looks pretty much the same as the baylibre/ASOP one. from what it looks like to me after testing flashing, it seems to me that your device has a bootloader verification of sorts active thats causing your issues, as im not getting the errors on my side.

if it does have that… I have no clue how to disable it…

maybe @numbqq can be of more help on this one

I rebuilt AOSP 12.x again… flashed original bootloader and stuff with build, Worked perfect…
Flashed with your bootloader and userdata, and get same error, rootfs doesnt match SUPER…

you have : "name=rootfs,size=1560M,uuid=" ROOT_UUID \ Listed,
Default is: "name=rootfs,size=-,uuid=" ROOT_UUID
Since you changed userdata to max out rest of space, rootfs has to be given a size.
but error is suggesting that rootfs should be same size as SUPER which its not by default,
you have it set to 1560M while super is set to 2560M …

So that is why I am lost…

When i flash my bootloader in upgrade mode, i don’t get any error, so the only thing I can think is write protection or not being in the right mode to flash the bootloader

I found the problem… and it was my fault… Bad Eliminater74…

anyhow, I wrote a bash script that always did all my flashing automatically for me, because
im lazy like that. I dont wanna keep entering commands after commands,
anyhow, I had the first part right where it writes the bootloader and so on,
but the 2nd part was still flashing the original bootloader name…
its just a stupid mistake of mine…

Anyhow… I just wanna thank you so much for your help… and YES I booted your bootloader…

glad it all worked out in the end.

I made a slight change to your bootloader included file, had to had 8M to the recovery.
I wanted to build TWRP, needed a little extra space. after fine turning the config file for TWRP,
I got it back down to 33M, but I put recovery to 40M and then had to recompile ROM to move userdata down by a few megs from the default 25G.

Only reason I wanted to do all this, because I have 3 other projects that I am working on,
and I needed this project to poke my memory and try and remember all the stuff from a few years back.

Anyhow , thanks for all your help. Thread Marked SOLVED…