How To Guide [Close] LeaOS GSI A13 - Samsung Galaxy Tab A7 Lite

LeaOS-GSI is a project which based on AOSP with trebledroid patches and personal patch. This is the GSI version of LeaOS for Huawei. It is available on a lot of variant
( But your SM-T22x can uses.)
**so many file structures, please select "ext4" if you don't known about its.
Download : 2022-12-23
Here
https://sourceforge.net/projects/altairfr-huawei/files/TrebleDroid-GSI/
Variant: (explain)
1. arm64_bvN : ARM64 A/B ext4 read-only - Vanilia with no SU
2. arm64_vvN : ARM64 A/B vndklite read-write - Vanilia with no SU
3. arm64_evN : ARM64 A/B erofs lz4 compression read-only - Vanilia with no SU
4. arm64_bgN : ARM64 A/B ext4 read-only - Google Apps with no SU
*5. arm64_vgN : ARM64 A/B vndklite read-write - Google Apps with no SU
6. arm64_egN : ARM64 A/B erofs lz4 compression read-only - Google Apps with no SU
Pre-installation
-Sam Stock Android 13. (Based ROM)
-Bootloader unlocked.
Flash Tools
-Odin
-Linux Sub-system for Win10, Win11 (WSL1 , WSL2)
Howto (Step-for-installation)
Note: my example was No2.
0.preparing (ubuntu environment) from my full tutorial here.
Part 1: Create CustomAP framework file For GSI Flashing with Odin.
1. Download: GSI
2. Open Ubuntu from Start Menu
3. Extract "TrebleDroid-A13-20221223-treble_arm64_vvN.IMG" from step 1 to folder /home/username/ and rename it to system.img
4.
Code:
stat -c '%n %s' *.img
output:
odm.img 4349952
product.img 1238544384
system.img 1999273984
vendor.img 652816384
5.
Code:
stat -c '%n %s' *.raw
output
super.raw 6094323712
6. check filesize of odm.img , product.img , vendor.img and super.raw
7. calculate groupmain summary ( odm + product + vendor + system)
Note: only system.IMG will changes, the other are static file size.
8. specific formular of new super image partition.
Code:
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:6094323712 \
--group main:3894984704\
--partition odm:readonly:4349952:main \
--image odm=./odm.img \
--partition system:readonly:1999273984:main \
--image system=./system.img \
--partition vendor:readonly:652816384:main \
--image vendor=./vendor.img \
--partition product:readonly:1238544384:main \
--image product=./product.img \
--sparse \
--output ./super_new.img
[sudo] password for tom: <input your password>
output
lpmake I 01-02 15:41:30 29 29 builder.cpp:1012] [liblp]Partition odm will resize from 0 bytes to 4349952 bytes
lpmake I 01-02 15:41:30 29 29 builder.cpp:1012] [liblp]Partition system will resize from 0 bytes to 1999273984 bytes
lpmake I 01-02 15:41:30 29 29 builder.cpp:1012] [liblp]Partition vendor will resize from 0 bytes to 652816384 bytes
lpmake I 01-02 15:41:30 29 29 builder.cpp:1012] [liblp]Partition product will resize from 0 bytes to 1238544384 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
9. compress your new super.img
Code:
lz4 -B6 --content-size super_new.img super_new.img.lz4
output
using blocks of size 1024 KB
Compressed 3807893192 bytes into 2236324749 bytes ==> 58.73%
10. exit ubuntu terminal
11. open folder " C:\tar-md5-script-tool"
11.1 transfer output-file (super_new.img.lz4) from ubuntu step 9 to this folder and rename it to " super.img.lz4"
11.2 copy & paste "vbmeta.img.lz4"
11.3 transfer all files from Stock AP framework dot tar
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
12. run batch.bat
13. test ouput file by dubble click open if.
if file not open or error
must redo again.
13.1 Don't rename it from " AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5" then remove it to your framework files extraction folder.
14. open odin connect your tab from download mode
if you want magisk , patch boot + vbmeta and flash it at USERDATA slot.
15. your tab reboot with prompt to factory reset data.
Trouble shooting
1. Install patch-magisk after finished flashing at AP slot.
- Data reset will happened.
2. Offline-charger must be fixed.(its for huawei charger)

Related

unpack boot.img lzma

How to unpack this boot.img
boot.img: u-boot legacy uImage, V2.0.0-67-g215089c-dirty(20120828.165942),
Linux/ARM, OS Kernel Image (lzma), 4220825 bytes, Tue Aug 28 11:59:55 2012, Load Address: 0x80008000, Entry Point: 0x80008000, Header CRC: 0x0830866D, Data CRC: 0x11
475B66,
TV Box Nano2 ATV500B
Simply, you don't. The u-boot differs from the Android boot process. Therefore your image has a different data structure than a regular Android boot image.
Sent from my Xperia Arc via Tapatalk 2
unpack and repack
Code:
### uImage original size: 3593374 ###
### Binwalk ouput for original uImage ##
DECIMAL HEX DESCRIPTION
-------------------------------------------------------------------------------------------------------
0 0x0 uImage header, header size: 64 bytes, header CRC: 0x534C30CF, created: Tue Nov 8 06:05:02 2011, image size: 3593310 bytes, Data Address: 0xFFFFFFFF, Entry Point: 0x0, data CRC: 0x672C70AA, OS: Linux, CPU: ARM, image type: Firmware Image, compression type: none, image name: LK:ZT280_H1_2n
64 0x40 uImage header, header size: 64 bytes, header CRC: 0xC6DD4500, created: Tue Nov 8 06:05:02 2011, image size: 3593246 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0x58A04739, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: lzma, image name: Linux-2.6.34
128 0x80 LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 9980736 bytes
### Remove 2 uImage headers ###
dd if=uImage of=zImage-lzma bs=1 skip=128
### Uncompress lzma kernel ###
### Compressed size: 3593246 ###
### Uncompressed size: 9980736 ###
dd if=zImage-lzma bs=1 | lzcat > zImage
### Find start of cpio ###
grep -a -b -m 1 --only-matching '070701' zImage
167936:070701
168052:070701
### Find end of cpio ###
grep -a -b -m 1 --only-matching 'TRAILER!!!' zImage
1765826:TRAILER!!!
### Add 11 to the above # to include trailer and extract cpio from kernel ###
dd if=zImage bs=1 skip=167936 count=1765837 of=initramfs_orig.cpio
### Explode the cpio ###
mkdir cpio_orig
cd cpio_orig/
cpio -v -i --no-absolute-filenames < ../initramfs_orig.cpio
### Make changes to initramfs ###
### Create new cpio ###
(cd cpio_orig; find . | cpio -o -H newc | gzip) > ../initramfs.cpio
### Write beginning of original zImage up to start of cpio to a new file ###
dd if=zImage bs=1 count=167936 of=/tmp/zImage
### Add new cpio/initramfs to the new file ###
dd if=initramfs.cpio bs=1 seek=167936 of=/tmp/zImage
### Write ending of original zImage to new file ###
### Seek below should be size of first part (167936) + size of original initramfs (1765837) ###
dd if=zImage bs=1 seek=1933773 skip=1765826 of=/tmp/zImage
### lzma compress the new zImage ###
### Uncompressed size: 9026566 ###
### Compressed size: 3808279 (larger than original zImage compressed size!?) ###
lzma -9 /tmp/zImage
### Add uImage headers to new file ###
### or should this be replaced by using the mkimage command? ###
dd if=uImage of=/tmp/uImage bs=1 count=128
### Add compressed zimage to new uImage ###
### New uImage size: 3808407 ###
dd if=/tmp/zImage.lzma bs=1 seek=128 of=/tmp/uImage
### binwalk output for new uImage ###
DECIMAL HEX DESCRIPTION
-------------------------------------------------------------------------------------------------------
0 0x0 uImage header, header size: 64 bytes, header CRC: 0x534C30CF, created: Tue Nov 8
06:05:02 2011, image size: 3593310 bytes, Data Address: 0xFFFFFFFF, Entry Point: 0x0, data CRC: 0x672C70AA, OS:
Linux, CPU: ARM, image type: Firmware Image, compression type: none, image name: LK:ZT280_H1_2n
64 0x40 uImage header, header size: 64 bytes, header CRC: 0xC6DD4500, created: Tue Nov 8
06:05:02 2011, image size: 3593246 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0x58A0473
9, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: lzma, image name: Linux-2.6.34
128 0x80 LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompre
ssed size: 9026566 bytes
248589 0x3CB0D gzip compressed data, was "\255\344\016\015!\232|.\333\017s\250\3577\366{\241\240
\005`v\321\324\2238\307DX\241l&\003k\330\203b\030\230!\245x\366\021?\211s\214\254\253\327w\354\222C\230\015\303=
64\2126", has comment, from Z-System, comment, encrypted, last modified: Sun Jan 14 00:12:51 2024
Thank you!
andrewavp said:
Code:
### uImage original size: 3593374 ###
### Binwalk ouput for original uImage ##
DECIMAL HEX DESCRIPTION
-------------------------------------------------------------------------------------------------------
0 0x0 uImage header, header size: 64 bytes, header CRC: 0x534C30CF, created: Tue Nov 8 06:05:02 2011, image size: 3593310 bytes, Data Address: 0xFFFFFFFF, Entry Point: 0x0, data CRC: 0x672C70AA, OS: Linux, CPU: ARM, image type: Firmware Image, compression type: none, image name: LK:ZT280_H1_2n
64 0x40 uImage header, header size: 64 bytes, header CRC: 0xC6DD4500, created: Tue Nov 8 06:05:02 2011, image size: 3593246 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0x58A04739, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: lzma, image name: Linux-2.6.34
128 0x80 LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 9980736 bytes
### Remove 2 uImage headers ###
dd if=uImage of=zImage-lzma bs=1 skip=128
### Uncompress lzma kernel ###
### Compressed size: 3593246 ###
### Uncompressed size: 9980736 ###
dd if=zImage-lzma bs=1 | lzcat > zImage
### Find start of cpio ###
grep -a -b -m 1 --only-matching '070701' zImage
167936:070701
168052:070701
### Find end of cpio ###
grep -a -b -m 1 --only-matching 'TRAILER!!!' zImage
1765826:TRAILER!!!
### Add 11 to the above # to include trailer and extract cpio from kernel ###
dd if=zImage bs=1 skip=167936 count=1765837 of=initramfs_orig.cpio
### Explode the cpio ###
mkdir cpio_orig
cd cpio_orig/
cpio -v -i --no-absolute-filenames < ../initramfs_orig.cpio
### Make changes to initramfs ###
### Create new cpio ###
(cd cpio_orig; find . | cpio -o -H newc | gzip) > ../initramfs.cpio
### Write beginning of original zImage up to start of cpio to a new file ###
dd if=zImage bs=1 count=167936 of=/tmp/zImage
### Add new cpio/initramfs to the new file ###
dd if=initramfs.cpio bs=1 seek=167936 of=/tmp/zImage
### Write ending of original zImage to new file ###
### Seek below should be size of first part (167936) + size of original initramfs (1765837) ###
dd if=zImage bs=1 seek=1933773 skip=1765826 of=/tmp/zImage
### lzma compress the new zImage ###
### Uncompressed size: 9026566 ###
### Compressed size: 3808279 (larger than original zImage compressed size!?) ###
lzma -9 /tmp/zImage
### Add uImage headers to new file ###
### or should this be replaced by using the mkimage command? ###
dd if=uImage of=/tmp/uImage bs=1 count=128
### Add compressed zimage to new uImage ###
### New uImage size: 3808407 ###
dd if=/tmp/zImage.lzma bs=1 seek=128 of=/tmp/uImage
### binwalk output for new uImage ###
DECIMAL HEX DESCRIPTION
-------------------------------------------------------------------------------------------------------
0 0x0 uImage header, header size: 64 bytes, header CRC: 0x534C30CF, created: Tue Nov 8
06:05:02 2011, image size: 3593310 bytes, Data Address: 0xFFFFFFFF, Entry Point: 0x0, data CRC: 0x672C70AA, OS:
Linux, CPU: ARM, image type: Firmware Image, compression type: none, image name: LK:ZT280_H1_2n
64 0x40 uImage header, header size: 64 bytes, header CRC: 0xC6DD4500, created: Tue Nov 8
06:05:02 2011, image size: 3593246 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0x58A0473
9, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: lzma, image name: Linux-2.6.34
128 0x80 LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompre
ssed size: 9026566 bytes
248589 0x3CB0D gzip compressed data, was "\255\344\016\015!\232|.\333\017s\250\3577\366{\241\240
\005`v\321\324\2238\307DX\241l&\003k\330\203b\030\230!\245x\366\021?\211s\214\254\253\327w\354\222C\230\015\303=
64\2126", has comment, from Z-System, comment, encrypted, last modified: Sun Jan 14 00:12:51 2024
Click to expand...
Click to collapse
I know this was posted almost a year ago, but thank you! I've been trying to figure out the finer details concerning this style of uImage by examining files in a hex editor and reading scripts that only output the initramfs portion. The comments and commands posted here told me exactly what I needed to know.
ShaunMT
shaunmt said:
Title: Thank you!
Click to expand...
Click to collapse
I was taught to say thanks by clicking on the icon:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
THANKS
.
shaunmt said:
I know this was posted almost a year ago, but thank you! I've been trying to figure out the finer details concerning this style of uImage by examining files in a hex editor and reading scripts that only output the initramfs portion. The comments and commands posted here told me exactly what I needed to know.
ShaunMT
Click to expand...
Click to collapse
Did you by any chance found a way to pack back the boot.img? the "packing" part of this does not seem to work for me
niabi said:
Did you by any chance found a way to pack back the boot.img? the "packing" part of this does not seem to work for me
Click to expand...
Click to collapse
I don't remember if this was the exact format of the devices that I've been supporting, but I use some scripts created by CXZ at slatedroid for the Ainol series. You should be able to find them in the threads there.
ShaunMT
shaunmt said:
I don't remember if this was the exact format of the devices that I've been supporting, but I use some scripts created by CXZ at slatedroid for the Ainol series. You should be able to find them in the threads there.
ShaunMT
Click to expand...
Click to collapse
Thanks I was just coming to say that Finless was kind enough to share his script, and I am now able to pack it back up
How To Add LZMA Files
Hi,
There is a lot of great information here. Maybe someone here can help me. Is there a way to add LZMA files? You have your uImage; you extract the kernel and then decompress it and run binwalk on it to get this (example):
Code:
DECIMAL HEX DESCRIPTION
-------------------------------------------------------------------------------------------------------
184564 0x2D0F4 ASCII cpio archive (SVR4 with no CRC), file name: "dev"
184680 0x2D168 ASCII cpio archive (SVR4 with no CRC), file name: "dev/console"
184804 0x2D1E4 ASCII cpio archive (SVR4 with no CRC), file name: "root"
184920 0x2D258 ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!"
5797868 0x5877EC Linux kernel version "3.0.35-06433-g8e02e5d-dirty ([email protected]) (gcc version [email protected]) (gcc version 4.6.x-google 20120106 (prerelease) (GCC)ogle 20120106 (prerelease) (GCC) ) #6 SMP PREEMPT Fri May 30 03) ) #6 SMP PREEMPT Fri May 30 03:07:36 MST 2014"
5811760 0x58AE30 LZMA compressed data, properties: 0x02, dictionary size: 16777216 bytes, uncompressed size: 50331648 bytes
5813168 0x58B3B0 gzip compressed data, from Unix, NULL date: Wed Dec 31 17:00:00 1969, max compression
5831784 0x58FC68 LZMA compressed data, properties: 0x01, dictionary size: 33554432 bytes, uncompressed size: 50331648 bytes
5888826 0x59DB3A LZMA compressed data, properties: 0x02, dictionary size: 33554432 bytes, uncompressed size: 133128 bytes
5935896 0x5A9318 LZMA compressed data, properties: 0x48, dictionary size: 33554432 bytes, uncompressed size: 50331648 bytes
Now say I wanted to add an LZMA file to the end of this; Decimal 5935896, or say somewhere else; between Decimals 5813168 and 5831784. How would I do that using the DD Utility?

