-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Hi @althafvly ,
I'm trying to use Amlogic Kitchen for my X96Q Pro+ (Allwinner H728 Octa-core ARM Cortex A55).
the ROM I'm using is this: X96QProPlus_20241014-1955_uart0.img
I run awunpack.sh for level 1 available here and I get these files
.
asus@DESKTOP-SJ83KJE:~/AmlogicKitchen/level1$ tree
.
├── X96QProPlus_20241014-1955_uart0.img.dump
│ ├── Vboot-resource.fex
│ ├── Vboot.fex
│ ├── Vdtbo.fex
│ ├── Venv.fex
│ ├── Vinit_boot.fex
│ ├── Vmisc.fex
│ ├── Vsuper.fex
│ ├── Vvbmeta.fex
│ ├── Vvbmeta_system.fex
│ ├── Vvbmeta_vendor.fex
│ ├── Vvendor_boot.fex
│ ├── _iso
│ ├── arisc.fex
│ ├── aultls32.fex
│ ├── aultools.fex
│ ├── board.fex
│ ├── boot-resource.fex
│ ├── boot.fex
│ ├── boot0_nand.fex
│ ├── boot0_sdcard.fex
│ ├── boot_package.fex
│ ├── cardscript.fex
│ ├── cardtool.fex
│ ├── config.fex
│ ├── dlinfo.fex
│ ├── dtbo.fex
│ ├── env.fex
│ ├── fes1.fex
│ ├── image.cfg
│ ├── init_boot.fex
│ ├── misc.fex
│ ├── split_xxxx.fex
│ ├── sunxi.fex
│ ├── sunxi_gpt.fex
│ ├── sunxi_mbr.fex
│ ├── super.fex
│ ├── sys_config.fex
│ ├── sys_partition.fex
│ ├── toc0.fex
│ ├── toc1.fex
│ ├── u-boot-crash.fex
│ ├── u-boot.fex
│ ├── usbtool.fex
│ ├── usbtool_crash.fex
│ ├── vbmeta.fex
│ ├── vbmeta_system.fex
│ ├── vbmeta_vendor.fex
│ ├── vendor_boot-debug.fex
│ ├── vendor_boot.fex
│ └── vmlinux.fex
└── projectname.txt
3 directories, 50 files
I verify that super.fex contains a size of 1789428384
asus@DESKTOP-SJ83KJE:~/AmlogicKitchen/level1$ ls -l X96QProPlus_20241014-1955_uart0.img.dump/super.fex
-rwxrwxrwx 1 root root 1789428384 Jul 26 02:07 X96QProPlus_20241014-1955_uart0.img.dump/super.fex
inside super.flex I verify that there are some files and their respective size
I run awunpack.sh for level 2
asus@DESKTOP-SJ83KJE:~/AmlogicKitchen$ ./awunpack.sh
.....................
AllWinner Kitchen
.....................
Select level 1, 2, 3 or q/Q to exit: 2
Deleting existing level2/config
Attempting to extract partition 'system_dlkm_a'...
Dealing with extent 0 from target source 0...
Attempting to extract partition 'system_dlkm_b'...
Attempting to extract partition 'vendor_dlkm_b'...
Attempting to extract partition 'product_b'...
Attempting to extract partition 'vendor_b'...
Attempting to extract partition 'vendor_dlkm_a'...
Dealing with extent 0 from target source 0...
Attempting to extract partition 'vendor_a'...
Dealing with extent 0 from target source 0...
Attempting to extract partition 'product_a'...
Dealing with extent 0 from target source 0...
Attempting to extract partition 'system_b'...
Attempting to extract partition 'system_a'...
Dealing with extent 0 from target source 0...
Extracting system_a
Extract: Starting...
Extract: fs_config|file_contexts|fs_options saving...
Extract: fs_config|file_contexts|fs_options done.
Extract: [ 100.00% ]
Extract: The operation took: 0.115 second(s).
Extracting system_dlkm_a
/home/asus/AmlogicKitchen/bin/imgextractor.py:622: SyntaxWarning: invalid escape sequence '\+'
3, '/' + dirr + '/lost\+found' + ' ' + c.split(" ")[1])
/home/asus/AmlogicKitchen/bin/imgextractor.py:628: SyntaxWarning: invalid escape sequence '\+'
3, '/lost\+found' + ' u:object_r:rootfs:s0')
.....Extraction from system_dlkm_a.img to system_dlkm_a
.....Done! All extraction in system_dlkm_a
Extracting vendor_a
Extract: Starting...
Extract: fs_config|file_contexts|fs_options saving...
Extract: fs_config|file_contexts|fs_options done.
Extract: [ 100.00% ]
Extract: The operation took: 0.033 second(s).
Extracting vendor_dlkm_a
Extract: Starting...
Extract: fs_config|file_contexts|fs_options saving...
Extract: fs_config|file_contexts|fs_options done.
Extract: [ 100.00% ]
Extract: The operation took: 0.004 second(s).
Extracting product_a
Extract: Starting...
Extract: fs_config|file_contexts|fs_options saving...
Extract: fs_config|file_contexts|fs_options done.
Extract: [ 100.00% ]
Extract: The operation took: 0.008 second(s).
Done.
An error occurs but I don't think it's relevant
/home/asus/AmlogicKitchen/bin/imgextractor.py:622: SyntaxWarning: invalid escape sequence '\+'
3, '/' + dirr + '/lost\+found' + ' ' + c.split(" ")[1])
/home/asus/AmlogicKitchen/bin/imgextractor.py:628: SyntaxWarning: invalid escape sequence '\+'
3, '/lost\+found' + ' u:object_r:rootfs:s0')
.....Extraction from system_dlkm_a.img to system_dlkm_a
.....Done! All extraction in system_dlkm_a
now I access level 2 and I see that the *.img files that were inside super.fex were extracted and the size corresponds to when inside the super.fex file
without making any changes I will do the repack
asus@DESKTOP-SJ83KJE:~/AmlogicKitchen$ ./awpack.sh
.....................
AllWinner Kitchen
.....................
Select level 1, 2, 3 or q/Q to exit: 2
Creating product_a image
mkfs.erofs 1.8.4-gc9629116
loaded 407 fs_config entries
Build completed.
------
Filesystem UUID: 40b67b71-7eb4-30f3-363b-67285dd280c6
Filesystem total blocks: 79576 (of 4096-byte blocks)
Filesystem total inodes: 405
Filesystem total metadata blocks: 197
Filesystem total deduplicated bytes (of source files): 0
Done.
Creating system_a image
mkfs.erofs 1.8.4-gc9629116
loaded 5158 fs_config entries
Build completed.
------
Filesystem UUID: 49a27d7e-1c66-698c-6256-4fd48041f659
Filesystem total blocks: 251005 (of 4096-byte blocks)
Filesystem total inodes: 5156
Filesystem total metadata blocks: 815
Filesystem total deduplicated bytes (of source files): 0
Done.
Creating system_dlkm_a image
loaded 8 fs_config entries
Creating filesystem with parameters:
Size: 1048576
Block size: 4096
Blocks per group: 32768
Inodes per group: 64
Inode size: 256
Journal blocks: 0
Label: system_dlkm_a
Blocks: 256
Block groups: 1
Reserved block group size: 7
Created filesystem with 16/64 inodes and 34/256 blocks
resize2fs 1.47.2 (1-Jan-2025)
Resizing the filesystem on level2/temp_system_dlkm_a.img to 65 (4k) blocks.
The filesystem on level2/temp_system_dlkm_a.img is now 65 (4k) blocks long.
Done.
Creating vendor_a image
mkfs.erofs 1.8.4-gc9629116
loaded 1539 fs_config entries
Build completed.
------
Filesystem UUID: 448f4344-3eab-c462-4fbc-40622c119dcf
Filesystem total blocks: 94396 (of 4096-byte blocks)
Filesystem total inodes: 1537
Filesystem total metadata blocks: 203
Filesystem total deduplicated bytes (of source files): 0
Done.
Creating vendor_dlkm_a image
mkfs.erofs 1.8.4-gc9629116
loaded 177 fs_config entries
Build completed.
------
Filesystem UUID: 4bbcc6c5-8a69-bbbb-bc58-0fab8c49daf5
Filesystem total blocks: 5027 (of 4096-byte blocks)
Filesystem total inodes: 175
Filesystem total metadata blocks: 15
Filesystem total deduplicated bytes (of source files): 0
Done.
07-27 10:59:04.619 114829 114829 I lpmake : builder.cpp:1093 [liblp] Partition product_a will resize from 0 bytes to 325943296 bytes
07-27 10:59:04.619 114829 114829 I lpmake : builder.cpp:1093 [liblp] Partition system_a will resize from 0 bytes to 1028116480 bytes
07-27 10:59:04.619 114829 114829 I lpmake : builder.cpp:1093 [liblp] Partition system_dlkm_a will resize from 0 bytes to 266240 bytes
07-27 10:59:04.619 114829 114829 I lpmake : builder.cpp:1093 [liblp] Partition vendor_a will resize from 0 bytes to 386646016 bytes
07-27 10:59:04.619 114829 114829 I lpmake : builder.cpp:1093 [liblp] Partition vendor_dlkm_a will resize from 0 bytes to 20590592 bytes
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Here I think there is a problem because super.flex is now smaller and when I flash it, android returns an error and does not boot.
I also noticed that the files product_a.img system_a.img system_dlkm_a.img vendor_a.img vendor_dlkm_a.img that are within level 2 already have the wrong size when the super.fex file is created
I did a quick analysis to understand where the possible cause for this could be and I found that if I comment out/remove the line L28 in make_super.sh super.flex is created with the correct size.
Can someone help me understand why this is happening? And if possible, how can I fix this problem?