[Android Software Development] DonJuan01:
Hello ,

I am using xiaomi miui 13.

file list from super.img;

odm_a.img odm_b.img product_a.img product_b.img system_a.img system_b.img vendor_a.img vendor_b.img

erofs :(

I want to add script into /root filesystem. I can not. How can I create my own super.img with dd. Can you support me on this?

for example :

plateau:/ # ls -lrt | grep -i init

-rwxr-x--- 1 root shell 0 2009-01-01 02:00 init.recovery.hardware.rc

-rwxr-x--- 1 root shell 14242 2009-01-01 02:00 init.miui.rc

-rwxr-x--- 1 root shell 14 2009-01-01 02:00 init.miui.qadaemon.rc

-rwxr-x--- 1 root shell 545 2009-01-01 02:00 init.miui.post_boot.sh

-rwxr-x--- 1 root shell 845 2009-01-01 02:00 init.miui.perf_init.rc

-rwxr-x--- 1 root shell 648 2009-01-01 02:00 init.miui.opcust.rc

-rwxr-x--- 1 root shell 674 2009-01-01 02:00 init.miui.opconfig.rc

-rwxr-x--- 1 root shell 691 2009-01-01 02:00 init.miui.nativedebug.rc

-rwxr-x--- 1 root shell 1293 2009-01-01 02:00 init.miui.google_revenue_share.rc

-rwxr-x--- 1 root shell 3740 2009-01-01 02:00 init.miui.early_boot.sh

-rwxr-x--- 1 root shell 620 2009-01-01 02:00 init.miui.cust.rc

-rwxr-x--- 1 root shell 463 2009-01-01 02:00 init.environ.rc

lrwxr-x--- 1 root shell 16 2009-01-01 02:00 init -> /system/bin/init

plato:/ # mount | grep -i dm- |head -4

/dev/block/dm-5 on / type erofs (ro,seclabel,relatime,user_xattr,acl,cache_strategy=readaround)

/dev/block/dm-6 on /vendor type erofs (ro,seclabel,relatime,user_xattr,acl,cache_strategy=readaround)

/dev/block/dm-7 on /product type erofs (ro,seclabel,relatime,user_xattr,acl,cache_strategy=readaround)

/dev/block/dm-8 on /odm type erofs (ro,seclabel,relatime,user_xattr,acl,cache_strategy=readaround)

plato:/ #

edit init.miui.rc script 2-3 line edit :)

note: my linux knowledge is good.

help pls

my projeck ; new super.img creating helpppp

stat -c '%n %s' *.img

plato:/storage/sdcard0/Download/sup_unpack # ls -lrt

total 6345212

-rw-rw---- 1 u0_a209 media_rw 0 2023-02-16 21:38 vendor_b.img

-rw-rw---- 1 u0_a209 media_rw 2081656832 2023-02-16 21:38 vendor_a.img

-rw-rw---- 1 u0_a209 media_rw 0 2023-02-16 21:38 product_b.img

-rw-rw---- 1 u0_a209 media_rw 0 2023-02-16 21:38 odm_b.img

-rw-rw---- 1 u0_a209 media_rw 443379712 2023-02-16 21:38 system_b.img

-rw-rw---- 1 u0_a209 media_rw 1246359552 2023-02-16 21:38 product_a.img

-rw-rw---- 1 u0_a209 media_rw 21905408 2023-02-16 21:38 odm_a.img

-rw-rw---- 1 u0_a209 media_rw 2790813696 2023-02-16 21:55 system_a.img

plato:/storage/sdcard0/Download/sup_unpack # stat -c '%n %s' *.img

odm_a.img 21905408

odm_b.img 0

product_a.img 1246359552

product_b.img 0

system_a.img 2790813696

system_b.img 443379712

vendor_a.img 2081656832

vendor_b.img 0

plato:/storage/sdcard0/Download/sup_unpack #

plato:/storage/sdcard0/Download/sup_unpack # stat -c '%n %s' *.img

odm_a.img 21905408

odm_b.img 0

product_a.img 1246359552

product_b.img 0

system_a.img 2790813696

system_b.img 443379712

vendor_a.img 2081656832

vendor_b.img 0

plato:/storage/sdcard0/Download/sup_unpack # cd ..

plato:/storage/sdcard0/Download # ls -lrt

total 8921673

-rw-rw---- 1 u0_a209 media_rw 9126805504 2023-02-16 20:40 super77.img

drwxrws--- 3 u0_a209 media_rw 3452 2023-02-16 21:30 unlock-super

drwxrws--- 2 u0_a209 media_rw 3452 2023-02-16 21:31 tools

drwxrws--- 2 u0_a209 media_rw 3452 2023-02-16 21:58 sup_unpack

d /storage/sdcard0/Download/sup_unpack/^C <

130|plato:/storage/sdcard0/Download # stat -c '%n %s' *.img

super77.img 9126805504

plato:/storage/sdcard0/Download #

./tools/lpmake --output super_new.img\

--sparse --metadata-size 65536 --super-name super\

--metadata-slots 2 --device super:9126805504\

--group slot_a:%SUPER_SIZE%\

--group slot_b:0 --partition system_a:none:%SIZE%:slot_a\

--image system_a=./system_a.img --partition vendor_a:none:%SIZE%:slot_a\

--image vendor_a=./vendor_a.img --partition product_a:none:%SIZE%:slot_a\

--image product_a=./product_a.img --partition system_ext_a:none:%SIZE%:slot_a\

--image system_ext_a=./system_ext_a.img --partition odm_a:none:%SIZE%:slot_a\

--image odm_a=./odm_a.img --partition vendor_dlkm_a:none:%SIZE%:slot_a\

--image vendor_dlkm_a=./vendor_dlkm_a.img --partition odm_b:none:0:slot_b\

--image odm_b=./odm_b.img --partition system_b:none:0:slot_b\

--image system_b=./system_b.img --partition vendor_b:none:0:slot_b\

--image vendor_b=./vendor_b.img --partition product_b:none:0:slot_b\

--image product_b=./product_b.img --partition system_ext_b:none:0:slot_b\

--image system_ext_b=./system_ext_b.img --partition vendor_dlkm_b:none:0:slot_b\

--image vendor_dlkm_b=./vendor_dlkm_b.img