[Tutorial] Explaining stock boot image and procedure for making new

Because a lot of users not understand procedure in creating right boot image, asking me by pm for help...etc, I going to explain how I doing these things! Here is an simple tutorial for you!
Reguired:
- kernel.elf (from stock rom)
- SonyXperia Flasher (for conversation sin/elf...etc) -> http://androxyde.github.com/
- linux tools (from attachment)
- H&D Hex Editor -> http://mh-nexus.de/en/hxd/ (to compare and learn from pictures)
To understand some thing about battery drain (battery drainage when elf.3 is not inside new boot image)... see Gingerbread boot image thread to figure out some things about battery drainage that we tested and confirmed when elf.3 file is not injected into new custom boot image -> http://forum.xda-developers.com/showthread.php?t=1888247
Ok, it was for GB, lets start now with ICS boot image format (its diferent than Gingerbread, but reguire elf.3). What is an elf.3? Sory I not know, seems something reguired for bootloader???
Every ICS stock boot image contain 4 segments: zImage (kernel), ramdisk, cmdline, and famous elf.3 segment. Without elf.3 we had battery drainage (its confirmed in my Gingerbread thread). Custom boot images not contain these elf.3 (only mine). To understand how many "segments" is inside an kernel.elf (boot.img or boot image) file, open an kernel.elf with H&D and look into this picture:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So there is 4 offsets to segments (kernel, ramdisk and cmdline, elf.3 is not but its 0x70 for GB or 0x90 for ICS). You can manually extract every segment by going to specific offset and copy paste to new file, than saving these new file for example to kernel or ramdisk or cmdline... but its slow procedure and is not reguired because we have tools for automating these procedure.
Here is some pictures how to extract elf.3 and cmdline (reguired files for making new boot image) from an stock boot imge:
- first picture is for extracting elf.3 -> http://img688.imageshack.us/img688/5333/29055229.jpg
- second picture is for extracting cmdline -> http://img201.imageshack.us/img201/7889/10643069.jpg
I will not explain in detail how to extract segments by an tool, but you can do it using this tutorial (extracting manually) or you can do it by SoyXperia Flasher! This tutorial is only for understanding boot image format and tutorial for making new boot image.
To compile new boot.img you need all segments ready, you need tool from attachment "makebootimg.sh", you need Sony tool (from attachment) mkelf.py and tool mkbootfs for compressing ramdisk folder to initrd.gz
Reguired segments is:
- zImage (kernel)
- ramdisk
- cmdline (kernel command line parameters)
- elf.3 (???)
Reguired tool:
- mkelf.py (Sony tool for generating kernel.elf)
- makebootimg.sh (automated script for making new boot image)
- mkbootfs (for compresing ramdisk -> cpio -> finaly to initrd.gz)
To make new boot.img modify makebootimg.sh, change all paths to match paths for your linux folders, than run makebootimg.sh and your boot.img is ready. Hope this part of tutorial help you for understanding something about boot image for Xperia devices?! :laugh:
Thanks for sharing the tutorial, I'm getting an error about missing ./initr, when I execute this part of the script:
/root/android/tools/mkbootfs ./initr | gzip > initrd.gz
cp -fr initrd.gz tools/initrd.gz
Click to expand...
Click to collapse
What is missing?
Thanks in advance
Nice post. Really help me a lot.
Thanks
Sent from LT22i via Tapatalk
elia222 said:
Thanks for sharing the tutorial, I'm getting an error about missing ./initr, when I execute this part of the script:
What is missing?
Thanks in advance
Click to expand...
Click to collapse
Missing is ramdisk folder! To get it extract initrd.gz !!! How to extract? Simple:
mkdir initr
cd initr
gunzip < ../initrd.gz | cpio -i -d
Click to expand...
Click to collapse
This will help guys who looking for tutorial about extracting ramdsik (initrd.gz)
Thanks for the tutorial.......
AW: [Tutorial] Explaining stock boot image and procedure for making new
Thanks for sharing this munjeni!
If we are lucky fxp now can create complete kernels to get rid of their battery drain.
AW: [Tutorial] Explaining stock boot image and procedure for making new
thebrainkafka said:
Thanks for sharing this munjeni!
If we are lucky fxp now can create complete kernels to get rid of their battery drain.
Click to expand...
Click to collapse
Seems fxp still sees no need in adding this elf3
:what:
thebrainkafka said:
Seems fxp still sees no need in adding this elf3
:what:
Click to expand...
Click to collapse
Why is that mate, why do you think so?
Help me master... :'(
Made a boot.img your tools with zImage(self compiled), ramdisk(stock sony), elf3(extract manually from stock sony) and the cmdline(manually extracted).
Flashed it to phone, now it gets started shows black screen (boot loop). Can't even see sony logo.
Seems your kernel is not working or you used an ramdisk which is not compatible with your rom! To extract ramdisk here is small how to which I using only -> http://img716.imageshack.us/img716/9527/ramdiskblock.jpg
Thanks man.. but still lil bit confused..
I have found the blocks, So is this ramdisk? (Just need to hit ENTER)
http://img547.imageshack.us/img547/7374/ramdisk.png
And then I'm supposed to save it in new file and name it ramdisk.gz. right ?
But before it I should remove this selected block?
http://img802.imageshack.us/img802/1931/remove.png
EDIT 1:
Is error: cannot open directory './initr' my problem??
Code:
error: cannot open directory './initr'
44+0 records in
44+0 records out
44 bytes (44 B) copied, 0.000261765 s, 168 kB/s
99+0 records in
99+0 records out
99 bytes (99 B) copied, 0.000482324 s, 205 kB/s
309310+1 records in
309310+1 records out
4948966 bytes (4.9 MB) copied, 1.39095 s, 3.6 MB/s
EDIT 2: I figured out the things and what I found is
Ramdisk size is 1.8 MB
zImage size is 5MB
Original boot.img size is 6.8 MB
The boot.img I made size is 5 MB(after merging with ramdisk, elf3, cmdline and zImage).
initrd.gz size is 20 bytes
So its clear ramdisk is missing from my boot.img. What can be the reason master? Is the problem path related in makebootimg.sh? :banghead:
EDIT 3
my makebootimg.sh
Code:
#!/bin/bash
rm -rf /home/divaksh/android/sony/sola/cm9/tools/modules/*
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/arch/arm/boot/zImage /home/divaksh/android/sony/sola/cm9/tools/
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/*.ko /home/divaksh/android/sony/sola/cm9/tools/modules/
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/*/*.ko /home/divaksh/android/sony/sola/cm9/tools/modules/
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/*/*/*.ko /home/divaksh/android/sony/sola/cm9/tools/modules/
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/*/*/*/*.ko /home/divaksh/android/sony/sola/cm9/tools/modules/
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/*/*/*/*/*.ko /home/divaksh/android/sony/sola/cm9/tools/modules/
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/*/*/*/*/*/*.ko /home/divaksh/android/sony/sola/cm9/tools/modules/
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/*/*/*/*/*/*/*.ko /home/divaksh/android/sony/sola/cm9/tools/modules/
cp -fr /home/divaksh/android/sony/sony_kernel/kernel/*/*/*/*/*/*/*/*.ko /home/divaksh/android/sony/sola/cm9/tools/modules/
cd /home/divaksh/android/sony/sola/cm9
/home/divaksh/android/tools/mkbootfs ./initr | gzip > initrd.gz
cp -fr initrd.gz tools/initrd.gz
cd tools
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected]
dd if=kernel.elf of=kernel.elf.bak bs=1 count=44
printf "\x04" >04
cat kernel.elf.bak 04 >kernel.elf.bak2
rm -rf kernel.elf.bak
dd if=kernel.elf of=kernel.elf.bak bs=1 skip=45 count=99
cat kernel.elf.bak2 kernel.elf.bak >kernel.elf.bak3
rm -rf kernel.elf.bak kernel.elf.bak2
cat kernel.elf.bak3 elf.3 >kernel.elf.bak
rm -rf kernel.elf.bak3
dd if=kernel.elf of=kernel.elf.bak2 bs=16 skip=79
cat kernel.elf.bak kernel.elf.bak2 >kernel.elf.bak3
rm -rf kernel.elf.bak kernel.elf.bak2 kernel.elf 04
mv kernel.elf.bak3 boot.img
now getting this error
Code:
[email protected]:~$ cd ~/android/tools
[email protected]:~/android/tools$ sh makebootimg.sh
cp: cannot stat `/home/divaksh/android/sony/sony_kernel/kernel/*.ko': No such file or directory
cp: cannot stat `/home/divaksh/android/sony/sony_kernel/kernel/*/*.ko': No such file or directory
cp: cannot stat `/home/divaksh/android/sony/sony_kernel/kernel/*/*/*/*/*.ko': No such file or directory
cp: cannot stat `/home/divaksh/android/sony/sony_kernel/kernel/*/*/*/*/*/*/*.ko': No such file or directory
cp: cannot stat `/home/divaksh/android/sony/sony_kernel/kernel/*/*/*/*/*/*/*/*.ko': No such file or directory
error: cannot open directory './initr'
Traceback (most recent call last):
File "mkelf.py", line 182, in <module>
main(sys.argv[1:])
File "mkelf.py", line 159, in main
size = os.path.getsize(seg.file)
File "/usr/lib/python2.7/genericpath.py", line 49, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: 'cmdline'
dd: opening `kernel.elf': No such file or directory
cat: kernel.elf.bak: No such file or directory
dd: opening `kernel.elf': No such file or directory
cat: kernel.elf.bak: No such file or directory
cat: elf.3: No such file or directory
dd: opening `kernel.elf': No such file or directory
cat: kernel.elf.bak2: No such file or directory
[email protected]:~/android/tools$
My directory structure(I don't know how to tell but I know you will understand) :
tools >> /home/divaksh/android/tools
zImage >> /home/divaksh/android/sony/sony_kernel/kernel/arch/arm/boot
ramdisk,cmdline, elf3 >> /home/divaksh/android/sony/sola/cm9
thank you master :good:
Divaksh said:
Thanks man.. but still lil bit confused..
I have found the blocks, So is this ramdisk? (Just need to hit ENTER)
http://img547.imageshack.us/img547/7374/ramdisk.png
Yes!
And then I'm supposed to save it in new file and name it ramdisk.gz. right ? Yes!
But before it I should remove this selected block?
http://img802.imageshack.us/img802/1931/remove.png
EDIT 1:
Is error: cannot open directory './initr' my problem?? Read carefully our thread, you will find answer about that!
Code:
error: cannot open directory './initr'
44+0 records in
44+0 records out
44 bytes (44 B) copied, 0.000261765 s, 168 kB/s
99+0 records in
99+0 records out
99 bytes (99 B) copied, 0.000482324 s, 205 kB/s
309310+1 records in
309310+1 records out
4948966 bytes (4.9 MB) copied, 1.39095 s, 3.6 MB/s
EDIT 2: I figured out the things and what I found is
Ramdisk size is 1.8 MB
zImage size is 5MB
Original boot.img size is 6.8 MB
The boot.img I made size is 5 MB(after merging with ramdisk, elf3, cmdline and zImage).
initrd.gz size is 20 bytes
Initrd is missing because missing ./initr
Click to expand...
Click to collapse
munjeni said:
Read carefully our thread, you will find answer about that!
Initrd is missing because missing ./initr
Click to expand...
Click to collapse
I read it already, Reading it from last 2 days :'( but my problem is I lost in directories. :'( :'(
Tools directories 1 >> /home/divaksh/android/sony/sola/cm9/tools
Tools directories 2 >> /home/divaksh/android/tools
zImage directory >> /home/divaksh/android/sony/sony_kernel/kernel/arch/arm/boot
I don't know where to place tools files.
I don't know where to place cmdline, ramdisk.gz and elf3.
I don't know where to create initr directory, at what location and run gunzip < ../initrd.gz | cpio -i -d
please tell me correct locations.
#!/bin/bash
rm -rf /root/android/sony/go/ics/tools/modules/*
cp -fr /root/android/sony/sony_kernel/kernel/arch/arm/boot/zImage /root/android/sony/go/ics/tools/
cp -fr /root/android/sony/sony_kernel/kernel/*.ko /root/android/sony/go/ics/tools/modules/
cp -fr /root/android/sony/sony_kernel/kernel/*/*.ko /root/android/sony/go/ics/tools/modules/
cp -fr /root/android/sony/sony_kernel/kernel/*/*/*.ko /root/android/sony/go/ics/tools/modules/
cp -fr /root/android/sony/sony_kernel/kernel/*/*/*/*.ko /root/android/sony/go/ics/tools/modules/
cp -fr /root/android/sony/sony_kernel/kernel/*/*/*/*/*.ko /root/android/sony/go/ics/tools/modules/
cp -fr /root/android/sony/sony_kernel/kernel/*/*/*/*/*/*.ko /root/android/sony/go/ics/tools/modules/
cp -fr /root/android/sony/sony_kernel/kernel/*/*/*/*/*/*/*.ko /root/android/sony/go/ics/tools/modules/
cp -fr /root/android/sony/sony_kernel/kernel/*/*/*/*/*/*/*/*.ko /root/android/sony/go/ics/tools/modules/
cd /root/android/sony/go/ics
/root/android/tools/mkbootfs ./initr | gzip > initrd.gz
cp -fr initrd.gz tools/initrd.gz
cd tools
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected]
dd if=kernel.elf of=kernel.elf.bak bs=1 count=44
printf "\x04" >04
cat kernel.elf.bak 04 >kernel.elf.bak2
rm -rf kernel.elf.bak
dd if=kernel.elf of=kernel.elf.bak bs=1 skip=45 count=99
cat kernel.elf.bak2 kernel.elf.bak >kernel.elf.bak3
rm -rf kernel.elf.bak kernel.elf.bak2
cat kernel.elf.bak3 elf.3 >kernel.elf.bak
rm -rf kernel.elf.bak3
dd if=kernel.elf of=kernel.elf.bak2 bs=16 skip=79
cat kernel.elf.bak kernel.elf.bak2 >kernel.elf.bak3
rm -rf kernel.elf.bak kernel.elf.bak2 kernel.elf 04
mv kernel.elf.bak3 boot.img
Click to expand...
Click to collapse
Top dir is:
/root/android/sony/go/ics
Tools dir is:
/root/android/sony/go/ics/tools
Extracted ramdsik dir(you need to extract ramdisk and put into initr):
/root/android/sony/go/ics/initr
Kernel source code: /root/android/sony/sony_kernel/kernel
Kernel modules is copied to the /root/android/sony/go/ics/tools/modules
Its simple easy to figure out all things by analysing bash script! Its not hard!
munjeni said:
Top dir is:
/root/android/sony/go/ics
Tools dir is:
/root/android/sony/go/ics/tools
Extracted ramdsik dir(you need to extract ramdisk and put into initr):
/root/android/sony/go/ics/initr
Kernel source code: /root/android/sony/sony_kernel/kernel
Kernel modules is copied to the /root/android/sony/go/ics/tools/modules
Its simple easy to figure out all things by analysing bash script! Its not hard!
Click to expand...
Click to collapse
It seems everything is right is my script.
All I missing is ramdisk is not extracting for me
I run
Code:
gunzip < ramdisk.gz | cpio -i -d
get this
Code:
gzip: stdin: not in gzip format
cpio: premature end of archive
EDIT
I added 00000000 00000000 00000000 in end of the ramdisk and problem is gone..
so If my phone locked BL i can flash custom kernel, with this method?
kaito83 said:
so If my phone locked BL i can flash custom kernel, with this method?
Click to expand...
Click to collapse
NO!
?
munjeni said:
Because a lot of users not understand procedure in creating right boot image, asking me by pm for help...etc, I going to explain how I doing these things! Here is an simple tutorial for you!
- second picture is for extracting cmdline -> http://img201.imageshack.us/img201/7889/10643069.jpg
Click to expand...
Click to collapse
is it possible to update the image ?.... because the link is not available
Thx
Deleted ...

