[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] peter_betos:
What you need is the following:

bash command line (if you have windows you can install ubuntu linux bash)

a working lpmake executable (you can use https://github.com/asura99/lpunpack_and_lpmake install the plugins, and run the make shell script)

Your set of images that came for your Custom Rom, it should be similar to the following set:

system.img

system_ext.img

product.img

vendor.img

odm.img

Steps:

1. Boot on a custom recovery that has ADB access e.g. TWRP and execute the following on windows CMD:

adb shell lpdump --slot 0 /dev/block/bootdevice/by-name/super

The command will print all the sector allocations but we're after the natural file size of your super.img based on how stock ROM sized it. That will be our basis to size the image. Get the exact number of the super image file size in bytes. You should see a number within the ballpark of 9126805504. Save that number for later step.

2. Extract the attached file into the same location where your images above are placed. This represents the _b partitions (which is 0 bytes by default on the original MIUI super.img)

3. Get the file sizes of the image files above in bytes. It will be best to get them using "ls -l" command on bash command prompt so that you can get the precise sizes. Store the values somewhere.

4. Redirect your bash command prompt to the directory where the images are located. Execute the following command:

./lpmake --metadata-size 65536 --super-name super --metadata-slots 2 --device super:<the super file size from step 1> --group main:<sum of all images in bytes> --partition system_a:readonly:<system image size>:main --image system_a=./system.img --partition system_b:readonly:0:main --image system_b=./system_b.img --partition system_ext_a:readonly:<system_ext image size>:main --image system_ext_a=./system_ext.img --partition system_ext_b:readonly:0:main --image system_ext_b=./system_ext_b.img --partition product_a:readonly:<product image size>:main --image product_a=./product.img --partition product_b:readonly:0:main --image product_b=./product_b.img --partition vendor_a:readonly:<vendor image size>:main --image vendor_a=./vendor.img --partition vendor_b:readonly:0:main --image vendor_b=./vendor_b.img --partition odm_a:readonly:<odm image size>:main --image odm_a=./odm.img --partition odm_b:readonly:0:main --image odm_b=./odm_b.img --sparse --output ./super.new.img

Below is an example of the command using the format above:

./lpmake --metadata-size 65536 --super-name super --metadata-slots 2 --device super:9126805504 --group main:7815139328 --partition system_a:readonly:2308665344:main --image system_a=./system.img --partition system_b:readonly:0:main --image system_b=./system_b.img --partition system_ext_a:readonly:1509330944:main --image system_ext_a=./system_ext.img --partition system_ext_b:readonly:0:main --image system_ext_b=./system_ext_b.img --partition product_a:readonly:2656813056:main --image product_a=./product.img --partition product_b:readonly:0:main --image product_b=./product_b.img --partition vendor_a:readonly:1307881472:main --image vendor_a=./vendor.img --partition vendor_b:readonly:0:main --image vendor_b=./vendor_b.img --partition odm_a:readonly:32448512:main --image odm_a=./odm.img --partition odm_b:readonly:0:main --image odm_b=./odm_b.img --sparse --output ./super.new.img

Notice that this has a different partition structure compared to this thread. This is because MIUI has a different structure and strategy on how _a and _b partitions are split. I guess the ROM knows that _b partitions are only needed to be resized when you do the recovery or seamless updates.

Hope this helps anyone who want to create a super.img file. This has helped me a lot.