this instructions uses for unpack amlogic image file and unpack super.img file and then repack and flash on the device.

./bin/unpack  ./path/to/image.img
cd output/image
../../bin/simg2img super.PARTITION ./super.img
lpunpack ./super.img supers
cd supers
resize2fs ./system_a.img 1300M
e2fsck -E unshare_blocks ./system_a.imge2fsck -E unshare_blocks ./system_a.img
e2fsck -f ./system_a.img
mkdir sys
sudo losetup -P /dev/loop0 ./system_a.img
sudo mount /dev/loop0 ./sys -rw
cd sys
(make changes)
cd ..
sudo umount sys
resize2fs -M ./system_a.img
e2fsck -f ./system_a.img
resize2fs -M ./system_a.img
e2fsck -f ./system_a.img

lpmake \
  --metadata-size=65536 \
  --metadata-slots=3 \
  --device super:2097152000 \
  --group amlogic_dynamic_partitions_a:2086666240 \
  --group amlogic_dynamic_partitions_b:2086666240 \
  --partition system_a:readonly:1156333568:amlogic_dynamic_partitions_a \
  --image system_a=./system_a.img \
  --partition system_b:readonly:0:amlogic_dynamic_partitions_b \
  --partition vendor_a:readonly:157237248:amlogic_dynamic_partitions_a \
  --image vendor_a=./vendor_a.img \
  --partition vendor_b:readonly:0:amlogic_dynamic_partitions_b \
  --partition product_a:readonly:455888896:amlogic_dynamic_partitions_a \
  --image product_a=./product_a.img \
  --partition product_b:readonly:0:amlogic_dynamic_partitions_b \
  --partition odm_a:readonly:962560:amlogic_dynamic_partitions_a \
  --image odm_a=./odm_a.img \
  --partition odm_b:readonly:0:amlogic_dynamic_partitions_b \
  --partition system_ext_a:readonly:173031424:amlogic_dynamic_partitions_a \
  --image system_ext_a=./system_ext_a.img \
  --partition system_ext_b:readonly:0:amlogic_dynamic_partitions_b \
  --partition vendor_dlkm_a:readonly:59121664:amlogic_dynamic_partitions_a \
  --image vendor_dlkm_a=./vendor_dlkm_a.img \
  --partition vendor_dlkm_b:readonly:0:amlogic_dynamic_partitions_b \
  --partition system_dlkm_a:readonly:348160:amlogic_dynamic_partitions_a \
  --image system_dlkm_a=./system_dlkm_a.img \
  --partition system_dlkm_b:readonly:0:amlogic_dynamic_partitions_b \
  --partition odm_dlkm_a:readonly:348160:amlogic_dynamic_partitions_a \
  --image odm_dlkm_a=./odm_dlkm_a.img \
  --partition odm_dlkm_b:readonly:0:amlogic_dynamic_partitions_b \
  --sparse \
  --output ../super.PARTITION

./bin/repack ./name.img
./aml-burn-tool -b VIM4 -i /mnt/program/linux-amlogic-toolkit/name.img

 

tools URL address:

https://github.com/khadas/utils/tree/master

https://github.com/natinusala/linux-amlogic-toolkit/tree/master