Make Cyanogenmod ROM zip without creating the .img files

hey guys,
For the past few days I've tried building Cyanogenmod 12 for my device. The build process seems to finish but my build is stuck at 'creating system.img' file. my terminal output is:
Code:
Install: /home/ishtiaque/CM12/android/system/out/target/product/codina/system/app/Email/Email.apk
build/tools/generate-notice-files.py /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/NOTICE.txt /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/NOTICE.html "Notices for files contained in the filesystem images in this directory:" /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/NOTICE_FILES/src
Combining NOTICE files into HTML
Combining NOTICE files into text
Installed file list: /home/ishtiaque/CM12/android/system/out/target/product/codina/installed-files.txt
Target system fs image: /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/PACKAGING/systemimage_intermediates/system.img
Running: mkuserimg.sh -s /home/ishtiaque/CM12/android/system/out/target/product/codina/system /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 641728512 /home/ishtiaque/CM12/android/system/out/target/product/codina/root/file_contexts
make_ext4fs -s -T -1 -S /home/ishtiaque/CM12/android/system/out/target/product/codina/root/file_contexts -l 641728512 -a system /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/PACKAGING/systemimage_intermediates/system.img /home/ishtiaque/CM12/android/system/out/target/product/codina/system
Creating filesystem with parameters:
Size: 641728512
Block size: 4096
Blocks per group: 32768
Inodes per group: 7840
Inode size: 256
Journal blocks: 2448
Label:
Blocks: 156672
Block groups: 5
Reserved block group size: 39
Created filesystem with 2570/39200 inodes and 106418/156672 blocks
now I've tried re-downloading the sources and building again after waiting overnight at this step but it just doesn't finish.
So my question is: can I skip the creation of these .img files and proceed to making the flashable zip in any way? I don't have fastboot option for my device afterall so its quite unnecessary to create these image files (it seems to me)
Thanks
Edit: according to the above output, a system.img file is actually produced in the systemimage_intermediates but it doesn't ge tcopied in the /product/codina folder
ishtiaque9 said:
hey guys,
Code:
Install: /home/ishtiaque/CM12/android/system/out/target/product/codina/system/app/Email/Email.apk
build/tools/generate-notice-files.py /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/NOTICE.txt /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/NOTICE.html "Notices for files contained in the filesystem images in this directory:" /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/NOTICE_FILES/src
Combining NOTICE files into HTML
Combining NOTICE files into text
Installed file list: /home/ishtiaque/CM12/android/system/out/target/product/codina/installed-files.txt
Target system fs image: /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/PACKAGING/systemimage_intermediates/system.img
Running: mkuserimg.sh -s /home/ishtiaque/CM12/android/system/out/target/product/codina/system /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 641728512 /home/ishtiaque/CM12/android/system/out/target/product/codina/root/file_contexts
make_ext4fs -s -T -1 -S /home/ishtiaque/CM12/android/system/out/target/product/codina/root/file_contexts -l 641728512 -a system /home/ishtiaque/CM12/android/system/out/target/product/codina/obj/PACKAGING/systemimage_intermediates/system.img /home/ishtiaque/CM12/android/system/out/target/product/codina/system
Creating filesystem with parameters:
Size: 641728512
Block size: 4096
Blocks per group: 32768
Inodes per group: 7840
Inode size: 256
Journal blocks: 2448
Label:
Blocks: 156672
Block groups: 5
Reserved block group size: 39
Created filesystem with 2570/39200 inodes and 106418/156672 blocks
Click to expand...
Click to collapse
I'm having same problem, do you know how to fix?
hastalafiesta said:
I'm having same problem, do you know how to fix?
Click to expand...
Click to collapse
hey hastalafiesta,
apparently I managed to get past this point. there are several files you need to edit:
1. build/core/Makefile: here you have to enter several lines which allow you to skip recovery_from_boot.p file (which wasn't created on Cyanogenmod 11 idk why)
Code:
# The system partition needs room for the recovery image as well. We
# now store the recovery image as a binary patch using the boot image
# as the source (since they are very similar). Generate the patch so
# we can see how big it's going to be, and include that in the system
# image size check calculation.
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch)
ifndef BOARD_CUSTOM_BOOTIMG_MK
ifeq ($(CM_BUILD),)
RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p
else
RECOVERY_FROM_BOOT_PATCH :=
endif
else
RECOVERY_FROM_BOOT_PATCH :=
endif
$(RECOVERY_FROM_BOOT_PATCH): $(INSTALLED_RECOVERYIMAGE_TARGET) \
$(INSTALLED_BOOTIMAGE_TARGET) \
$(HOST_OUT_EXECUTABLES)/imgdiff \
$(HOST_OUT_EXECUTABLES)/bsdiff
@echo -e ${CL_CYN}"Construct recovery from boot"${CL_RST}
mkdir -p $(dir [email protected])
PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(HOST_OUT_EXECUTABLES)/imgdiff $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) [email protected]
endif
$(INSTALLED_SYSTEMIMAGE): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH) | $(ACP)
@echo -e ${CL_CYN}"Install system fs image: [email protected]"${CL_RST}
$(copy-file-to-target)
$(hide) $(call assert-max-image-size,[email protected] $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs)
systemimage: $(INSTALLED_SYSTEMIMAGE)
.PHONY: systemimage-nodeps snod
systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \
| $(INTERNAL_USERIMAGES_DEPS)
@echo "make [email protected]: ignoring dependencies"
$(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE))
$(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs)
ifneq (,$(filter systemimage-nodeps snod, $(MAKECMDGOALS)))
ifeq (true,$(WITH_DEXPREOPT))
$(warning Warning: with dexpreopt enabled, you may need a full rebuild.)
endif
endif
#######
## system tarball
match the first and last comment to find the relevant sections in the file, then replace.
2. build/tools/post_process_props.py: add the lines that start with '+'
Code:
def mangle_default_prop(prop):
# If ro.debuggable is 1, then enable adb on USB by default
# (this is for userdebug builds)
+ prop.put("ro.secure", "0")
+ prop.put("ro.adb.secure", "0")
if prop.get("ro.debuggable") == "1":
val = prop.get("persist.sys.usb.config")
if val == "":
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 7908b70..732c8c1 100755
3. build/tools/releasetools/common.py: same as post_process_props
Code:
def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img,
info_dict=None):
+ pass
+
+def MakeRecoveryPatch2(input_dir, output_sink, recovery_img, boot_img,
+ info_dict=None):
"""Generate a binary patch that creates the recovery image starting
with the boot image. (Most of the space in these images is just the
kernel, which is identical for the two, so the resulting patch
and voila! your build will finish and a zip will form. try flashing it :good:
credits for the edits: @nieltg
~ishtiaque
ishtiaque9 said:
Code:
def mangle_default_prop(prop):
# If ro.debuggable is 1, then enable adb on USB by default
# (this is for userdebug builds)
+ prop.put("ro.secure", "0")
+ prop.put("ro.adb.secure", "0")
if prop.get("ro.debuggable") == "1":
val = prop.get("persist.sys.usb.config")
if val == "":
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 7908b70..732c8c1 100755
Click to expand...
Click to collapse
Actually, I use this part of code to force-enable ADB debugging in my build..
So, this part of code isn't mandatory.. Sorry!
nieltg said:
Actually, I use this part of code to force-enable ADB debugging in my build..
So, this part of code isn't mandatory.. Sorry!
Click to expand...
Click to collapse
any developer needs ADB

Accessories CustomAP 2022

The only way to get away from the official firmware.​Changes Degoogle (LeOS-TD.2.0 ) A13 GSI Home Launcher For SM-T225
Flash GSI with Odin Only (no fastboot(D) or TWRP needed)
1.Unlocked BootLoader. 2.-T22X with Stock ROM pre-installed. 3.Odin 4.Linux Sub-system wins10,11 5.https://github.com/ChromiumOS-Guy/SuperPatcherGSI :Autmated Script to Patch a Super.img with a GSI in python 3. "SuperPatcherGSI-x64.AppImage"...
forum.xda-developers.com
FastbootD
☆☆☆ Tips and Tricks For [ LOS TD Unofficial GSI ] latest 2023-03-24
microG
OneUi 5.1 , The Last Update Android Version For Tab A7 Lite / The best way to process GSIs /LineageOS 20 "Light" v.22-03-2023 works
PDA / AP version T225XXU2CWB3 CSC T225OXM2CWB3 version MODEM / CP T225XXU2CWB3 version https://www.sammyfans.com/2023/03/22/one-ui-5-1-features-looks-on-galaxy-tablets/ T225XXU2CWB3 (Can't downgrade) Download FastbootD here Full GSIs...
forum.xda-developers.com
FastbootD
AOSP GSI A13
for this device A/B Partition ( Dynamic partition) Based on Stock Android 11,12 ,13​
Enable Linux Subsystem and Install Ubuntu in Windows 10,11
(WSL2 For modify GSI system image)
->A generic method of patching any Android super images
->Creating CustomAP framework file for Odin flashing tool.​
->Using Android 11 Fastboot Mode For install GSIs.
(Required TWRP , Fastboot Driver for Win)
see...Attachments for download.
✓ Tricks for Selecting Your GSIs
Test GSIs with VegaBobo/DSU First
IF it works well
Uses Native CustomAP installation.
(DSU v2 Not supported Stock A12 But works with Stock A13 )
Much much more comfortable and safe
No Computer needed.
No TWRP No Fastboot
​Tutorial Step by Step ( Select Link below)
Part 1: Create CustomAP framework file For GSI Flashing with Odin.
Part 2: Modified sub-partition of super.img
Part 3: Advanced CustomAP (for changing Read Only to Read/write System)
Read only 2 Read/Write Partition.
Special Part VegaBobo DSU
Part 4: CustomAP for Sam Mobile (Draft)
Part 5: FastbootD (New way to replace CustomAP)
https://forum.xda-developers.com/t/...laces-customap-report-back-will-help.4537083/
Attachments Download for TWRP (Stock A11 only --no touch supported)
​
Part 2​Modified sub-partition of super.img​Step by Step​CREATE CustomAP for Odin Flashing with Patching Dynamic Partitions.​​*** Uses GSIs with (Vndk)Lite Variant only.(No Slim)​
*** the continue part of Step by Step CREATE CustomAP framework file for GSI Flashing with Odin.
(Required Win10, 11 with wsl2 or Ubuntu or VirtualBox)​
(Our scope)​What are we doing now ?​1) unpacking super.raw with imjtool. ( super.img.lz4 -->super.img-->super.raw)
2) resizing system.img (in order to insert our modifications to the rom)
3) mounting system.img (Read/Write System)
4) do our modifications
5) umounting system
6) shrink edited system.img to the minimal size
7) generating new super.img
8) Create customAP file ( for flashing it to our device with odin.)
( Essencial tools)​Extract Sub-Partition inside super.img.lz4 tool​## Download Samsung framework file. (Stock Firmware)
## Extract "super.img.lz4" from (AP framework file) with (unzip FILE.zip) command. or uses utility from win 10
## Decompress "super.img" from "super.img.lz4" with LZ4 command
## sparse format ""super.raw" from "super.img" with simg2img command
## Use imjtool to extract the partitions of super.raw. Notice that partitions in a super image are split into several groups.
(The exact grouping varies across devices/OS versions, so one should always use imjtool to check first.)
Code:
wget http://newandroidbook.com/tools/imjtool.tgz && tar xzvf imjtool.tgz
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
imjtool v2.0 beta1
*You may also use the official lpunpack for extraction but it can’t display the group schema.
Code:
./imjtool.ELF64 super.raw extract
output:
MMapped: 0x7f5f4a89d000, imgMeta 0x7f5f4a89e000
liblp dynamic partition (super.img) - Blocksize 0x1000, 2 slots
LP MD Header @0x3000, version 10.0, with 4 logical partitions on block device of 5812 GB, at partition super, first sector: 0x800
Partitions @0x3080 in 2 groups:
Group 0: default
Group 1: main
Name: system (read-only, Linux Ext2/3/4/? Filesystem Image, @0x100000 spanning 1 extents of 3 GB) - extracted
Name: product (read-only, Linux Ext2/3/4/? Filesystem Image, @0xe6700000 spanning 1 extents of 1 GB) - extracted
Name: vendor (read-only, Linux Ext2/3/4/? Filesystem Image, @0x12d500000 spanning 1 extents of 685 MB) - extracted
Name: odm (read-only, Linux Ext2/3/4/? Filesystem Image, @0x158300000 spanning 1 extents of 4 MB) - extracted
Note: Notice file size of "system.img" =3GB
Download Samsung Firmware tool​Install Bifort
Releases · zacharee/SamloaderKotlin
Contribute to zacharee/SamloaderKotlin development by creating an account on GitHub.
github.com
Download "Bifrost_Linux.zip"
Extract to home
change directory to
Code:
cd Bifrost/bin
give execute permission
Code:
chmod +x Bifrost
Run apps
Code:
./Bifrost
CSC Samsung code https://technastic.com/csc-home-csc-samsung-odin/
​Repack Partition Tools​Download otatools
otatools.zip
drive.google.com
Extract to home
Give its execute permission or 0755
Code:
cd otatools/bin
Code:
chmod +x lpmake
Interact with the internal partition’s file systems tools​## Available in common Linux distributions
Extract lz4 archirve: lz4
Usage :
lz4 [arg] [input] [output]
input : a filename
with no FILE, or when FILE is - or stdin, read standard input
Arguments :
-1 : Fast compression (default)
-9 : High compression
-d : decompression (default for .lz4 extension)
-z : force compression
-D FILE: use FILE as dictionary
-f : overwrite output without prompting
-k : preserve source files(s) (default)
--rm : remove source file(s) after successful de/compression
-h/-H : display help/long help and exit
Sparse Format
simg2img​Usage: simg2img <sparse_image_files> <raw_image_file>
fallocate, resize2fs, dumpe2fs, e2fsck​
(Inaction Steps, "system.img" modification)​1.) Format of File​Let’s say we want to modify system.img. (May be from any GSI )
Firstly, check the file format.
Code:
sudo file system.img
Ex.Output
system.img: Linux rev 1.0 ext2 filesystem data, UUID=6a979985-101a-4fa4-bd87-f3ff81ebaaba (extents) (large files) (huge files)
Although it shows ext2, but it’s in fact an ext4 image.
​2.) Resizing < system.img>​
All imges have been shrunk to their minimum sizes. In other words, there’s zero space left in the partition of which the image file holds. As we would like to add more files to it, we need to firstly enlarge the file to create some space, then expand the file system accordingly.
# Enlarge the file to 2G. (It can be any size)
# allocates more space for system.img 2GB
Code:
sudo fallocate -l 2G system.img
Code:
ls -lah system.img
Ex.Output
---------- 1 fortuner6898 fortuner6898 2.0G Oct 12 13:18 system.img
# Resize the filesystem
this command increases the file system size of the partion to ....xG
Try
Code:
resize2fs system.img 2G
resize2fs 1.46.5 (30-Dec-2021)
resize2fs: New size smaller than minimum (871879)
*Note not fit
TRY
Code:
sudo resize2fs system.img 3G
Ex.Output
resize2fs 1.45.5 (07-Jan-2020)
resize2fs: New size smaller than minimum (890902)
*Note not fit
FINAL TRY
Code:
resize2fs system.img 4G
resize2fs 1.46.5 (30-Dec-2021)
Resizing the filesystem on system.img to 1048576 (4k) blocks.
The filesystem on system.img is now 1048576 (4k) blocks long.
*Note this time OK
​3.) Mounting & Problems.​
create mount point directory
Code:
mkdir system
Code:
sudo mount -t ext4 -o loop system.img system
Ex.Output Error!!
Code:
mount: system: mount failed: Operation not permitted.
3.1) Problem 1. came from no loop command.​*** ERROR MUST BE FIXED​ if you used (wsl1) linux from win 10 "mount" command, changes it to wsl2.​
Resource: Windows Subsystem for Linux.
Loop devices · Issue #4980 · microsoft/WSL
Please implement loop devices. They are SO useful.
github.com
>>>Howto Fix Ubuntu loop device command---> Open Spoiler
Spoiler: For Win10 -Ubuntu Sub-system
Checking..
Ubuntu terminal
Code:
cd /dev
Code:
ls -l | grep -v tty
output
total 0
drwxr-xr-x 1 root root 4096 Oct 13 07:38 block
crw-rw-rw- 1 root root 120, 0 Oct 13 07:38 dxg
lrwxrwxrwx 1 root root 13 Oct 13 07:38 fd -> /proc/self/fd
crw-r--r-- 1 root root 1, 11 Oct 13 07:38 kmsg
crw-rw-rw- 1 root root 10, 50 Oct 13 07:38 lxss
crw-rw-rw- 1 root root 1, 3 Oct 13 07:38 null
drwxr-xr-x 1 root root 0 Oct 13 07:38 pts
crw-rw-rw- 1 root root 1, 8 Oct 13 07:38 random
lrwxrwxrwx 1 root root 8 Oct 13 07:38 shm -> /run/shm
lrwxrwxrwx 1 root root 15 Oct 13 07:38 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Oct 13 07:38 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Oct 13 07:38 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 1, 9 Oct 13 07:38 urandom
crw-rw-rw- 1 root root 1, 5 Oct 13 07:38 zero
>>> not founded loop command ( not wsl2)​​Howto update
1.open windows10 update
setting-->windows update--->Advanced option = open receive update
2. open windows system--->command promp-->Administrator mode
cmd>
Code:
wsl --update
output
Checking for updates...
No updates are available.
Kernel version: 5.10.102.1 <----wsl2
check which Ubuntu version has installed.
CMD>.
C:\Windows\System32>
Code:
wsl --list --verbose
NAME STATE VERSION
Ubuntu-20.04 Stopped 1
convert to WSL2
cmd>
Code:
wsl --set-version Ubuntu-20.04 2
output
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.
=================================
TEST LOOP with WSL2
[email protected]:/dev$ ls -l | grep -v tty
total 0
crw-r--r-- 1 root root 10, 235 Oct 14 15:49 autofs
drwxr-xr-x 2 root root 40 Oct 14 15:49 block
drwxr-xr-x 2 root root 80 Oct 14 15:49 bsg
crw------- 1 root root 10, 234 Oct 14 15:49 btrfs-control
drwxr-xr-x 3 root root 60 Oct 14 15:49 bus
crw------- 1 root root 5, 1 Oct 14 15:49 console
crw------- 1 root root 10, 62 Oct 14 15:49 cpu_dma_latency
crw------- 1 root root 10, 203 Oct 14 15:49 cuse
lrwxrwxrwx 1 root root 13 Oct 14 15:49 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Oct 14 15:49 full
crw-rw-rw- 1 root root 10, 229 Oct 14 15:49 fuse
crw-r--r-- 1 root root 1, 11 Oct 14 15:49 kmsg
crw------- 1 root root 10, 237 Oct 14 15:49 loop-control
brw------- 1 root root 7, 0 Oct 14 15:49 loop0
brw------- 1 root root 7, 1 Oct 14 15:49 loop1
brw------- 1 root root 7, 2 Oct 14 15:49 loop2
brw------- 1 root root 7, 3 Oct 14 15:49 loop3
brw------- 1 root root 7, 4 Oct 14 15:49 loop4
brw------- 1 root root 7, 5 Oct 14 15:49 loop5
brw------- 1 root root 7, 6 Oct 14 15:49 loop6
brw------- 1 root root 7, 7 Oct 14 15:49 loop7
drwxr-xr-x 2 root root 60 Oct 14 15:49 mapper
crw------- 1 root root 1, 1 Oct 14 15:49 mem
drwxr-xr-x 2 root root 60 Oct 14 15:49 net
crw-rw-rw- 1 root root 1, 3 Oct 14 15:49 null
crw------- 1 root root 10, 144 Oct 14 15:49 nvram
crw------- 1 root root 108, 0 Oct 14 15:49 ppp
crw-rw-rw- 1 root root 5, 2 Oct 14 16:56 ptmx
drwxr-xr-x 2 root root 0 Oct 14 15:49 pts
brw------- 1 root root 1, 0 Oct 14 15:49 ram0
brw------- 1 root root 1, 1 Oct 14 15:49 ram1
brw------- 1 root root 1, 10 Oct 14 15:49 ram10
brw------- 1 root root 1, 11 Oct 14 15:49 ram11
brw------- 1 root root 1, 12 Oct 14 15:49 ram12
brw------- 1 root root 1, 13 Oct 14 15:49 ram13
brw------- 1 root root 1, 14 Oct 14 15:49 ram14
brw------- 1 root root 1, 15 Oct 14 15:49 ram15
brw------- 1 root root 1, 2 Oct 14 15:49 ram2
brw------- 1 root root 1, 3 Oct 14 15:49 ram3
brw------- 1 root root 1, 4 Oct 14 15:49 ram4
brw------- 1 root root 1, 5 Oct 14 15:49 ram5
brw------- 1 root root 1, 6 Oct 14 15:49 ram6
brw------- 1 root root 1, 7 Oct 14 15:49 ram7
brw------- 1 root root 1, 8 Oct 14 15:49 ram8
brw------- 1 root root 1, 9 Oct 14 15:49 ram9
crw-rw-rw- 1 root root 1, 8 Oct 14 15:49 random
crw------- 1 root root 251, 0 Oct 14 15:49 rtc0
brw------- 1 root root 8, 0 Oct 14 15:49 sda
brw------- 1 root root 8, 16 Oct 14 15:49 sdb
crw------- 1 root root 21, 0 Oct 14 15:49 sg0
crw------- 1 root root 21, 1 Oct 14 15:49 sg1
lrwxrwxrwx 1 root root 8 Oct 14 15:49 shm -> /run/shm
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 1, 9 Oct 14 15:49 urandom
crw------- 1 root root 7, 0 Oct 14 15:49 vcs
crw------- 1 root root 7, 1 Oct 14 15:49 vcs1
crw------- 1 root root 7, 128 Oct 14 15:49 vcsa
crw------- 1 root root 7, 129 Oct 14 15:49 vcsa1
crw------- 1 root root 7, 64 Oct 14 15:49 vcsu
crw------- 1 root root 7, 65 Oct 14 15:49 vcsu1
drwxr-xr-x 2 root root 60 Oct 14 15:49 vfio
crw------- 1 root root 10, 238 Oct 14 15:49 vhost-net
crw------- 1 root root 10, 63 Oct 14 15:49 vsock
crw-rw-rw- 1 root root 1, 5 Oct 14 15:49 zero
[email protected]:/dev$
It's only for linux subsystem installed after this command is set. " wsl --set-default-version 2"​Then after run
wsl --set-default-version 2
install new Ubuntu
or
Uninstall old Ubuntu and then install new one.
if run command Not success
wsl --set-version Ubuntu-20.04 2
Exam
C:\WINDOWS\system32>wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.
​3.2.) Problem 2: came from SHARED_BLOCKS ​
It turned out that system imgage in Android 10+ is formated with EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS, found by @topjohnwu.
In other words, it’s read-only.
We can run dumpe2fs and check “Filesystem features” to confirm that the image has shared_blocks turned on.
Code:
sudo dumpe2fs system.img
Ex.Output
dumpe2fs 1.45.5 (07-Jan-2020)
dumpe2fs: Permission denied while trying to open system.img
Couldn't find valid filesystem superblock.
​## Solution:
Luckily shared_blocks is merely a restriction at the file level. We can simply run e2fsck to remove it.
Code:
sudo e2fsck -E unshare_blocks system.img
​Ex.Output
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/: ***** FILE SYSTEM WAS MODIFIED *****
/: 7953/8064 files (0.5% non-contiguous), 890901/898552 blocks
​# # Check that the shared_block feature is gone.
Code:
sudo dumpe2fs system.img
Ex.Out
Spoiler: Click to Show
dumpe2fs 1.45.5 (07-Jan-2020)
Filesystem volume name: /
Last mounted on: /
Filesystem UUID: 6a979985-101a-4fa4-bd87-f3ff81ebaaba
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: ext_attr dir_index filetype extent sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 8064
Block count: 898552
Reserved block count: 0
Overhead blocks: 576
Free blocks: 7651
Free inodes: 111
First block: 0
Block size: 4096
Fragment size: 4096
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 288
Inode blocks per group: 18
Filesystem created: Mon Oct 10 13:22:09 2022
Last mount time: n/a
Last write time: Wed Oct 12 13:36:28 2022
Mount count: 0
Maximum mount count: -1
Last checked: Wed Oct 12 13:36:28 2022
Check interval: 0 (<none>)
Lifetime writes: 3501 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Default directory hash: half_md4
Directory Hash Seed: 06b89061-20ea-4d29-bcfe-6f40b0b487d3
​Group 0: (Blocks 0-32767) csum 0xe0d5
Primary superblock at 0, Group descriptors at 1-1
Block bitmap at 2 (+2)
Inode bitmap at 3 (+3)
Inode table at 4-21 (+4)
0 free blocks, 0 free inodes, 103 directories
Free blocks:
Free inodes:
Group 1: (Blocks 32768-65535) csum 0xa982
Backup superblock at 32768, Group descriptors at 32769-32769
Block bitmap at 32770 (+2)
Inode bitmap at 32771 (+3)
Inode table at 32772-32789 (+4)
0 free blocks, 0 free inodes, 1 directories
Free blocks:
Free inodes:
Group 2: (Blocks 65536-98303) csum 0xfcd7
Block bitmap at 65536 (+0)
Inode bitmap at 65537 (+1)
Inode table at 65538-65555 (+2)
0 free blocks, 0 free inodes, 16 directories
Free blocks:
Free inodes:
Group 3: (Blocks 98304-131071) csum 0x3fe9
Backup superblock at 98304, Group descriptors at 98305-98305
Block bitmap at 98306 (+2)
Inode bitmap at 98307 (+3)
Inode table at 98308-98325 (+4)
0 free blocks, 0 free inodes, 9 directories
Free blocks:
Free inodes:
Group 4: (Blocks 131072-163839) csum 0xc769
Block bitmap at 131072 (+0)
Inode bitmap at 131073 (+1)
Inode table at 131074-131091 (+2)
0 free blocks, 0 free inodes, 9 directories
Free blocks:
Free inodes:
Group 5: (Blocks 163840-196607) csum 0xd240
Backup superblock at 163840, Group descriptors at 163841-163841
Block bitmap at 163842 (+2)
Inode bitmap at 163843 (+3)
Inode table at 163844-163861 (+4)
0 free blocks, 0 free inodes, 6 directories
Free blocks:
Free inodes:
Group 6: (Blocks 196608-229375) csum 0x5407
Block bitmap at 196608 (+0)
Inode bitmap at 196609 (+1)
Inode table at 196610-196627 (+2)
0 free blocks, 0 free inodes, 4 directories
Free blocks:
Free inodes:
Group 7: (Blocks 229376-262143) csum 0x4b24
Backup superblock at 229376, Group descriptors at 229377-229377
Block bitmap at 229378 (+2)
Inode bitmap at 229379 (+3)
Inode table at 229380-229397 (+4)
0 free blocks, 0 free inodes, 1 directories
Free blocks:
Free inodes:
Group 8: (Blocks 262144-294911) csum 0x482c
Block bitmap at 262144 (+0)
Inode bitmap at 262145 (+1)
Inode table at 262146-262163 (+2)
0 free blocks, 0 free inodes, 3 directories
Free blocks:
Free inodes:
Group 9: (Blocks 294912-327679) csum 0x9009
Backup superblock at 294912, Group descriptors at 294913-294913
Block bitmap at 294914 (+2)
Inode bitmap at 294915 (+3)
Inode table at 294916-294933 (+4)
0 free blocks, 0 free inodes, 1 directories
Free blocks:
Free inodes:
Group 10: (Blocks 327680-360447) csum 0x56cf
Block bitmap at 327680 (+0)
Inode bitmap at 327681 (+1)
Inode table at 327682-327699 (+2)
0 free blocks, 0 free inodes, 131 directories
Free blocks:
Free inodes:
Group 11: (Blocks 360448-393215) csum 0xd354
Block bitmap at 360448 (+0)
Inode bitmap at 360449 (+1)
Inode table at 360450-360467 (+2)
0 free blocks, 0 free inodes, 41 directories
Free blocks:
Free inodes:
Group 12: (Blocks 393216-425983) csum 0xcdd1
Block bitmap at 393216 (+0)
Inode bitmap at 393217 (+1)
Inode table at 393218-393235 (+2)
0 free blocks, 0 free inodes, 58 directories
Free blocks:
Free inodes:
Group 13: (Blocks 425984-458751) csum 0x68ab
Block bitmap at 425984 (+0)
Inode bitmap at 425985 (+1)
Inode table at 425986-426003 (+2)
0 free blocks, 0 free inodes, 112 directories
Free blocks:
Free inodes:
Group 14: (Blocks 458752-491519) csum 0xbd9d
Block bitmap at 458752 (+0)
Inode bitmap at 458753 (+1)
Inode table at 458754-458771 (+2)
0 free blocks, 0 free inodes, 20 directories
Free blocks:
Free inodes:
Group 15: (Blocks 491520-524287) csum 0xc1ff
Block bitmap at 491520 (+0)
Inode bitmap at 491521 (+1)
Inode table at 491522-491539 (+2)
0 free blocks, 0 free inodes, 71 directories
Free blocks:
Free inodes:
Group 16: (Blocks 524288-557055) csum 0xfc8e
Block bitmap at 524288 (+0)
Inode bitmap at 524289 (+1)
Inode table at 524290-524307 (+2)
0 free blocks, 0 free inodes, 61 directories
Free blocks:
Free inodes:
Group 17: (Blocks 557056-589823) csum 0xc2ae
Block bitmap at 557056 (+0)
Inode bitmap at 557057 (+1)
Inode table at 557058-557075 (+2)
0 free blocks, 0 free inodes, 44 directories
Free blocks:
Free inodes:
Group 18: (Blocks 589824-622591) csum 0x5ad5
Block bitmap at 589824 (+0)
Inode bitmap at 589825 (+1)
Inode table at 589826-589843 (+2)
0 free blocks, 0 free inodes, 5 directories
Free blocks:
Free inodes:
Group 19: (Blocks 622592-655359) csum 0x73e2
Block bitmap at 622592 (+0)
Inode bitmap at 622593 (+1)
Inode table at 622594-622611 (+2)
0 free blocks, 0 free inodes, 3 directories
Free blocks:
Free inodes:
Group 20: (Blocks 655360-688127) csum 0x7973
Block bitmap at 655360 (+0)
Inode bitmap at 655361 (+1)
Inode table at 655362-655379 (+2)
0 free blocks, 0 free inodes, 4 directories
Free blocks:
Free inodes:
Group 21: (Blocks 688128-720895) csum 0x5642
Block bitmap at 688128 (+0)
Inode bitmap at 688129 (+1)
Inode table at 688130-688147 (+2)
0 free blocks, 0 free inodes, 4 directories
Free blocks:
Free inodes:
Group 22: (Blocks 720896-753663) csum 0x2117
Block bitmap at 720896 (+0)
Inode bitmap at 720897 (+1)
Inode table at 720898-720915 (+2)
0 free blocks, 0 free inodes, 2 directories
Free blocks:
Free inodes:
Group 23: (Blocks 753664-786431) csum 0x0e26
Block bitmap at 753664 (+0)
Inode bitmap at 753665 (+1)
Inode table at 753666-753683 (+2)
0 free blocks, 0 free inodes, 2 directories
Free blocks:
Free inodes:
Group 24: (Blocks 786432-819199) csum 0xff3f
Block bitmap at 786432 (+0)
Inode bitmap at 786433 (+1)
Inode table at 786434-786451 (+2)
0 free blocks, 0 free inodes, 7 directories
Free blocks:
Free inodes:
Group 25: (Blocks 819200-851967) csum 0x2b16
Backup superblock at 819200, Group descriptors at 819201-819201
Block bitmap at 819202 (+2)
Inode bitmap at 819203 (+3)
Inode table at 819204-819221 (+4)
0 free blocks, 0 free inodes, 9 directories
Free blocks:
Free inodes:
Group 26: (Blocks 851968-884735) csum 0xe01c
Block bitmap at 851968 (+0)
Inode bitmap at 851969 (+1)
Inode table at 851970-851987 (+2)
0 free blocks, 0 free inodes, 70 directories
Free blocks:
Free inodes:
Group 27: (Blocks 884736-898551) csum 0x7365
Backup superblock at 884736, Group descriptors at 884737-884737
Block bitmap at 884738 (+2)
Inode bitmap at 884739 (+3)
Inode table at 884740-884757 (+4)
7651 free blocks, 111 free inodes, 7 directories, 111 unused inodes
Free blocks: 890901-898551
Free inodes: 7954-8064
​4.) Now we can mount the partition and do whatever modifications we like.
create folder mount point
Code:
mkdir system
Code:
sudo mount -t ext4 -o loop system.img system
Code:
ls system
Ex.Output
at system folder , manipulate everything from system.img with loop.
​4.1) How to modify system​in order to make changes you should use superuser:
you can use the file explorer with superuser permission by typing;
Code:
sudo nautilus
​when finished your modify task.
Code:
sudo umount system
​5.) Prepare for repacking ​
Once finished, we can start to prepare the image for repacking. The idea is simple: we firstly check and fix the errors in the file system (there’ll always be some, probably due to bugs in the previous tools), then shrink the image file back to its minimum size.
​
Code:
sudo e2fsck -yf system.img
Ex.Output
e2fsck 1.46.5 (30-Dec-2021)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/: ***** FILE SYSTEM WAS MODIFIED *****
/: 7575/7776 files (0.6% non-contiguous), 871878/880082 blocks
​# # Shrink the file system to minimum
Code:
ls -lah system.img
output
-rw-rw-r-- 1 tom tom 4.0G ต.ค. 13 14:51 system.img
​
Code:
sudo resize2fs -M system.img
output
resize2fs 1.46.5 (30-Dec-2021)
Resizing the filesystem on system.img to 871894 (4k) blocks.
The filesystem on system.img is now 871894 (4k) blocks long.
Code:
ls -lah system.img
output
-rw-rw-r-- 1 tom tom 3.4G ต.ค. 13 14:54 system.img
​6.) Prepare formular file-size of LPMAKE​
6.1) # Get the size of all images.​
Before we repack, we need to know the sizes of all images in bytes.
Code:
stat -c '%n %s' *.img
Output:
1.) Group main 4 imgs​
odm.img 4349952
product.img 1188118528
vendor.img 718503936
Sum of the group-main​
(fixed size) = 1,910,972,416 ​ + ​(variable size) = system.img size​ ( 3571277824 <------ This is variable size.)
TOTAL = 5482250240
2.) super.raw (fixed size)= 6094323712​
​6.2.) Generating new super.img​
The same as Part 1 Command.
Our last quest is to craft a lengthy lpmake command to build the new super.img. Essentially that translates to three things:
-Define the groups
-Define which partition goes into which group
-Assign image files that correspond to each partition
​Most information can be obtained from the previous imjtool.
Some of the flags to take note of are:
--metadata-slots: same as imjtool’s output
--metadata-size: The maximum size that partition metadata may consume. A partition entry uses 64 bytes and an extent entry uses 16 bytes. I think 65536 should work in most cases.
--group: format of <name>:<size>. The size should be the sum of all sub-partitions under the group
--partition: format of <name>:<attributes>:<size>[:group], attrs must be ’none’ or ‘readonly’.
--image: for each partition, specify a corresponding image file
Once done, you should now have the new super image.
​[explanation: Not copy and paste]
Prepared command "LPMAKE" Parameter.
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:ORIGINAL_SUPER_IMG_SIZE \
--group main:SUM_OF_ALL_PARTITIONS_SIZES \
--partition odm:readonly:ODM_PARTITION_SIZE:main \
--image odm=./odm.img \
--partition product:readonly: PRODUCT_PARTITION_SIZE:main \
--image product=./product.img \
--partition system:readonly:SYSTEM_PARTITION_SIZE:main \
--image system=./system.img \
--partition vendor:readonly:VENDOR_PARTITION_SIZE:main \
--image vendor=./vendor.img \
--sparse \
--output ./super_new.img
--‐-‐-------------------------
New command
Code:
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:6094323712 \
--group main:5482250240 \
--partition odm:readonly:4349952:main \
--image odm=./odm.img \
--partition product:readonly:1188118528:main \
--image product=./product.img \
--partition vendor:readonly:718503936:main \
--image vendor=./vendor.img \
--partition system:readonly:3864137728:main \
--image system=./system.img \
--sparse \
--output ./super_new.img
( continue doing along with Part1 )
...
...
...
7.) Flashing by Odin
Resource:​✓Patching Dynamic Partitions in Android Super Image​https://blog.senyuuri.info/posts/2022-04-27-patching-android-super-images/
✓Microsoft/WSL/Loop Device
Loop devices · Issue #4980 · microsoft/WSL
Please implement loop devices. They are SO useful.
github.com
✓How to install Ubuntu sub-system with WSL2 ?​
Loop devices · Issue #4980 · microsoft/WSL
Please implement loop devices. They are SO useful.
github.com
Part 1​​:Step by Step: ​Create CustomAP framework file For ​GSI Flashing with Odin.​by tom.android
Modified from @abg95a
Flash a GSI on the A7 Lite (without TWRP)​Update for add loop device in WSL2​ ( **will slow-down Win10 )​[ not recommend if you don't want to modified your system.img ]
>> Check WSL version.​Open CMD with Administrator
C:\Windows\System32>
Code:
wsl --list --verbose
NAME STATE VERSION
Ubuntu-20.04 Stopped 1
----> you are on wsl1
>>> Howto update it to WSL2 if you have installed Ubuntu ?​
C:\Windows\System32>
Code:
wsl --set-version Ubuntu-20.04 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
test after converted .
C:\Windows\System32>
Code:
wsl --list --verbose
NAME STATE VERSION
Ubuntu-20.04 Stopped 2
----> Now you are on wsl2
====End Update WSL1 with WSL2 ====​
✓ LINUX Installation​Ubuntu Subsystem 20.04.5 LTS​
OPEN microsoft store , Select Ubuntu version and click install.
After
Find Where to Stored installation Files.
here: (open windows show hidden file)
FOR WSL1
\Users\username\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04LTS_\LocalState
For WSL2 >>>you can access to home directory from windows (Windows 10 build 18342) like this :
\\wsl$
## make a shotcut to desktop (for easy copy and paste , sharing files between WIN and LINUX)
Resources: https://askubuntu.com/questions/759...t-directory-in-windows-subsystem-for-linux-an
====================================
New fresh install with WSL2 >​Ubuntu 20.04.5 LTS​>> How?​Before:
Check win10 with WSL1 or not
C:\Windows\System32>wsl --list --verbose
NAME STATE VERSION
Ubuntu-20.04 Stopped 1
----> you are on wsl1
Howto update to be "WSL2"
1.open windows10 update
setting--windows update---Advanced option = open receive update
After Download Update from Microsoft.
2. open windows system---command promp--Administrator mode
cmd> wsl --update
output
Checking for updates...
No updates are available.
Kernel version: 5.10.102.1 <----wsl2
3. RUN in CMD
Code:
wsl --set-default-version 2
Then install Ubuntu.
Test: loop device.
Open Ubnutu terminal
Code:
cd /dev
Code:
ls -l | grep -v tty
Spoiler: OUTPUT
[email protected]:~$ cd /dev
[email protected]:/dev$ ls -l | grep -v tty
total 0
crw-r--r-- 1 root root 10, 235 Oct 14 15:49 autofs
drwxr-xr-x 2 root root 40 Oct 14 15:49 block
drwxr-xr-x 2 root root 80 Oct 14 15:49 bsg
crw------- 1 root root 10, 234 Oct 14 15:49 btrfs-control
drwxr-xr-x 3 root root 60 Oct 14 15:49 bus
crw------- 1 root root 5, 1 Oct 14 15:49 console
crw------- 1 root root 10, 62 Oct 14 15:49 cpu_dma_latency
crw------- 1 root root 10, 203 Oct 14 15:49 cuse
lrwxrwxrwx 1 root root 13 Oct 14 15:49 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Oct 14 15:49 full
crw-rw-rw- 1 root root 10, 229 Oct 14 15:49 fuse
crw-r--r-- 1 root root 1, 11 Oct 14 15:49 kmsg
crw------- 1 root root 10, 237 Oct 14 15:49 loop-control
brw------- 1 root root 7, 0 Oct 14 15:49 loop0
brw------- 1 root root 7, 1 Oct 14 15:49 loop1
brw------- 1 root root 7, 2 Oct 14 15:49 loop2
brw------- 1 root root 7, 3 Oct 14 15:49 loop3
brw------- 1 root root 7, 4 Oct 14 15:49 loop4
brw------- 1 root root 7, 5 Oct 14 15:49 loop5
brw------- 1 root root 7, 6 Oct 14 15:49 loop6
brw------- 1 root root 7, 7 Oct 14 15:49 loop7
drwxr-xr-x 2 root root 60 Oct 14 15:49 mapper
crw------- 1 root root 1, 1 Oct 14 15:49 mem
drwxr-xr-x 2 root root 60 Oct 14 15:49 net
crw-rw-rw- 1 root root 1, 3 Oct 14 15:49 null
crw------- 1 root root 10, 144 Oct 14 15:49 nvram
crw------- 1 root root 108, 0 Oct 14 15:49 ppp
crw-rw-rw- 1 root root 5, 2 Oct 14 16:56 ptmx
drwxr-xr-x 2 root root 0 Oct 14 15:49 pts
brw------- 1 root root 1, 0 Oct 14 15:49 ram0
brw------- 1 root root 1, 1 Oct 14 15:49 ram1
brw------- 1 root root 1, 10 Oct 14 15:49 ram10
brw------- 1 root root 1, 11 Oct 14 15:49 ram11
brw------- 1 root root 1, 12 Oct 14 15:49 ram12
brw------- 1 root root 1, 13 Oct 14 15:49 ram13
brw------- 1 root root 1, 14 Oct 14 15:49 ram14
brw------- 1 root root 1, 15 Oct 14 15:49 ram15
brw------- 1 root root 1, 2 Oct 14 15:49 ram2
brw------- 1 root root 1, 3 Oct 14 15:49 ram3
brw------- 1 root root 1, 4 Oct 14 15:49 ram4
brw------- 1 root root 1, 5 Oct 14 15:49 ram5
brw------- 1 root root 1, 6 Oct 14 15:49 ram6
brw------- 1 root root 1, 7 Oct 14 15:49 ram7
brw------- 1 root root 1, 8 Oct 14 15:49 ram8
brw------- 1 root root 1, 9 Oct 14 15:49 ram9
crw-rw-rw- 1 root root 1, 8 Oct 14 15:49 random
crw------- 1 root root 251, 0 Oct 14 15:49 rtc0
brw------- 1 root root 8, 0 Oct 14 15:49 sda
brw------- 1 root root 8, 16 Oct 14 15:49 sdb
crw------- 1 root root 21, 0 Oct 14 15:49 sg0
crw------- 1 root root 21, 1 Oct 14 15:49 sg1
lrwxrwxrwx 1 root root 8 Oct 14 15:49 shm -> /run/shm
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 1, 9 Oct 14 15:49 urandom
crw------- 1 root root 7, 0 Oct 14 15:49 vcs
crw------- 1 root root 7, 1 Oct 14 15:49 vcs1
crw------- 1 root root 7, 128 Oct 14 15:49 vcsa
crw------- 1 root root 7, 129 Oct 14 15:49 vcsa1
crw------- 1 root root 7, 64 Oct 14 15:49 vcsu
crw------- 1 root root 7, 65 Oct 14 15:49 vcsu1
drwxr-xr-x 2 root root 60 Oct 14 15:49 vfio
crw------- 1 root root 10, 238 Oct 14 15:49 vhost-net
crw------- 1 root root 10, 63 Oct 14 15:49 vsock
crw-rw-rw- 1 root root 1, 5 Oct 14 15:49 zero
[email protected]:/dev$
(you will saw loop command.)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>​
GET START​>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>​✓ Get " super.img" from inside Stock AP File​by Extract (super.img.lz4) file by Windows or Linux.​For Windows​Download lz4 for win and extract into C:\AnyName
from https://github.com/lz4/lz4/releases
1) extract "super.img.lz4" from Stock AP Firmware file with 7zip, into lz4 folder.<AnyName>
2) go into folder lz4_win64_v1_9_4 and run CMD
Spoiler: pic
Code:
lz4 -d super.img.lz4 super.img
copy output " super.img" to uses with Ubuntu at /home/username/
>>>>>>>>>>>>≥>>>>>>>>>>>>>>>>>>>>>>
For Linux:​✓ launch Ubuntu terminal( console) from Start menu
2.1) Option We can uses LZ4 from linux, process same as (Step 1-2 for wins)
Ubuntu
you can install LZ4 from Ubuntu Console with
Code:
sudo apt update
sudo apt-get -y install lz4
or
sudo apt install liblz4-tool
note
lz4 [option] input output
lz4 -d (d= decompress)
lz4 -dc ( c=concatenate )
2.2) Option Extract "super.img.lz4" from Stock AP framework file.
and paste it to /home/username/
2.3)
Code:
sudo lz4 -d super.img.lz4 super.img
Spoiler: pic
2.4)COMPARE with using "lz4" between Ubuntu and Windows
​CONCLUSION of Beginning step.​WE CAN GETS " SUPER.IMG" FROM TWO WAYS , WINDOWS OR LINUX.
( windows from step 1-2 ) or. ( Linux from step 2.1 -2.3)
***We will use 'super.img' to begin our modification.​​✓ unpacking super.img​3.) Turn sparse format To RAW​Ubuntu
**First of all the super.img file might be in sparse format so we need to make it raw image. By Using "SIMG2IMG"
Code:
sudo apt-get update
sudo apt-get install simg2img
Spoiler: Backward
I'm
ok
Code:
sudo apt-get install img2simg
After install execute this command.
Code:
sudo simg2img super.img super.raw
Spoiler: pic
✓Extract subpartition out from "SUPER.RAW"​4) Tool for extract partition. ( very important tool for show "group schema" which used to specific parameter option for lpmake.)
4.1) Download imjtool
http://newandroidbook.com/tools/imjtool.tgz
or download from attach file belows this tutorial (imjtool.zip)
4.2) extract "imjtool" from archive imjtool.tgz to /home/username/
*note for short i renamed it to 'imjtool'
4.3) then give it permission with command
Code:
chmod +x imjtool
5) Extract sub partition within our "SUPER.RAW"
By execute this command
Code:
./imjtool super.raw extract
It will extract sub-partitions (4 img files ) in the folder "/home/user/extracted"
- system.img
- vendor.img
- product.img
- odm.img
Spoiler: show group schema
✓ Modify Stock "system.img" by Changes with GSI-"system.img"​6) Choose your favorite GSI. ( Recommend PHH Treble- GSI )
Download from :-
https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
6.1) Extract Downloaded archive & Replace "system.img" with your GSI img
(rename it to system.img over-written the old file.)
Spoiler: change stock system.img with GSI system.img
6.2 )
Move all img files (6.1)
from /home/username/extracted folder into /home/username/
7.) Get each partitions file size.
we can do it by:
Code:
stat -c '%n %s' IMG_FILE.img
:- do it for all partitions files.
7.1
Code:
stat -c '%n %s' system.img
Exam output---system.img 308 951 4496
7.2
Code:
stat -c '%n %s' vendor.img
Exam ouputt----vendor.img 718 503 936
7.3
Code:
stat -c '%n %s' product.img
Exam output----product.img 118 811 8528
7.4
Code:
stat -c '%n %s' odm.img
Exam output----odm.img 434 9952
7.5 ***size of the "original super.raw"
Code:
stat -c '%n %s' super.raw
Exam output----super.raw 609 432 3712
Spoiler: pic
✓ Repacked modified sub-partition back​8) Repacked new super.img.
8.1 fill in "img partition size" formular (parameter) to your prepared command below
explanation:
Spoiler: Calculate Sum of all partition size 4
explanation:
Prepared command "LPMAKE" parameter
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:ORIGINAL_SUPER_IMG_SIZE \
--group main:SUM_OF_ALL_PARTITIONS_SIZES \
--partition odm:readonly:ODM_PARTITION_SIZE:main \
--image odm=./odm.img \
--partition product:readonlyRODUCT_PARTITION_SIZE:main \
--image product=./product.img \
--partition system:readonly:SYSTEM_PARTITION_SIZE:main \
--image system=./system.img \
--partition vendor:readonly:VENDOR_PARTITION_SIZE:main \
--image vendor=./vendor.img \
--sparse \
--output ./super_new.img
Note:
Replace
ORIGINAL_SUPER_IMG_SIZE,
SUM_OF_ALL_PARTITIONS_SIZES
ODM_PARTITION_SIZE,
PRODUCT_PARTITION_SIZE,
SYSTEM_PARTITION_SIZE,
VENDOR_PARTITION_SIZE
with the values you obtained in step 7.
====================
8.2
Download & extract : OTATOOLS to /home/username/
here:
Google Drive - Virus scan warning
drive.google.com
**We only want to use "lpmake" from its.
*** If you have a problem when used command " sudo ./otatools/bin/lpmake --metadata-size 65536 \ bra bra bra
Error message: Command not found.
Do this...
Code:
chmod +x otatools/bin/lpmake
or
Code:
chmod -R +x otatools
> exit terminal and Login Back again
Spoiler: pic
8.3) execute prepared formular (8.1) with this command
Note: Numeric are my Example only.
1. Fix partition size ( odm + product + vendor )
434 9952 + 118 811 8528 + 718 503 936 = 1,910,972,416 + (new system.img )= Sum of all 4 partition.
2. Fix All partition ( super.raw) = 609 432 3712
***DO NOT COPY!!***
explanation:
Code:
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:6094323712 \
--group main:5000486912\
--partition odm:readonly:4349952:main \
--image odm=./odm.img \
--partition product:readonly:1188118528:main \
--image product=./product.img \
--partition system:readonly:3864137728:main \
--image system=./system.img \
--partition vendor:readonly:718503936:main \
--image vendor=./vendor.img \
--sparse \
--output ./super_new.img
Spoiler: OUTPUT
OUTPUT SHOW:-
lpmake I 09-11 03:32:54 36 36 builder.cpp:1012] [liblp]Partition odm will resize from 0 bytes to 4349952 bytes
lpmake I 09-11 03:32:54 36 36 builder.cpp:1012] [liblp]Partition product will resize from 0 bytes to 1188118528 bytes
lpmake I 09-11 03:32:54 36 36 builder.cpp:1012] [liblp]Partition system will resize from 0 bytes to 3864137728 bytes
lpmake I 09-11 03:32:54 36 36 builder.cpp:1012] [liblp]Partition vendor will resize from 0 bytes to 718503936 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
**lpmake expand partition success. Resize from 0 bytes to 9999999 bytes
**ignored Invalid sparse file format at header magic
✓Compress repacked modified new super.img​
9) Compress the repacked super_new.img
Code:
lz4 -B6 --content-size super_new.img super_new.img.lz4
10). Compress the clean vmbeta.img
Download Clean vbmeta.img from Google
https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
Code:
lz4 -B6 --content-size vbmeta.img vbmeta.img.lz4
Win10
(From Attachment download.)
11). Down& Extract "tar-md5-script-tool.zip" to C;\
11.1 extract all *.img.lz4 files (from AP Stock) to. C:/ tar-md5-script-tool folder
12) Replace
super.img.lz4 and
vbmeta.img.lz4
|
in tar-md5-script-tool dir
|
with your repacked and compressed
super_new.img.lz4 (rename it to super.img.lz4)--->output from step 9
and the clean compressed
vbmeta.img.lz4. ------> output from step 10
Spoiler: pic
13) Run Win Batch File For Packing Custom AP file (tar.md5) for Odin
Run batch.bat in tar-md5-script-tool folder
[You will find the " AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5"
in the temp-folder subdir]
***Don't Rename​
14) Final Flashing with ODin
...14.1) Device must installed Stock Firmware. (No root)
* No bad critical conditions happened when you are on STOCK ROM.
... 14.2) OEM Unlock [Developer options] must gray out but
. enable on position.
... 14.3) KG State Must be "Checking state" status.
( if kg state = Broken ) = you must have goto flash Pure stock firmware
again and this time uses ONLY "CSC" factory reset
. *NO used Home_CSC
After finished odin fashing must connected internet, check "kg status"
again )
...14.4) Flashing all files at once, don't ignored any slot.( AP+BL+CP+CSC)
except USERDATA
(Odin will shrink non-slot data size automatically)
...14.5) After Device reboot
(1st) show android robot - remove old system
(2nd) Due to new vbmeta.img has changed from stock , tab will reboot to
Recovery menu , you must select its factory reset menu manually.
...14.6) Click Magisk icon app to update
" Upgrade to full Magisk to finish the setup. Download and install"OK
- Magisk app will not reboot but update itself. But if you open app
again it will asked to reboot for addition upgrade.
>AP SLOT : AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
>BL Slot : BL Stock.md5
>CP SLOT: CP Stock.md5
>CSC Slot: CSC Stock.md5 ------> (Don't uses HOME_CSC)
>USERDATA Slot: magisk_boot_vbmeta_patch.tar
✓ How to create Magisk patch for boot.img + vbmeta.img
extract (vbmeta.img.lz4 + boot.img.lz4) from your AP Stock
create compress one file xxx .tar with 7zip
move (vbmeta.img.lz4 + boot.img.lz4).tar (xxx.tar) to tab a7 lite
install magisk.apk on you tab a7 lite
patch the tar file. (with magisk manager)
result magisk-patch file at Tab a7 :-Download folder.
Recommend: Default R/W GSI " by Nazim"​My Examples
https://forum.xda-developers.com/t/...-lite-gsi-installation.4503647/#post-87550627
If you can't booted "VNDK Lite" variant but want to uses mount Read/Write .
Part3 -Create CustomAP Tutorial.
[Close].Advanced-CustomAP
》Step by Step Tutorial for changes mount Read Only To Read/Write.《 Example in tutorial: (install PixelExperience_Plus Android 13 , Can install on A12 but not works) Slim has no Recorder (voice), Pixel Wallpapers, Pixel Live Wallpapers, Drive...
forum.xda-developers.com
Draft​Part 4​CustomAP For Mobile​From A/B Partition TO AB Partition Device​For Low spec Computer.
1. Must install 2 Ubuntu subsystem , one with WSL1 , the other with WSL2
2. Edit Sub-partition used WSL2 Ubuntu and exit terminal then copy output file to WSL1 Another Ubuntu >> finish making CustomAP with its.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>​what this group schema have told you?​>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Begin​
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
USE " IMJTOOL" with A/B partition device.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Code:
./imjtool super.raw extract
MMapped: 0x7fa605fa0000, imgMeta 0x7fa605fa1000
liblp dynamic partition (super.img) - Blocksize 0x1000, 2 slots
LP MD Header @0x3000, version 10.0, with 4 logical partitions on block device of 5812 GB, at partition super, first sector: 0x800
Partitions @0x3080 in 2 groups:
Group 0: default
Group 1: main
Name: system (read-only, Linux Ext2/3/4/? Filesystem Image, @0x100000 spanning 1 extents of 3 GB) - extracted
Name: product (read-only, Linux Ext2/3/4/? Filesystem Image, @0xe6700000 spanning 1 extents of 1 GB) - extracted
Name: vendor (read-only, Linux Ext2/3/4/? Filesystem Image, @0x12d500000 spanning 1 extents of 685 MB) - extracted
Name: odm (read-only, Linux Ext2/3/4/? Filesystem Image, @0x158300000 spanning 1 extents of 4 MB) - extracted
>>>>>>>>>>>
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:6094323712 \
--group main:5535145984\
--partition odm:readonly:4349952:main \
--image odm=./odm.img \
--partition system:readonly:3624173568:main \
--image system=./system.img \
--partition vendor:readonly:718503936:main \
--image vendor=./vendor.img \
--partition product:readonly:1188118528:main \
--image product=./product.img \
--sparse \
--output ./super_new.img
>>>>>>>>>>
Code:
stat -c '%n %s' *.img
Code:
stat -c '%n %s' *.raw
odm.img 4349952
product.img 1188118528
vendor.img 718503936
super.raw 6094323712
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CustomAP​For Samsung Mobile​>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>​ USE " LPUNPACK" with AB partition device.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Code:
./imjtool.ELF64 super.img extract
liblp dynamic partition (super.img) - Blocksize 0x1000, 3 slots
LP MD Header @0x3000, version 10.2, with 14 logical partitions on block device of 3584 GB, at partition super, first sector: 0x800
Partitions @0x3100 in 5 groups:
Group 0: default
Group 1: google_system_dynamic_partitions_a
Name: product_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x100000 spanning 1 extents and 290 MB) - extracted
Name: system_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x12400000 spanning 1 extents and 943 MB) - extracted
Name: system_ext_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x4ec00000 spanning 1 extents and 513 MB) - extracted
Group 2: google_system_dynamic_partitions_b
Name: product_b (read-only, empty) - extracted
Name: system_b (read-only, Linux Ext2/3/4/? Filesystem Image, @0x4d400000 spanning 1 extents and 23 MB) - extracted
Name: system_ext_b (read-only, empty) - extracted
Group 3: google_vendor_dynamic_partitions_a
Name: odm_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x6ee00000 spanning 1 extents and 772 KB) - extracted
Name: vendor_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x6ef00000 spanning 1 extents and 310 MB) - extracted
Name: vendor_dlkm_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x82600000 spanning 1 extents and 340 KB) - extracted
Name: odm_dlkm_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x82700000 spanning 1 extents and 340 KB) - extracted
Group 4: google_vendor_dynamic_partitions_b
Name: odm_b (read-only, empty) - extracted
Name: vendor_b (read-only, empty) - extracted
>>>>>>>>>>
# Get the size of all images
Code:
stat -c '%n %s' *.img
odm_a.img 790528
odm_b.img 0
odm_dlkm_a.img 348160
odm_dlkm_b.img 0
product_a.img 304930816
product_b.img 0
super.img 7516192768
system_a.img 1018732544
system_b.img 24203264
system_ext_a.img 537972736
system_ext_b.img 0
vendor_a.img 325787648
vendor_b.img 0
vendor_dlkm_a.img 348160
vendor_dlkm_b.img 0
>>>>>>>>>>
Code:
./bin/lpmake --metadata-size 65536\
--device-size=4294967296\
--metadata-slots=3\
--group=google_system_dynamic_partitions_a:2222931968\
--partition=odm_a:none:700416:google_system_dynamic_partitions_a\
--partition=product_a:none:266579968:google_system_dynamic_partitions_a\
--partition=system_a:none:1363767296:google_system_dynamic_partitions_a\
--partition=system_ext_a:none:359391232:google_system_dynamic_partitions_a\
--partition=vendor_a:none:232493056:google_system_dynamic_partitions_a\
--image=odm_a=./odm_a.img\
--image=product_a=./product_a.img\
--image=system_a=./system_a.img\
--image=system_ext_a=./system_ext_a.img\
--image=vendor_a=./vendor_a.img\
--group=google_system_dynamic_partitions_b:24563712\
--partition=odm_b:none:0:google_system_dynamic_partitions_b\
--partition=product_b:none:0:google_system_dynamic_partitions_b\
--partition=system_b:none:24563712:google_system_dynamic_partitions_b\
--partition=system_ext_b:none:0:google_system_dynamic_partitions_b\
--partition=vendor_b:none:0:google_system_dynamic_partitions_b\
--image=odm_b=./odm_b.img\
--image=product_b=./product_b.img\
--image=system_b=./system_b.img\
--image=system_ext_b=./system_ext_b.img\
--image=vendor_b=./vendor_b.img\
--sparse \
--output ./super.new.img
>>>>>>>>>>>>
Most information can be obtained from the previous imjtool. Some of the flags to take note of are:
--metadata-slots: same as imjtool’s output
--device-size: for most phones, 4GB should be enough (4*1024^3 = 4294967296 bytes). It’s okay to leave some extras
--group: format of <name>:<size>. The size should be the sum of all sub-partitions under the group
--partition: format of <name>:<attributes>:<size>[:group], attrs must be ’none’ or ‘readonly’.
--image: for each partition, specify a corresponding image file
Code:
stat -c '%n %s' *.img
odm_a.img 790528
odm_b.img 0
odm_dlkm_a.img 348160
odm_dlkm_b.img 0
product_a.img 304930816
product_b.img 0
super.img 7516192768
system_a.img 1018732544
system_b.img 24203264
system_ext_a.img 537972736
system_ext_b.img 0
vendor_a.img 325787648
vendor_b.img 0
vendor_dlkm_a.img 348160
vendor_dlkm_b.img 0
Code:
./bin/lpmake --metadata-size 65536\
--device-size=4294967296\
--metadata-slots=3\
--group=google_system_dynamic_partitions_a:2222931968\
--partition=odm_a:none:700416:google_system_dynamic_partitions_a\
--partition=product_a:none:266579968:google_system_dynamic_partitions_a\
--partition=system_a:none:1363767296:google_system_dynamic_partitions_a\
--partition=system_ext_a:none:359391232:google_system_dynamic_partitions_a\
--partition=vendor_a:none:232493056:google_system_dynamic_partitions_a\
--image=odm_a=./odm_a.img\
--image=product_a=./product_a.img\
--image=system_a=./system_a.img\
--image=system_ext_a=./system_ext_a.img\
--image=vendor_a=./vendor_a.img\
--group=google_system_dynamic_partitions_b:24563712\
--partition=odm_b:none:0:google_system_dynamic_partitions_b\
--partition=product_b:none:0:google_system_dynamic_partitions_b\
--partition=system_b:none:24563712:google_system_dynamic_partitions_b\
--partition=system_ext_b:none:0:google_system_dynamic_partitions_b\
--partition=vendor_b:none:0:google_system_dynamic_partitions_b\
--image=odm_b=./odm_b.img\
--image=product_b=./product_b.img\
--image=system_b=./system_b.img\
--image=system_ext_b=./system_ext_b.img\
--image=vendor_b=./vendor_b.img\
--sparse \
--output ./super.new.img
Part 3
Advanced CustomAP
Step by Step for changes mount Read Only To Read/Write.
*** the continue part of Step by Step CREATE CustomAP framework file for GSI Flashing with Odin.
​1.) Back to Stock Firmware.
It's still a good idea to flash stock firmware every now and then, because critical system components get updated and fixed, like the bootloader etc.
2.) If you used Stock A12, creates CustomAP (target GSI) and flash with Odin (include patched-Magisk of boot.img.lz4 and vbmeta.img.lz4)
BL slot: Stock BL
AP slot: CustomAP
CP slot: Stock CP
CSC Slot: Stock CSC
UserData slot: boot+vbmeta patched by Magisk.tar
After 1'st boot( Finished Flashing)
2.1 setup magisk v.24.3
(download additional some part) if not you can't uses magisk. And Reboot.
3.) If you used Stock A11
3.1 Stock A11 + TWRP
Flash GSI with TWRP' S Fastboot (with root)
* Your Computer must installed " Bootloader Driver " before. If not you
can't uses "Fastboot command"
Code:
Set of fastboot command.
adb reboot fastboot
>>>tab will auto reboot to "TWRP fastoot mode" (ignored black screen)
fastboot devices
>>>Output screen will show your tab S/n
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot erase system
fastboot flash system yourGSI.img
>>> ignored invalid spare 'system'...at header magic
>>> divided PE system image file into parts suitable for write to dynamic tab
>>> system partition.
fastboot -w
>>>This will also erase your internal storage.
fastboot reboot recovery
>>>>>>Booting to TWRP
from TWRP menu
wipe --->format data --->yes
reboot fastboot
fastboot flash boot boot.img
>>> boot.img was patched by magisk
fastboot reboot
3.2 Stock A11 + non TWRP 》 Back to (2)
4.) NOW Your tablet was running by GSI firmware.
4.1 Computer
download platform-tools and extract to C:\
4.2 Tablet
install Root File Manager. (Such as MiXplorer)
4.3 Connect your tablet with Computer
4.4 Use root file manager copy "systemrw_1.32" folder
from downloaded Archive to "/data/local/tmp"
4.5 Open CMD as Administrator and Run in folder
" C:/platform-tools"
Code:
adb shell
su
* check magisk supersu permission--given to Shell program or not
cd /data/local/tmp/systemrw_1.32
chmod +x ./systemrw.sh
./systemrw.sh size=15
[LIST]
[*]size=x *ONLY RECOMMENDED IF YOU'VE GOT SUPER PARTITION*
With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. There is a limit as to how much extra free space you can add per partition. Check your lpdump.txt to find out the exact maximum extra size.
If omitted, default extra size is 0 (shrink to minimum)
[/LIST]
or for fix no
or
./systemrw.sh out=/mnt/media_rw/8644-7453/patch/super_fixed.bin size=200
**changes 8644-7453 with your
Output: Fail but got system.img
Spoiler: Output
Code:
Read only
--------------------------------------------------
| SystemRW v1.32 automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------
systemrw: Custom output detected: /mnt/media_rw/8644-7453/patch/super_fixed.bin
systemrw: Custom size detected: 15 MB
systemrw: Initiating procedure...
systemrw: Device is in Android mode. Ignoring
systemrw: Current device: samsung
systemrw: Current Android version: 14
systemrw: Current SELinux status: Enforcing
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/mmcblk0p45
systemrw: / is read-only
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled.
verity is already disabled.
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...
11902976+0 records in
11902976+0 records out
6094323712 bytes (5.6 G) copied, 132.285471 s, 44 M/s
systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Nested partitions were successfully extracted from super
systemrw: Current size of system.img in bytes: 3090964480
systemrw: Current size of system.img in MB: 2947
systemrw: Current size of system.img in 512-byte sectors: 6037040
systemrw: 'shared_blocks feature' detected @ system.img
systemrw: Increasing filesystem size of system.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 943287 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 943287 (4k) blocks long.
systemrw: Removing 'shared_blocks feature' of system.img...
e2fsck 1.46.2 (28-Feb-2021)
systemrw: Read-only lock of system.img successfully removed
systemrw: Shrinking size of system.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 887293 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 887293 (4k) blocks long.
systemrw: Custom size of system.img in bytes: 3650080768
systemrw: Custom size of system.img in MB: 3480
systemrw: Custom size of system.img in 512-byte sectors: 7129064
systemrw: Increasing filesystem size of system.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 891133 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 891133 (4k) blocks long.
=================================================
systemrw: Current size of vendor.img in bytes: 641204224
systemrw: Current size of vendor.img in MB: 611
systemrw: Current size of vendor.img in 512-byte sectors: 1252352
systemrw: NO 'shared_blocks feature' detected @ vendor.img
systemrw: Shrinking size of vendor.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 151299 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 151299 (4k) blocks long.
systemrw: Custom size of vendor.img in bytes: 635449344
systemrw: Custom size of vendor.img in MB: 606
systemrw: Custom size of vendor.img in 512-byte sectors: 1241112
systemrw: Increasing filesystem size of vendor.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 155139 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 155139 (4k) blocks long.
=================================================
systemrw: Current size of product.img in bytes: 1091608576
systemrw: Current size of product.img in MB: 1041
systemrw: Current size of product.img in 512-byte sectors: 2132048
systemrw: NO 'shared_blocks feature' detected @ product.img
systemrw: Shrinking size of product.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product.img to 262240 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product.img is now 262240 (4k) blocks long.
=================================================
systemrw: Joining all extracted images back into one single super image...
systemrw: Please wait and ignore the invalid sparse warnings...
Not enough space on device for partition product with size 1089863680
systemrw: Error! failed to create super_fixed.img file. Error code: 70
gta7lite:/data/local/tmp/systemrw_1.32 #
ignored " Error! failed to create super_fixed.img file. Error code: 70"
4.6 Final copy "/data/local/tmp/systemrw_1.32/img/system.img"
for making new CustomAP Or Flashing with Fastboot.
Note:​Note:1. if you want to fix not enough space Solved with changing size from 15 to 200
But I want only "new system.img" which removed shared_blocks.
Note:2. Examples.
[Close].Advanced-CustomAP
》Step by Step Tutorial for changes mount Read Only To Read/Write.《 Example in tutorial: (install PixelExperience_Plus Android 13 , Can install on A12 but not works) Slim has no Recorder (voice), Pixel Wallpapers, Pixel Live Wallpapers, Drive...
forum.xda-developers.com
Note:3 Fix: Not enough space on device for partition. xxxxx
C:\platform-tools>adb shell
gta7lite:/ $ su
gta7lite:/ # cd /data/local/tmp/systemrw_1.32
gta7lite:/data/local/tmp/systemrw_1.32 # chmod +x ./systemrw.sh
gta7lite:/data/local/tmp/systemrw_1.32 # ./systemrw.sh size=200
Spoiler: Output
--------------------------------------------------
| SystemRW v1.32 automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------
systemrw: Custom size detected: 200 MB
systemrw: Initiating procedure...
systemrw: Device is in Android mode. Ignoring
systemrw: Current device: samsung
systemrw: Current Android version: 14
systemrw: Current SELinux status: Enforcing
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/mmcblk0p45
systemrw: / is already R/W capable. Ignoring
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled.
Successfully disabled verity. Reboot the device for changes to take effect.
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...
11902976+0 records in
11902976+0 records out
6094323712 bytes (5.6 G) copied, 129.945285 s, 45 M/s
systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Nested partitions were successfully extracted from super
systemrw: Current size of system.img in bytes: 2926604288
systemrw: Current size of system.img in MB: 2791
systemrw: Current size of system.img in 512-byte sectors: 5716024
systemrw: NO 'shared_blocks feature' detected @ system.img
systemrw: Shrinking size of system.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 714445 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 714445 (4k) blocks long.
systemrw: Custom size of system.img in bytes: 3136081920
systemrw: Custom size of system.img in MB: 2990
systemrw: Custom size of system.img in 512-byte sectors: 6125160
systemrw: Increasing filesystem size of system.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 765645 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 765645 (4k) blocks long.
=================================================
systemrw: Current size of vendor.img in bytes: 641204224
systemrw: Current size of vendor.img in MB: 611
systemrw: Current size of vendor.img in 512-byte sectors: 1252352
systemrw: NO 'shared_blocks feature' detected @ vendor.img
systemrw: Shrinking size of vendor.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 151307 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 151307 (4k) blocks long.
systemrw: Custom size of vendor.img in bytes: 829468672
systemrw: Custom size of vendor.img in MB: 791
systemrw: Custom size of vendor.img in 512-byte sectors: 1620056
systemrw: Increasing filesystem size of vendor.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 202507 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 202507 (4k) blocks long.
=================================================
systemrw: Current size of product.img in bytes: 1091608576
systemrw: Current size of product.img in MB: 1041
systemrw: Current size of product.img in 512-byte sectors: 2132048
systemrw: NO 'shared_blocks feature' detected @ product.img
systemrw: Shrinking size of product.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product.img to 262240 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product.img is now 262240 (4k) blocks long.
systemrw: Custom size of product.img in bytes: 1283850240
systemrw: Custom size of product.img in MB: 1224
systemrw: Custom size of product.img in 512-byte sectors: 2507520
systemrw: Increasing filesystem size of product.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product.img to 313440 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product.img is now 313440 (4k) blocks long.
=================================================
systemrw: Joining all extracted images back into one single super image...
systemrw: Please wait and ignore the invalid sparse warnings...
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
systemrw: Successfully created patched super image @
systemrw: /data/local/tmp/systemrw_1.32/img/super_fixed.bin
systemrw: Congratulations! Your image(s) should now have R/W capability
systemrw: Please reboot into bootloader and flash the file(s) manually
gta7lite:/data/local/tmp/systemrw_1.32 #
✓ Final we got "/data/local/tmp/systemrw_1.32/img/super_fixed.bin and super_original.bin
✓ Change super_fixed.bin to super_new.img
> fastboot flash super super_new.img ( new r/w GSI overwritten read only)
CustomAP
9) Compress the repacked super_new.img
Code:
lz4 -B6 --content-size super_new.img super_new.img.lz4
Then. Read Part1 tutorial.
If you want only system.img
> sudo simg2img super_new.img super.raw
> ./imjtool super.raw extract
Resources:​
1. https://forum.xda-developers.com/t/...-superrw-featuring-makerw-read-write.4247311/
2.
TWRP FOR Android 11 Device SM-T22x​No touch supported.
Used only (TWRP 's Fastboot)Mode.
​
Spoiler: Detail
》》FIRST TIME INSTALLATION
Howto install TWRP For SM-T22x
# Patch Samsung AP Firmware via Magisk v24.0 ( patched entire AP file)
1. Install Magisk.apk on your device SM-T22x with select no update checking, and transferred AP_xxx.tar.md5 from computer to your tab.
2. Patch Samsung AP Firmware via Magisk Manager.
( Once done, the newly created magisk_patched.tar file will be present under the
Downloads folder on your device.)
3. you may now transfer this patched TAR file to the folder on your PC where other extracted firmware files (AP, BL, CP, CSC, and HOME_CSC) are present.
4. FLASH it with ODin as usual by used magisk_patched.tar file at AP slot .
5. REBOOT SYSTEM Quick SETUP < NO NEED INTERNET>
6. Power Off and press Volum up +Volumn down + USB for boot into Download mode
7. FLASH TWRP.tar from https://github.com/DevZillion/android_device_samsung_gta7lite/releases at "AP slot"
But this time set Odin option NO Auto- REBOOT, yes do it yourself with key press ( power + volumn up).
## if you can't use keypress but reboot to the system , you can use cmd " adb reboot recovery "
When had access to twrp menu
Go to Advanced > Terminal and type "multidisabler" (without quotes", then data wipe.
Now reboot into system, after completing first setup of the device reboot into TWRP again to see if you can see the contents of your Internal Storage, you should, if yes you have successfully disabled Samsung encryption of internal storage.
NOTE: If you wish to install TWRP without rooting, there are numerous pitfalls to consider. For example, a stock device is protected by Android Verified Boot. This is implemented as a vbmeta partition that contains cryptographic digests for verifying the integrity of boot.img, recovery.img and other partitions/images. Flashing TWRP without first flashing a vbmeta image with verity disabled will render your device unable to boot.
Note:4
very important bootloader driver for fastboot of the twrp.
Android Bootloader Interface Drivers are needed for your PC to identify the device connected in Fastboot Mode and hence execute the desired Fastboot Commands.
Automatic MediaTek USB VCOM Drivers: MTK_Driver_Auto_Installer_EXE_v5.1632.00
Download:
https://androidfilehost.com/?fid=14943124697586345377
If not works.
How to Install Fastboot Drivers in Windows 11
In this comprehensive tutorial, we will show you the detailed steps to install the Fastboot Drivers onto your Windows 11 PC
www.droidwin.com
Download: https://androidfilehost.com/?fid=7161016148664850715
tom.android said:
Reserved3. RCCOMMEND NEW GSI
Miku UI Snowland 0.70 PHH GSI v415 AOSP-base , For Gamer.
Support exFat , Hotspot , Bluetooth, Nearby share
Download :https://github.com/xiaoleGun/treble_build_miku/releases
Click to expand...
Click to collapse
It's hard to play games at night without rom livedisplay
you should try this :https://pan.xiaolegun.cn/GSI/Phh-Treble/exTHmUI/Android-12-Dev
Xxxx
tom.android said:
View attachment 5669853
Click to expand...
Click to collapse
But it's still a good gaming rom
Xxxx
tom.android said:
Screen flashing. Can't used anymore.
Same as v415 new version here. But all bug fixed.
View attachment 5669951
Click to expand...
Click to collapse
Thanks for letting me know that rom doesn't work
Ok in the end I just disabled samsung's encryption and full touch for Twrp
I don't quite understand I just flashed twrp from odin
it's not as messy as you say and it still works
Can I use adb to backup data on this rom and restore it on another rom?
Xxxx
tom.android said:
No use TWRP backup only
Click to expand...
Click to collapse
Twrp has not backed up yet
Xxxxxx
Xxxx
Xxxx
Xxxx

How To Guide Flash GSI with Odin Only (no fastboot(D) or TWRP needed): [Kernelsu] LeOS-T (May) A13 QPR2 & Mod

1.Unlocked BootLoader.
2.-T22X with Stock ROM pre-installed. Or Any GSI.
3.Odin
4.Linux Sub-system wins10,11
5.https://github.com/ChromiumOS-Guy/SuperPatcherGSI :Autmated Script to Patch a Super.img with a GSI in python 3. "SuperPatcherGSI-x64.AppImage"
Releases · ChromiumOS-Guy/SuperPatcherGSI
Autmated Script to Patch a Super.img with a GSI in python 3 - ChromiumOS-Guy/SuperPatcherGSI
github.com
6.Download GSIs (extract *.img file)
7.Extract "super.img.lz4' from AP.tar.md5 (Your Firmware) with zip util.
How2
-Install Ubuntu-18.04 Linux sub-system on Wins10,11
-Create shotcut to Desktop
Open RUN box and type: \\wsl$
install python3
-Launch Ubuntu sub system.
Code:
sudo apt update && upgrade
sudo apt install python3 python3-pip ipython3
***Test Python
Create test.py file with this code. Or download from Attachment.
Code:
def printList(lst):
for item in lst:
print(item)
lst=[1,2,3,4,5]
printList(lst)
Execute with this command:
Code:
python3 test.py
If you saw this output then it works.
1
2
3
4
5
-exit and restart (sub-system)
-ReLaunch Ubuntu sub system.
-put "super.img.lz4" "SuperPatcherGSI-x64.AppImage"
"Any_GSI.img" Into "home/<linux_user_name/"
-install "lz4 package" and extract "super.img" from LZ4 format.
Code:
sudo apt install liblz4-tool
lz4 -d super.img.lz4 super.img
-Execute SuperPatcherGSI script
Command flag: [ interactive mode]
./SuperPatcherGSI-x64.AppImage -i super.img (input) -o super.new.img (output) -s 2 (device slots)
Code:
./SuperPatcherGSI-x64.AppImage -i super.img -o super.new.img -s 1
*Note: T22X has 1 slot.
EXAMPLE FROM LOG:
# insert GSI into Super partition
(base) [email protected]:~$ ./SuperPatcherGSI-x64.AppImage -i super.img -o test.img -s 1
flags successfully verified and appear to be correct, error code (OK)
============================
unpacking...
============================
Sparse image detected.
Process conversion to non sparse image ....[ok]
Extracting partition [system] .... [ok]
Extracting partition [odm] .... [ok]
Extracting partition [product] .... [ok]
Extracting partition [vendor] .... [ok]
============================
choose img to replace
============================
option number 0 system.img size of (3825119232) bytes
option number 1 product.img size of (1238544384) bytes
option number 2 vendor.img size of (652824576) bytes
option number 3 odm.img size of (4349952) bytes
Please Choose: yaap.img
Please Put a Number In!
Please Choose: 0 《-----------Your choice
Please Input Path To Replacment Partition:
yaap
Please Input a Valid Path to a IMG File!
Please Input Path To Replacment Partition:
yaap.img 《-------------Your choice
Are you sure this is the path to file (Y/n): y
Img replaced!
replace another (Y/n): n 《---------------Your choice
============================
device size (super.img size) in bytes must be evenly divisible by 512, default (5319659520) bytes:
metadata size in bytes must be evenly divisible by 512 default=~0.5KiB:
make sparse (flashable with fastboot) ? (Y/n): y 《-------------Your choice
============================
using these flags:
============================
--device-size=5319659520 --metadata-slots=2 --output test.img --metadata-size 512000 --sparse --partition=system:none:2911940608 --image=system=/home/tom/tmp/system.img --partition=product:none:1238544384 --image=product=/home/tom/tmp/product.img --partition=vendor:none:652824576 --image=vendor=/home/tom/tmp/vendor.img --partition=odm:none:4349952 --image=odm=/home/tom/tmp/odm.img
============================
lpmake I 06-25 12:20:44 530 530 builder.cpp:1093] [liblp] Partition system will resize from 0 bytes to 2911940608 bytes
lpmake I 06-25 12:20:44 530 530 builder.cpp:1093] [liblp] Partition product will resize from 0 bytes to 1238544384 bytes
lpmake I 06-25 12:20:44 530 530 builder.cpp:1093] [liblp] Partition vendor will resize from 0 bytes to 652824576 bytes
lpmake I 06-25 12:20:44 530 530 builder.cpp:1093] [liblp] Partition odm will resize from 0 bytes to 4349952 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
============================
cleaning...
============================
OK
(base) [email protected]:~$
============================
-Final: you will get " super.new.img" ( rename it to " super.img" before -》
Create "tar file of super.img" with zip utility.
-OPEN "ODIN" AND CONNECTED WITH "Download Mode of your SM-T22X
Flash "super.tar" at AP Slot.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
(No need to wipe or factory reset)
ErrorsMeaning/FixNot enough space on device for partition (PARTITION NAME HERE) with size (PARTITION SIZE HERE)this means that the --device-size flag for lpmake was set with a maximum size which is smaller than all the partitions (unpacked img files + GSI) combined.Invalid sparse file format at header magic / Invalid sparse file format at headerthis is actually a warning and can be ignored its actually a good sign if you get this warning
Reserve:
RW Dynamic partition with Linux sub-system .& How2 install LeOS-T (the final latest variant).
1.modify bootanimation .by delete /product/media/bootanimation.zip and flash livebootmagisk with kernelsu manager.
GitHub - symbuzzer/livebootmagisk: A Magisk and KernelSU module that enables unix-style (verbose) boot animation for Android devices
A Magisk and KernelSU module that enables unix-style (verbose) boot animation for Android devices - GitHub - symbuzzer/livebootmagisk: A Magisk and KernelSU module that enables unix-style (verbose)...
github.com
2.Make RW Super partition plus Add free spaces 700 MB.
3.Mod Home Launcher.

Categories

Resources