GSIs on A51 5G

Search This thread

lebigmac

Account currently disabled
Jan 31, 2017
1,206
813
Hello @AndyYan thanks for your great tutorial!

Why do you give so much extra space in --group main:7545552896
In BrePro1 tutorial it says to use sum of all partitions as group size. But you use much more than that? It's almost as large as your entire super (--device super:7549747200)
Is that just an arbitrary number that you used or is that the original group size from the lpdump? Is it safe to simply recycle that number?
Thanks.

Some users of my script have some difficulties with lpmake and I believe this group size to be the culprit. Right now I'm only adding up the partition sizes and using the total size as group size as suggested in the BrePro1 tutorial. This doesn't seem to work for some devices though.

This is the result if I use sum of all partitions as group size:
...
lpmake I 03-30 16:49:40 7927 7927 builder.cpp:1012] [liblp]Partition engineering will resize from 0 bytes to 8192 bytes
lpmake E 03-30 16:49:40 7927 7927 builder.cpp:599] [liblp]Partition vendor is part of group qti_dynamic_partitions which does not have enough space free (34369536 requested, 111792128 used out of 146143360)
Not enough space on device for partition vendor with size 34368320
 
Last edited:
  • Like
Reactions: hacker812c

hacker812c

Senior Member
Mar 28, 2012
2,591
2,131
Salvador🇧🇷
Sub-partition sizes are arbitrary, as long as they can contain the respective content (e.g. system has to be larger than your GSI) while still fit inside super.
AndyYan was Samsung not dishonest or inconsistent when joining the vendor and the system on the a51 one unique partition? I was very disappointed when I realized this. you can't do system bachup on twrp. this is really annoying. best regards my friend
 
Last edited:
  • Like
Reactions: lebigmac

hacker812c

Senior Member
Mar 28, 2012
2,591
2,131
Salvador🇧🇷
I think that a better solution for these devices for those who want to use a custom ROM would be a developer to create a script to create logical partitions and physical partitions for system and vendor and forget the 💩 of Samsung's dynamic partition. J7 and eynos 7870 repartitioned by astrako. This is one more point for the ridiculous updates from Samsung
 
Last edited:
  • Haha
Reactions: lebigmac

lkj00

Member
Sep 14, 2020
11
1
Phone boot status-developer mode-USB debugging-PC install driver, download adb toolkit
code:
adb shell lpdump
You can get the parameters of your own phone by filling them in.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    First up, shoutouts to both @phhusson and part of this thread from @YOisuPU for vital guidance throughout my first journey with super-partition devices.

    A51 5G runs on Exynos 980 unlike the 4G variant which runs on Exynos 9611. People have been running into trouble rooting the 4G variant and even resorted to GSIs just for rooting, but on the 5G variant all you had to do is to patch boot+vbmeta (don't include recovery) with Magisk. If you just need root, stopping here is enough.
    For me, running my LOS GSI is absolutely necessary, but Android 10's super-partition compounded with Samsung not making fastbootd available means an even harder time than what I've had with A60/M40. Below steps apply to this device and might also serve as a general skeleton for other Samsung devices with super-partition.

    0) Get Linux - some tools used here just don't have a Windows version
    1) On stock firmware, open shell and run
    Code:
    lpdump
    to get some partition info that'll be used next - example output here
    2) Get stock firmware
    3) Extract super.img.lz4 from AP and then super.img (sparse) from super.img.lz4 with your tool of choice (e.g. 7-Zip ZS)
    4) Unsparse super.img:
    Code:
    ./simg2img super.img super.raw.img
    5) Extract partitions from super.raw.img:
    Code:
    ./lpunpack --slot=0 super.raw.img <dir>
    6) Replace system.img in <dir> with GSI image
    7) Repack your own super.img:
    Code:
    ./lpmake --metadata-size 65536 --super-name super --metadata-slots 2 --device super:7549747200 --group main:7545552896 --partition system:readonly:2147483648:main --image system=./system.img --partition vendor:readonly:729890816:main --image vendor=./vendor.img --partition odm:readonly:4349952:main --image odm=./odm.img --sparse --output ./super.img
    Compare the command to the lpdump output obtained earlier - many of the numerical parameters here directly match. For the 3 partition declarations, assign them sizes equal to or larger than (recommended) their byte sizes.
    8) Compress your super.img into a tar and flash it via Odin in the AP slot
    9) Make sure that the device runs patched vbmeta (but stock boot image - somehow the patched one causes a bootloop on GSIs), do a factory reset in stock recovery, reboot
    simg2img, lpunpack and lpmake binaries can be obtained online (e.g. from the aforementioned thread) or built from source.

    By the way, I've fixed some sepolicy issues with PHH's Superuser, so in future builds, unlike what was described in the thread, 4G variant users likely won't need a permissive kernel to get root on GSIs (at least it doesn't here).
    3
    It would be an honor for me if you could please try it and let me know if it works on your device. Thanks.

    Aww, sold my A51 just yesterday...
    3
    Why do you give so much extra space in --group main:7545552896
    Is that just an arbitrary number that you used or is that the original group size from the lpdump? Is it safe to simply recycle that number?
    IIRC I take as much data from the stock lpdump result as possible.
    2
    When i lpmake i get invalid sparse image header

    Can be safely ignored.
    2
    I'm unsure where you are getting the sizes for the partitions, could you please elaborate on that? The rest is self explanatory.

    Sub-partition sizes are arbitrary, as long as they can contain the respective content (e.g. system has to be larger than your GSI) while still fit inside super.