Providing a "custom" userdata.img

i am very new to building “custom_android” (thanks to @steadfasterX @aibd and @ronnz98).

i know nothing about Android developpement, programming, coding,
i don’t understand most of the words used in those activities, (our forum is the first place where i started to use english), so learning by reading technical documentation in gitlab repos or xda forums is very complicated…

i recently have builded e-2.1-r-20240606 for a device (Samsung Galaxy s4mini GT-I9195 serranoltexx) that only have 8 GB of internal memory and /system partition 1572864000 bytes (1500 MB), this device have been officially dropped in e-0.13-n-20201210 for that reason.
to include Advanced_Privacy in my build, that i like to do, i need to find 200 MB free in the /system partition.

instead of /sytem/system/app, i want to populate /data/app during the build,
how to do that ?
even if that prohib any factory-reset, providing a "custom userdata.img" could be usefull for other old timer devices facing the fatal "/system out of space" issue when building…

Good Morning @piero perhaps it will help if you first upgrade to Android 6.0.1 Marshmallow SlimROM and thus change the partiton partition structure?

XDA Forums [ROM][AOSP][6.0.1] SlimROM Marshmallow [GT-I9195]

Thank you @Xxpsilon

I have read the entire thread, i don’t see how it can help…

It is a way i thinked about three years ago. That need fork and skill to modify sources, also the device will begin incompatible with other ROMS.

My thought was:

the last original stock firmware for the Samsung Galaxy s4mini GT-I9195 (serranoltexx) is Android 4.4.4 (KitKat).

The firmware Android 6.0.1 Marshmallow SlimROM will have a different partition structure. This may result in the 200 MB free in the /system partition you are looking for.

Apropos “ begin incompatible …”

Theory often differs from practice. Only knowledge creates clarity. Therefore - the proof of the pudding is in the eating.

ok i will experiment that way and reporting

i was’t thought that the “Android 6.0.1 Marshmallow SlimROM” could including a firmware, but just a custom android distribution as usual… even slim.

Hum… 233 MB when stock is 1,6 GB and mine is 626 MB, i am still dubious…
but different PIT is still possible even increasing /system is totally unusefull for a so “slim” rom, in their case, the opposite would have been interresting to increase /userdata…

Edit :
it was interresting to see a so slim distribution → surely faster
but installing it, and then /e/OS don’t change anything

~$ adb shell df -h /
|Filesystem            |Size  |Used |Avail |Use% |Mounted on|
|/dev/block/mmcblk0p21 |1.4G  |1.4G  |1.6M |100% |/system/etc/gps_debug.conf|

I don’t have the GTI9195, so I can’t give you any practical advice or help.

Skepticism is definitely appropriate. But new paths open up new possibilities. And only if you try it out will you know what the facts are.

An example from my practice: For the LG G3 d855 there is a so-called CleanROM Stock Marshmallow based, among other things with a modified Kernel. This has some advantages over the LG original and I was still able to install /e/OS-R for d855

Perhaps this very detailed tutorial will help you.
[ Tutorial ] How to resize partitions on an android phone using Parted