How To Guide (close) Modified sub-partition of super.img [ CustomAP part 2] - Samsung Galaxy Tab A7 Lite

My Old Computer is slow down when changes to WSL2​Note: May be there are someone wants to modify GSI suitably for their device.​
Modified sub-partition of super.img​Step by Step​CREATE CustomAP for Odin Flashing with Patching Dynamic Partitions.​
*** the continue part of Step by Step CREATE CustomAP framework file for GSI Flashing with Odin.
(Required Win10 with wsl2 or Ubuntu or VirtualBox)
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
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.)
>>>>Part 1 (update to used win10 + WSL2) is here. https://forum.xda-developers.com/t/...s-a12-a13-installation.4473159/#post-87204333
Steps ( Essencial tools)​Extract Sub-Partition inside super.img.lz4 tool​## Download Samsung framework file. (Stock Firmware) with
Bifrost.
## 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
Full contents here: https://forum.xda-developers.com/t/...s-a12-a13-installation.4473159/#post-87204293​

Related

[BOOT] Kexecboot / CM-Recovery

Update 05/12/13: Latest kernel 2.6.35.14 updates. And small changes to boot image.
This is a boot image combines the strength of ClockworkMod Recovery providing a slim set of tools with kexecboot to launch alternative operating systems, alternative kernels and configurations using the kexec feature of the linux kernel.
First to launch is the kexecboot bootloader, which provides a nice easy to use front end. This can be "Quit" trough a menu selection (using volume up, volume down, and selected with call button) Resulting in the CM-Recovery menu launching. http://kexecboot.org/screenshots http://kexecboot.org/documentation
This then provides:
* Multi-boot capability
* ADB
* CM-Recovery operations
{
"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"
}
http://youtu.be/1zQrY0NDsTg
http://threader.zapto.org/experimental/s7/kexecboot-recovery/recovery-kex.img
http://threader.zapto.org/experimental/s7/kexecboot-recovery/boot-example.tar
Kexecboot hunts for /boot/boot.cfg files on all partitions.
A boot.cfg which boots Android and Dedian off the second partition on the sdcard looks like this:
# kexecboot configuration file
# Default kernel
LABEL=Debian
KERNEL=/boot/zImage-debian
APPEND=root=/dev/mmcblk0p2 rw rootfs=ext4 init=/sbin/init rootwait noinitrd fbcon=rotate:0 fbcon=font:VGA8x8
#ICON=/boot/default.xpm
PRIORITY=100
#Android
LABEL=Codeaurora Android 4.1.1
KERNEL=/boot/zImage-aurora
APPEND=android.console=ttyMSM2,115200n8 androidboot.hardware=s7
INITRD=/boot/ramdisk-aurora.gz
#ICON=/boot/default.xpm
PRIORITY=100
Notes: Both kernels and boot.cfg reside in /boot on my internal sdcard.
If you are or arent familiar with split_bootimg , ( https://gist.github.com/jberkel/1087743 ) this perl script splits android boot.img files into two parts and provides the necessary boot parameters. These files can be dropped into the /boot folder and used directly.
Code:
./split_bootimg.pl ../boot-aurora4.1.img
Page size: 2048 (0x00000800)
Kernel size: 3704240 (0x003885b0)
Ramdisk size: 168730 (0x0002931a)
Second size: 0 (0x00000000)
Board name:
Command line: android.console=ttyMSM2,115200n8 androidboot.hardware=s7
Writing boot-aurora4.1.img-kernel ... complete.
Writing boot-aurora4.1.img-ramdisk.gz ... complete.
Thanks to ere- for his CM-Recovery image which this image uses as a base.
asturel for helping debug and test the kernel on 20x.
Rob Clark and dzo for guidance in need!
Kexecboot project for their excellent work!!
Thank you very much guys!
Very nice!!
Thank you!
One question: are we able to boot two different version of Android, for instance, the old 2.2 and 4.1 or 4.2 ??
JotaMG said:
Very nice!!
Thank you!
One question: are we able to boot two different version of Android, for instance, the old 2.2 and 4.1 or 4.2 ??
Click to expand...
Click to collapse
Thats what im aiming for, it seems a little tied into the init.rc of the "recovery" though. However since kexec and kexecboot has support for initrd's i think it all comes down to configuration.
I will try building a proper debian initrd and see what occurs. But i am able to boot and run debian and 4.1 already.

Lenovo A7600-F(tablet) building CWM recovery from source

ok so ill start beginning, and my i say thanks to all who's posts ive read in the number of years on my many roots and custom rom installs. im trying to port cwm to my new Lenovo A7600-F 10.1 inch tablet.
i think im going about it the right way but would just like to confirm with any1 who knows what there doing
step 1
installed ubuntu ,i connected adb and the usual gear.
step 2
i gained the boot.img and recovery.img then after many many attempts i finally got into the ramdisk by using android kitchen to strip them down as other programs were doing each separately which was corrupting the files and making them unreadable.
step 3
im unsure on the process after this althou this guide is the 1 im on now ;p
http://forum.xda-developers.com/android/development/guide-how-to-build-cwm-based-recovery-t2973804
i have a number of questions.
when im repacking from the tree etc i used both files to create ramdisk folder which list my dir tree etc. when i build from the tree with cm source putting the obvious fsabs uevent.rc and repack (although im not sure i need to) some say i just need to transfer a few files across to the build tree. then create a recovery. img then flash.
mine used 2 files recovery.img and boot.img to make the 1 folder(ramdisk) so will i not have to flash both them back or can i just build from tree then use the recovery.img?
instead of flashing right away i have fastboot and ive heard you can (ill use the term) soft flash which basally means i can test the cwm recovery without actually flashing it to the device is this right?
also ive been only using ubuntu for a few weeks so in as plain English as you possible can and if any1 would like the files i have so far and all the device information partitions etc ill list them below.
Lenovo A7600-F
HJH11LUT
Bus 001 Device 004: ID 17ef:7731 Lenovo
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=1
ro.allow.mock.location=0
persist.mtk.aee.aed=on
ro.debuggable=0
ro.adb.secure=1
persist.sys.usb.config=mtp
persist.service.acm.enable=0
ro.mount.fs=EXT4
ro.persist.partition.support=no
cat /proc/partitions
major minor #blocks name
8 0 1953514584 sda
8 1 1953512448 sda1
11 0 1048575 sr0
8 16 488386584 sdb
8 17 102400 sdb1
8 18 409497600 sdb2
8 19 1 sdb3
8 21 74620928 sdb5
8 22 4161536 sdb6
{
"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"
}
And if any1 has hints tips to speed this whole process up id be very grateful!
back up of all boot.img and recovery.img is in zip file below use these at your own risk if your device is stuck in boot loop etc

[ TOOL - Python2/3 ] UPDATE.APP Img Extractor - splituapp

Disclaimer: I am not responsible for anything bad that may occur from the use of this tool, but I will take all the credit you can give me if it works for you
{
"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"
}
splituapp is similar to splitupdate.pl and split_updata.pl for unpacking/splitting/extracting img files from an UPDATE.APP file. The main difference being this one is written for Python2/3 instead of Perl. Additionally, splituapp allows you to extract specified img files where the others will only extract all img files at once. This saves a lot of time if you know which img files you want.
Assuming splituapp and UPDATE.APP are in the same directory and you have a command prompt open in that directory, here are some examples.
To extract all img files:
Code:
splituapp -f UPDATE.APP
To extract only system.img and boot.img:
Code:
splituapp -f UPDATE.APP -l system boot
You can run "./splituapp -h" (Linux) or "python splituapp -h" (Windows) to get usage instructions.
Like splitupdate.pl and split_updata.pl, splituapp will do crc checksum verification on the img files after extraction if the crc binary is in the same directory the script is run from. Unfortunately I do not have the source for the binary so it is only available for Linux at this time. As a result, the crc verification will be disabled in Windows for now.
This program does not extract the images it splits from UPDATE.APP. Once the img files are split from UPDATE.APP the job is complete. If you are looking for a tool to handle system.img extraction you can check out SuperR's Kitchen.
splituapp Download/Source
Enjoy
Credits:
I am not sure who did what, but thanks
McSpoon, JoeyJiao, ZeBadger - for the data_structure file in splitupdate.pl and the crc binary for Linux
reserved
Updated.
Changes:
Improved argument parsing by adding -f and -l switches.
Improved the help output.
NOTE: Make sure you check the command syntax, it has changed.
CRC errors
Hi,
when extracting the UPDATE.APP of BKL-L09C432-9.0.0.178(C432E4R1P12) I have CRC errors like:
Code:
$ ./splituapp -f UPDATE.APP -l recovery_ramdisk
Extracting recovery_ramdisk.img ...
Calculating crc value for recovery_ramdisk.img ...
ERROR: crc value for recovery_ramdisk.img does not match
Doing all this on Ubuntu 18.04.2 (Kernel 4.20).
Can I trust the extracted images?
Update: After a crosscheck with the use of "split_updata" and hashing both extracted recovery_ramdisk and following use of the extracted .img with Magisk to root my Honor V10, I can confirm that the image was correct even with the CRC-error.
Updated.
Changes:
Check for files with duplicate names in UPDATE.APP and append file names with _2 to avoid overwriting the first.
Do not read entire file into ram before writing it. This will help PCs with less ram to extract large files.
General code cleanup.
Hello
You are talking about the new encryption EROFS I updated my huawei p10 EMUI 9.1 to latest version i unlocked the bootloader trying to flash Chinese firmware on it then it bricked no sign of power but my pc recognise it in Fastboot I downloaded a file from xda named p10 revive which includ the flashing firmware. but the partitions are not flashing even if I flash it individually please can some one help and show me how to RW the partition from RO please
SuperR. said:
Updated.
Changes:
Check for files with duplicate names in UPDATE.APP and append file names with _2 to avoid overwriting the first.
Do not read entire file into ram before writing it. This will help PCs with less ram to extract large files.
General code cleanup.
Click to expand...
Click to collapse
Can you please help with how to bypass EROFS because my phone bricked and it's not sending the cust, system, vendor ....etc when I flashed please enligh me on how to RW the EMUI 9.1 partitions

Using adnl burn mode with Khadas VIM4 and other modern amlogic SoCs?

Modern amlogic SoCs seem to have done away with v2 usbburning mode (aml v2 factory burn) using the worldcup drivers with the command line "update" utility and the GUI usb burning tool. The reference u-boot code for these new SoCs does not seem to have the possibility to use the legacy v2 usbburning mode code.
This is apparent in the soon-to-be-released Khadas VIM4, as well as all presently released amlogic designs using the S905X4, including askey's sti6220d315, sei's SEI800 series, and videostrong's ka2, amongst others. It is also the case for all recently released devices using the S905Y4 SoC, like sdmc's dv6071z and sei's SEI700 series.
The replacement for v2 usbburning mode in these devices is adnl (amlogic DNL protocol);
Code:
adnl - use Amlogic DNL protocol
Amlogic DNL protocol appears to use ordinary fastboot/adb style drivers. But the ordinary fastboot host-side tool is not sufficient in order to fully utilize amlogic DNL protocol. Khadas has posted a linux adnl host-side tool binary on github.
Khadas also has posted a win32 adnl host-side tool binary package, aml_dnl-win32.zip. The help screen and some usage examples are shown below:
Code:
adnl.exe -h
Amlogic DNL protocol tool V[2.6.3] at Aug 20 2021
usage: adnl [ -s <specific para> ] <command> <command para>
commands:
devices List all connected dnl devices
getvar <variable> Display a BL1/BL2/BL33 variable.
if not supported, this does nothing.
setvar <variable> <value> Set a BL1 <variable> with <value>.
setkey <keyPath> Set a BL1 <variable> with <value>.
oem/cmd <cmd> Send a BL33 string<cmd>.
download <FilePath> [<size> <offset>]
Download file to RAM[, with <size>bytes from <offset>]
run boot code in RAM, after cmd 'download'.
bl1_boot -f <bootloaderPath> BL1 download and boot bl2.
bl2_boot -f <bootloaderPath> BL2 download and boot TPL.
partition <-p partName> <-f imgPath> [<-m media>] [<-t imgType>] [-v vryFile]
@media: mem/store/key, default store
@imgType: sparse/normal, default normal
upload <-p partName> <-f dumpFilePath> <-z dumpSz [K|M|G]> [<-m media>] [<-o offset>]
@media: mem/store/key, default store
@offset: start offset in part @partname, default 0
reboot [mode] Reboot device [into supported mode].
other options:
-s <specific para> specify a USB device, command 'devices' to get specific para
-h, --help show this message.
Beyond the help screen, documentation for (or examples using) the amlogic DNL protocol host-side tool is pretty sparse. Although It seems that most of the functionality that is in the old worldcup host-side tool is also present in the adnl host-side tool.
I've found only this single post that referenced using the windows binary, which included these images:
{
"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"
}

[TOOL][MOD][A12/A13] Unpack & repack OPlus splash image (logo.img) [LINUX][WINDOWS]

While researching about Run-length-encoding (RLE) and modifying the source code of the splash image tool for the OnePlus 6 series to be compatible with 8 series (which was starting to look promising), I ended up stumbling upon this GitHub repository for a tool that already accomplishes the unpacking and repacking process of logo.img for various OPlus (Oppo + OnePlus = OPlus) devices.
This has been tested on both OOS12 and OOS13 firmware. Compatibility with older versions of the logo.img from previous OOS versions (OOS11 and below) is unknown at the time of writing this.
Usage
Unpack oplus splash image:
./opsplash unpack -i orig-logo.img -o pic
Editing:
You'll want to make your edits to the output file named "boot". I noticed that if "boot" exceeds the default size it will not show up during power on and will instead display a black screen. It is advised to keep the bitmap file the same size or less to work properly.
Repack oplus splash image:
./opsplash repack -i orig-logo.img -o new-logo.img
Only read image info:
./opsplash readinfo -i orig-logo.img
Flashing
This will need to be done in fastbootd rather than fastboot (bootloader), since regular fastboot (bootloader) prevents flashing critical partitions.
Original logo:
fastboot flash --slot=all logo orig-logo.img
New logo:
fastboot flash --slot=all logo new-logo.img
Side note:
I seem to have found some rather unusual images in the logo.img for instantnoodlep. You'll just have to unpack it and see for yourself -_-
Reserved
made this one, looks good. logo.img in attachment, plus original bmp, remove the *.pdf extension (xda impose upload rules)
{
"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"
}
why do i keep getting this error my stock boot.bmp is 7.41 MB
the one i want to replace is 6.67 mb
but i keep running to this error
whould you know why?
halloweenm925 said:
why do i keep getting this error my stock boot.bmp is 7.41 MB
the one i want to replace is 6.67 mb
but i keep running to this error
whould you know why?
Click to expand...
Click to collapse
Your bmp file does not pass checks:
1. You bmp file header is doesn't equal to 0x36.
2. BMP file itself seems to be wrong or corrypted.
Also try to rename it to contain no spaces in filename.

Categories

Resources