[RECOVERY][REPARTITION][19.05.09]twrp recovery + gpt binary - Xiaomi Mi 4C

If you download or apply this solution before 2019.07.17.16:20(GMT+9)
you NEED to revert stock partition or new partition layout
and download recovery image and flash again
Here is treble-enabled twrp recovery and GPT binary required for repartition
This process is ready to support the android treble, and additional work(modify kernel, create and organize vendor stuff) is required to use the android treble rom
You no need to repartition to use android treble
Chaged partiton layout
SYSTEM 1920MB > 2200MB, 2400MB (for future)
CUST 320MB > 400MB
How to repartition(increase system partition size)
If you resize the partition table, device data will be corrupted.
You MUST backup data partition before repartition!!!
Also COPY to all backup image, media file(photo, music, etc) into other device(PC, USB STICK)
1.Reboot into fastboot mode
2.fastboot flash partition gpt_both0.bin
System 1920mb, cust 320mb
System 2200mb, cust 400mb
System 2400mb, cust 400mb
I recommend resizing the system partition capacity to 2400mb.
3.Reboot into twrp recovery
4.Wipe vendor, cache partition in wipe menu
5.Format data partiton(format data) in wipe menu
6.Copy backup image into device
7.Restore backup image(data)
GPT Binary
TWRP Recovery
For developer
I decided to use cust partition as vendor, because is other xiaomi device is doing the same way.
If we store vendor stuff to vendor(cust) partition, it saves system partitition size
To support treble, add this code in kernel source
arch/arm/boot/dts/qcom/msm8992.dtsi
Code:
firmware: firmware {
android {
compatible = "android,firmware";
fstab {
compatible = "android,fstab";
system {
compatible = "android,system";
dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/system";
type = "ext4";
mnt_flags = "ro,barrier=1,discard";
fsmgr_flags = "wait";
status = "ok";
};
vendor {
compatible = "android,vendor";
dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/cust";
type = "ext4";
mnt_flags = "ro,barrier=1,discard";
fsmgr_flags = "wait";
status = "ok";
};
};
};
};
Next we need to organize vendor stuff
Since i don't have much time to make it, other developer participation is needed

Will this work on 16Gb variant? And i still need to wait for a treble rom to fill the vendor partition?

Ga_hap_la_chanh said:
Will this work on 16Gb variant? And i still need to wait for a treble rom to fill the vendor partition?
Click to expand...
Click to collapse
Yes it works on both device(16GB, 32GB)
We have to wait for the developer to make blob(boot+vendor image) which is support android treble.
Sadly I don't have much time to make that

dla5244 said:
Yes it works on both device(16GB, 32GB)
We have to wait for the developer to make blob(boot+vendor image) which is support android treble.
Sadly I don't have much time to make that
Click to expand...
Click to collapse
Thank you for your help, i think create a treble rom is very complicated, there is only a dev active that still building los 16. Maybe he read this topic and decide to make one...

An interesting idea, I hope you will succeed. I'll wait for the news!

2019.05.09
Recovery image, GPT binary updated
If you download or apply a solution before 2019.05.09.17:40(GMT+9)
you NEED to revert stock partition or new partition layout
because we no need to create vendor partition
cust partition is mounted as vendor partition

dla5244 said:
2019.05.09
Recovery image, GPT binary updated
If you download or apply a solution before 2019.05.09.17:40(GMT+9)
you NEED to revert stock partition or new partition layout
because we no need to create vendor partition
cust partition is mounted as vendor partition
Click to expand...
Click to collapse
Now i'm just waiting for a miracle =)))))

Nice, wait for android Q installed on this device.

Thanks for your great work.
I would really like to help but for my having no idea. Sorry for my poor English as well.

Unfortunately this is not supported by 'not OEM unlocked devices'. FAILED (remote: Critical partition flashing is not allowed).

Any news? ?

great project
---------- Post added at 11:26 PM ---------- Previous post was at 11:21 PM ----------
i want to try it but i dont know some process with this.
maybe useless.
mokee author say he won't make project treble for 4c..
maybe lineage-os16 anthor noticed

Tianjingbaozi2 said:
great project
---------- Post added at 11:26 PM ---------- Previous post was at 11:21 PM ----------
i want to try it but i dont know some process with this.
maybe useless.
mokee author say he won't make project treble for 4c..
Click to expand...
Click to collapse
I think I can't make vendor image now
In order to use GSI rom, we need use CUST partitions like a vendor partition
Someday we will be able to use most GSI roms
I will update OP to extend system partition size.

Well done!

Related

[MOD] one_sv-swaper: Swap "internal" sd (4GB fat), /data (1GB ext4) and external SD

[MOD] one_sv-swaper: Swap "internal" sd (4GB fat), /data (1GB ext4) and external SD
Hello there.
I'm using my c525u for over a year and very upset with the size of /data partition, From the other side, it has "internal sd-card" I'm not using at all (well, some apps use it for it's data, but not all 4GB).
So one day I decided to swap them. Store data on 4GB partition and int_sd on 1GB one. Here is small instruction, how to do this.
one_sv_swapper
Goal: swap /data, /sdcard and /sdcard/ext_sd in different ways (see below). The main result is to allow one to "enlarge" /data partition.
How: modify boot (aka kernel) and /system to change mount points. Also modify recovery to force it to backup/restore with new partitioning scheme.
Requirements:
K2_UL, K2_U or K2_CL smartphone. (K2_PL_CPL should be supported too, but nobody has tested it yet.)
ROM: Stock JB based
Recovery: TWRP (Was tested with TWRP_2.7.1.1_K2_UL.img and openrecovery redo 2.8.5.0)
S-Off/S-On: S-Off is needed. Will not work with S-On.
Working adb on PC.
Do full backup of your phone before you begin (including android_secure)!
Also save any valuable content from your "internal" sd-card, because it will be formated.
Install instructions.
1. Boot into recovery!
2. Download archive from the link below and extract files to some directory on your PC.
3. Open console in the directory with the files. (Start/Run/cmd.exe or any other way)
4. Write the following 3 commands in the console (Do not loose " sign.)
Code:
adb push swapper /tmp
adb push abootimg /tmp
adb shell "cd /tmp&&chmod 755 *&&./swapper READONLY"
If scripts finishes successfully you will see Everything is done. message.
In case of troubles dump here script's output to get support.
After "remapping" your flash it is necessary to reboot your smartphone. Then you could start with your wiped system or boot into recovery and restore your data from the backup (but only /data and .android_secure)
Take a note: this mod modifies recovery partition, so do not reflash recovery after installing this mod, or you will not be able to use backup/restore/wipe functions.
Mod's modes =)
There is "READONLY" parameter written in the end of the last command. This is partitioning mode. You should write there any of the following variants:
READONLY
Do not modify anything on the phone, just unpack images and analyze them.
STOCK
/data - 1GB flash
/sdcard - 4GB flash
/sdcard/ext_sd - external SD
I_E_MOD
/data - 1GB flash
/sdcard - external SD
/sdcard/ext_sd - 4GB flash
D_I_MOD
/data - 4GB flash
/sdcard - 1GB flash
/sdcard/ext_sd - external SD
D_I_E_MOD
/data - 4GB flash
/sdcard - external SD
/sdcard/ext_sd - 1GB flash
Uninstall instruction
To remove this mod just run it again with parameter STOCK (see above).
Or follow the full restore instruction below.
Any of this methods means data loss, so do not forget backup data, android_secure and internal SD.
How to restore your phone in case of troubles:
1. Flash clean recovery from PC (with "fastboot flash recovery ...")
1'. Boot into recovery.
2. Restore all data from backup
3. Reformat int_sd as FAT from recovery "Format" menu
FAQ
Q: Could I install this mod on the phone with internal and external sd swapped.
A: Yes, this is one of supported state (called I_E_MOD). swapper should handle this perfectly.
Q: After installing this mod, I see "Unknown" in Settings/Storage/AppStorage size.
A: This is known issue in I_E_MOD and D_I_E_MOD modes. It doesn't affect any functionality.
Q: After reboot says Type Password to Decrypt Storage... what can i do?
A: This means that swapper failed to modify your boot/system correctly. You could restore your firmware from backup (see above). If you still want to do the modification, contact me with detailed info about your phone, we could try to debug the problem.
Download here
Donate here
Changelog:
v 0.8 Support flags in recovery.fstab of k2_cl openrecovery TWRP.
v 0.7 Link abootimg statically to fix possible issues with incompatible recovery builds.
v 0.6 Fix error with openrecovery-twrp-2.7.1.0-k2_ul.img (And possibly 2.8.4.0)
v 0.5 Fix fatal error from 0.4. Readonly mode by default.
v 0.4 Fix k2_u support, add k2_cl support.
v 0.3 Fix some diagnostics, add footer.
v 0.2 Support for k2_u
v 0.1 Initial version.
Click to expand...
Click to collapse
App Storage of 6,8GB
{
"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"
}
Phone Storage
There would be an easier way ? or otherwise make 3gb data and 2 internal sd ? anyway, congratulations : D and sorry for my bad english xD
Hello ,
Thanks for your post.
If there will be no errors/problems reported, I'll write more newbi-flendry instruction and upload images/scripts.
Click to expand...
Click to collapse
That would be Wonderful !!!!
Please can you confirm which K2 model you use ? (K2UL or something?)
Alos i understand you have a TWRP boot :
it means : S-OFF & Root ?
The more detailed it is, the best it is !
Thanks, and Congrats !
Near710 said:
There would be an easier way ?
Click to expand...
Click to collapse
Definitely yes.
or otherwise make 3gb data and 2 internal sd ?
Click to expand...
Click to collapse
No.
Ivory_75 said:
Hello ,
Thanks for your post.
That would be Wonderful !!!!
Please can you confirm which K2 model you use ? (K2UL or something?)
Alos i understand you have a TWRP boot :
it means : S-OFF & Root ?
The more detailed it is, the best it is !
Thanks, and Congrats !
Click to expand...
Click to collapse
The main idea (posted above) is proof of concept. It could be implemented with any rom/firmware/model (even not only K2). All you need is unblocked bootloader and you do not need S-Off.
But right now I'm testing fully automatic method, it will be released soon.
Successfully tested on K2_UL S-Off TWRP_2.7.1.1 Stock JB rom.
K2_U support work is in progress, there are minor issues.
S-Off is not needed, I think, but may be wrong.
Root is not needed.
TWRP 2.7.1.1 is the only supported recovery, I did not tested any other.
Script supports only JB stock based roms, but other roms could be added in the future.
Ok, several phones (K2_UL and K2_U) were successfully converted using new automatic method.
You could try it right now from here [1].
Instruction is in Russian for now (you can try google translate), I will put English one in 1st post later today.
[1] http://4pda.ru/forum/index.php?showtopic=439253&st=7020#entry37175308
Tadaaam! Post is updated with new end-user friendly instruction.
After reboot says Type Password to Decrypt Storage... what can i do?
Near710 said:
After reboot says Type Password to Decrypt Storage... what can i do?
Click to expand...
Click to collapse
Sad to hear this.
Please write here your configuration (model, rom, recovery, s-on/off) and output of swapper READONLY command. This will allow me to find problem in swapper script.
Then just restore your phone from backup as described in top message.
K2U Stock Rom
TWRP 2.6.3.2
S OFF
C:\Users\Mario\Android SDK\adt-bundle-windows-x86_64-20140624\sdk\platform-tools
>adb push swapper /tmp
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
2207 KB/s (9043 bytes in 0.004s)
C:\Users\Mario\Android SDK\adt-bundle-windows-x86_64-20140624\sdk\platform-tools
>adb push abootimg /tmp
3164 KB/s (25924 bytes in 0.008s)
C:\Users\Mario\Android SDK\adt-bundle-windows-x86_64-20140624\sdk\platform-tools
>adb shell "cd /tmp&&chmod 755 *&&./swapper READONLY"
HTC One SV partition swapper by Alexander GQ Gerasiov.
Version: 0.5, target state: READONLY.
Emmc partitions: recovery=21 boot=20 userdata=35 fat=36
Extracting boot...
/dev/block/mmcblk0p20: no Android Magic Value
/dev/block/mmcblk0p20: not a valid Android Boot Image.
Possible stock signed boot, stripping signature...
65535+0 records in
65535+0 records out
16776960 bytes (16.0MB) copied, 1.005127 seconds, 15.9MB/s
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
Extracting boot:initrd...
1939 blocks
Extracting recovery...
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
Extracting recovery:initrd...
22532 blocks
Checking current state...
States: boot: STOCK, recovery: STOCK, system: STOCK
Readonly mode called, exiting successfully.
C:\Users\Mario\Android SDK\adt-bundle-windows-x86_64-20140624\sdk\platform-tools
>
Click to expand...
Click to collapse
Try to restore but nothing..
Solved by flashing RUU
That looks very strange, because the dump you posted shows, that you have stock unmodified partitions and even signed boot.
any chance this would work on k2_cl(boost)?
BHoller said:
any chance this would work on k2_cl(boost)?
Click to expand...
Click to collapse
There is support in the code of swapper, but nobody has tested this.
Sent from my HTC One SV
Hello
I'm trying to do the swapp. On Readonly, i have the following message :
../abootimg: not found
what's wrong ?
abooting appears in the /tmp folder with TWRP....
d:\tel2015\Fastboot>adb push swapper /tmp
8 KB/s (9043 bytes in 1.000s)
d:\tel2015\Fastboot>adb push abootimg /tmp
811 KB/s (25924 bytes in 0.031s)
d:\tel2015\Fastboot>adb shell "cd /tmp&&chmod 755 *&&./swapper READONLY"
HTC One SV partition swapper by Alexander GQ Gerasiov.
Version: 0.5, target state: READONLY.
Emmc partitions: recovery=21 boot=20 userdata=35 fat=36
Extracting boot...
./swapper: line 226: ../abootimg: not found
Possible stock signed boot, stripping signature...
65535+0 records in
65535+0 records out
16776960 bytes (16.0MB) copied, 0.929650 seconds, 17.2MB/s
./swapper: line 226: ../abootimg: not found
Click to expand...
Click to collapse
My phone
TWRP 2.7.1.0 (same error with 2.8.0.1 version), phone K2_UL unlock, root, s-off (S-off is complicated and required root. and it is too risky to try it with S-On )
Thanks for your help;
-=GQ=- said:
There is support in the code of swapper, but nobody has tested this.
Sent from my HTC One SV
Click to expand...
Click to collapse
my concern is that the boost variant is most likely formatted differently and this could actually brick my phone indefinitely.. i can recover from a soft brick no problem and i have my backup files but i have never tried to format the internal drive.. ive swapped them with the fstab trick in the past but i found extending the apps to the external to work better.. your method, if im not mistaken, would allow me to use the current 4.45gb "media" partition as the "data" partition and use the 1.22gb "data" partition as "media".. this would allow me to install more apps to the phone without running out of space.. this method doesnt effect the system rom partition at all though? as long as it doesnt modify any of the system rom i should be able to recover if your swapper doesnt work with my variant
BHoller said:
my concern is that the boost variant is most likely formatted differently and this could actually brick my phone indefinitely..
Click to expand...
Click to collapse
I use info from /proc/emmc about partitions and modify only recovery, system, boot, data and fat.
As I do no modification to hboot, maximum problem you could get is the phone in fastboot mode. That's my view.
But of course there is no warranty.
same problem like Ivory_75
Hello,
i have exactly same problem like Ivory_75. Please, how to fix it. thanks
Ok,
It doesn't work.
Stupid question : running adb command is from system or from TWRP recovery ?
from system, it says /tmp is readonly.
From recovery, it says (after pushing both files):
Possible stock signed boot, stripping signature...
65535+0 records in
65535+0 records out
16776960 bytes (16.0MB) copied, 0.934992 seconds, 17.1MB/s
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
Extracting boot:initrd...
1937 blocks
Extracting recovery...
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
Extracting recovery:initrd...
12444 blocks
Checking current state...
States: boot: STOCK, recovery: UNKNOWN, system: STOCK
Fatal error: Current state is unknown, nothing changed, aborting.
My guess is TWRP 2.7.1.1 is mandatory, but i can't find it in http://techerrata.com/browse/twrp2/k2_ul
Thanks for your help

64 Bit OS Development

Edit 25/10/2020: OK its been a while guys, if you want to try a ROM I'd highly recommend following LineageOS's wiki for instructions. Then if u want to try other ROMs keep an eye out in these forums, ill have a build up every now and then. See ya around guys
==========================================================================================
Rather than having random comments in random parts of the forum here is a thread for everything 64 bit on G7 Play.
CURRENT STATUS
WE DID IT!!!! CHECK SyberHexen's ANDROIDFILEHOST FOR DOWNLOAD!
OLD POST ARCHIVED BELOW
And here is what is available so far:
A nice selection of ROMs for the other G7's, but they dont actually boot on the Play, although should do something in theory
postmarketOS is aarch64, but that is mobile linux, and no phone interface works (x.org doesnt work with the current drivers)
Here is what I've tried:
crDroid from ocean:
I got it to install by: repartitioning device using ocean gpt.bin
Then flashing stock rom from channel
Booting TWRP
Flashing ROM, with modified zip accepting channel
Doesnt boot
Also tried a flash using ocean firmware completely, doesn't boot, but got the logos and bootloader works lol
If anyone has any tips or progress drop it here, eta kids go away. Read the status above if you want the up-to-date answer
00p513 said:
Rather than having random comments in random parts of the forum here is a thread for everything 64 bit on G7 Play.
CURRENT STATUS
NO 64-BIT ANDROID ROM AVAILABLE
And here is what is available so far:
A nice selection of ROMs for the other G7's, but they dont actually boot on the Play, although should do something in theory
postmarketOS is aarch64, but that is mobile linux, and no phone interface works (x.org doesnt work with the current drivers)
Here is what I've tried:
crDroid from ocean:
I got it to install by: repartitioning device using ocean gpt.bin
Then flashing stock rom from channel
Booting TWRP
Flashing ROM, with modified zip accepting channel
Doesnt boot
Also tried a flash using ocean firmware completely, doesn't boot, but got the logos and bootloader works lol
If anyone has any tips or progress drop it here, eta kids go away. Read the status above if you want the up-to-date answer
Click to expand...
Click to collapse
You have to compile the kernel from source and use a 64bit gsi and flash a 64 bit vendor partition I'm pretty sure everythi
---------- Post added at 04:44 AM ---------- Previous post was at 04:42 AM ----------
00p513 said:
Rather than having random comments in random parts of the forum here is a thread for everything 64 bit on G7 Play.
CURRENT STATUS
NO 64-BIT ANDROID ROM AVAILABLE
And here is what is available so far:
A nice selection of ROMs for the other G7's, but they dont actually boot on the Play, although should do something in theory
postmarketOS is aarch64, but that is mobile linux, and no phone interface works (x.org doesnt work with the current drivers)
Here is what I've tried:
crDroid from ocean:
I got it to install by: repartitioning device using ocean gpt.bin
Then flashing stock rom from channel
Booting TWRP
Flashing ROM, with modified zip accepting channel
Doesnt boot
Also tried a flash using ocean firmware completely, doesn't boot, but got the logos and bootloader works lol
If anyone has any tips or progress drop it here, eta kids go away. Read the status above if you want the up-to-date answer
Click to expand...
Click to collapse
You have to compile the kernel from source and use a 64bit gsi and flash a 64 bit vendor partition I'm pretty sure everything else will work fine. I'm working on getting a new dev environment set up I'll give it a shot... This phone is reeeeealy under developed. Proly cause the g6 play is a way better phone and much cheaper to boot
mrsurge said:
You have to compile the kernel from source and use a 64bit gsi and flash a 64 bit vendor partition I'm pretty sure everythi
---------- Post added at 04:44 AM ---------- Previous post was at 04:42 AM ----------
You have to compile the kernel from source and use a 64bit gsi and flash a 64 bit vendor partition I'm pretty sure everything else will work fine. I'm working on getting a new dev environment set up I'll give it a shot... This phone is reeeeealy under developed. Proly cause the g6 play is a way better phone and much cheaper to boot
Click to expand...
Click to collapse
We have a 64-bit kernel and 64-bit Lineage OS testing builds but porting 64-bit vendor partition for it to flash in g7 play hasn't been achieved yet.
kD said:
We have a 64-bit kernel and 64-bit Lineage OS testing builds but porting 64-bit vendor partition for it to flash in g7 play hasn't been achieved yet.
Click to expand...
Click to collapse
I think maybe you can just pick out driver binaries from 64 bit /vendor and use all the configs scripts and frameworks from the original vendor
Try backing up/vendor pieceing the drivers from another device of the same model but diff carrier and a combo as such would work. If not mistaken the. Vendor from the Verizon g6 play worked for sprint except data and wifi or radio in general didn't work.. that's a start right there
I think the modem is going to be the same architecture no matter what so you wouldn't have to worry to much about that
64bit Test
Okay so this sh*t probably totally won't boot up at all, but if someone is feeling brave, you can test this out.
1. From your active slot, with root access, you'll need to dd these images to the correct partitions. It's easiest to do this from the internal sdcard using termux. Use the following as a template. These commands assume you're installing it to slot b.
Code:
su
dd if=/sdcard/boot64.img of=/dev/block/by-name/boot_b
dd if=/sdcard/dtbo64.img of=/dev/block/by-name/dtbo_b
dd if=/sdcard/vendor64.img of=/dev/block/by-name/vendor_b
dd if=/sdcard/oem64.img of=/dev/block/by-name/oem_b
2. Reboot into fastboot, swap active slots, and wipe userdata + DDR. Then flash an arm64 AB GSI. I'd recommend trying Phh's AOSP Vanilla to maximize the chances of success.
To swap slots and wipe user data...
Code:
fastboot --set-active=_b
fastboot erase userdata
fastboot erase DDR
3. Reboot system, and tell me what happens.
**Do NOT attempt to use TWRP with this. You'll probably have to reflash stock firmware to the slot you tampered with to get everything back to normal afterwards.**
Link: 64bit Folder
This is not source built, and it's very much a hack job, so I'm really not expecting anything to work. I did get Ubuntu installed this morning, so I will attempt to build from source in the near future.
Please don't use this if you don't know what a "brick" is or how to recover from one
PS: it probably wont work cause vendor is twice the size xD
The G7 play is coming so far little by little it was like yesterday we never thought we would have twrp and magisk and now in fact we do on a GSI
([emoji88]Havoc GSI[emoji88])
00p513 said:
PS: it probably wont work cause vendor is twice the size xD
Click to expand...
Click to collapse
You are correct. She's way too hefty. It's ~164mb too large. I tried resizing last night, but I can only shrink it to 433mb. I can probably remove the modem files and replace them with the ones from stock. I think it's where most of the extra weight is from. The 64bit libs are about 1.5x bigger, but I don't think that accounts for all of it. The Muppets have a tree for sdm632, so all I need to do is look at it, and delete everything in vendor that's not in there. It should help but I'm not sure if it'll be enough. I could repartition it, but I'm not a fan of resizing partitions because I'm very fearful of bricks.
Spaceminer said:
You are correct. She's way too hefty. It's ~164mb too large. I tried resizing last night, but I can only shrink it to 433mb. I can probably remove the modem files and replace them with the ones from stock. I think it's where most of the extra weight is from. The 64bit libs are about 1.5x bigger, but I don't think that accounts for all of it. The Muppets have a tree for sdm632, so all I need to do is look at it, and delete everything in vendor that's not in there. It should help but I'm not sure if it'll be enough. I could repartition it, but I'm not a fan of resizing partitions because I'm very fearful of bricks.
Click to expand...
Click to collapse
I can get a bit more space with an ocean gpt.bin btw. i suppose we could see how those files work i guess and make a bigger vendor?
00p513 said:
I can get a bit more space with an ocean gpt.bin btw. i suppose we could see how those files work i guess and make a bigger vendor?
Click to expand...
Click to collapse
Have you flashed the gpt.bin from ocean before? If so I'll definitely try using that with the slightly smaller vendor I made. I'm thinking most things from Ocean should work natively. The only difference is screen size by a few pixels, ram, and battery capacity. Otherwise they're essentially the same.
Spaceminer said:
Have you flashed the gpt.bin from ocean before? If so I'll definitely try using that with the slightly smaller vendor I made. I'm thinking most things from Ocean should work natively. The only difference is screen size by a few pixels, ram, and battery capacity. Otherwise they're essentially the same.
Click to expand...
Click to collapse
yeah i use channel firmware extracted, then i use motoflash2sh to generate a bashscript from the flashfile. I then replace gpt .bin and remove it from the md5 checks at the beginning of the script. run the script and im repartitioned!
00p513 said:
yeah i use channel firmware extracted, then i use motoflash2sh to generate a bashscript from the flashfile. I then replace gpt .bin and remove it from the md5 checks at the beginning of the script. run the script and im repartitioned!
Click to expand...
Click to collapse
That's awesome! I'll try working with this.
Spaceminer said:
That's awesome! I'll try working with this.
Click to expand...
Click to collapse
ill send a repartition kit later. just unzip and run the script
00p513 said:
ill send a repartition kit later. just unzip and run the script
Click to expand...
Click to collapse
I already found it. So I'd just remove 61863ba7dac0c512d610ffa6406a50f8 and it'll flash correct?
Code:
md5sum --check <<EOF || exit 1
[B]61863ba7dac0c512d610ffa6406a50f8[/B] *gpt.bin
Spaceminer said:
I already found it. So I'd just remove 61863ba7dac0c512d610ffa6406a50f8 and it'll flash correct?
Code:
md5sum --check <<EOF || exit 1
[B]61863ba7dac0c512d610ffa6406a50f8[/B] *gpt.bin
Click to expand...
Click to collapse
that whole line needs deleting. That is just to stop it failing on md5 verification ,as it is a dfiferent file
Spaceminer said:
I already found it. So I'd just remove 61863ba7dac0c512d610ffa6406a50f8 and it'll flash correct?
Code:
md5sum --check <<EOF || exit 1
[B]61863ba7dac0c512d610ffa6406a50f8[/B] *gpt.bin
Click to expand...
Click to collapse
Did it work? Any update on the vendor image?
00p513 said:
Did it work? Any update on the vendor image?
Click to expand...
Click to collapse
I haven't tried it yet. I got side tracked compiling twrp. I'm 3 errors away from success. Something about unknown compiler flags.
As an FYI, I'm out of a computer for the next several months, possibly up to a year. I'm going through a nasty divorce at the moment, and that's all I'm going to say about that. I'll get back into the game as soon as I can, but for now, you should not expect me to put out anything new for quite awhile. I can and will help people as much as possible during this time. But my ability to do so is going to be hindered without an PC.
I'm sorry to hear that. My divorce lasts since two years.
However, that's not why I registered. I received a Moto G7 Play for app security testing just a few days ago and found this forum when trying to install GSI to the phone. Everything works fine, but I'm interested to upgrade the OS to 64bit. Therefore, I'd like to try out the work already present in this thread. Unfortunately, I have neither found the repartition kit nor gained enough information about gpt.bin file format yet in order to repartition the flash memory of the G7 Play.
I'd really appreciate if anybody could either post or send me the repartition kit or supply information about the partition table format, because I failed to google for that kind of information.
[edit] Ok, I found out how to change partition size to the size of ocean. I flashed the following images:
* Partition table from ocean
* Everything else except system_a from channel
* system_a from phh (binder64)
Everything worked just fine.
Then I proceeded to flash the files posted in this thread earlier. The vendor64.img fits into the new partition layout just fine. After flashing all 4 files, I proceeded to flash phh 64bit version. Then I rebooted, but the boot failed:
First, the device showed up some very long hexadecimal number (maybe some UUID?) on a black screen, where it had shown "bad key" before when everything went right.
Afterwards, it ran into fastboot:
Start Up Failed:
Your device didn't start up successfully.
Use Software Repair Assistant on computer to repair your device.
Connect your device to your computer to get the Software Repair Assistant.
AP Fastboot Flash Mode (Secure)
Failed to verify hab image boot_a
Error: failed to load kernel!
No bootable A/B slot
Failed to boot Linux,falling back to fastboot
Fastboot Reason: Fall-through from normal boot mode
Click to expand...
Click to collapse
So, I'm back on binder64 again.
Please, could you provide any help for fixing the images, or at least the information how you have built the 64bit images?

[Discussion] Treble on V20 (Its possible with some help)

Ok so heres the full story (It's short):
So my V20 bricked itself for no reason (I was on stock for a few days unrooted no unlock nothing)
and while going through xda I stumbled upon this:https://forum.xda-developers.com/on...eble-lineageos-15-1-treble-oneplus-3-t3830455
Treble on the oneplus 3 and 3t. Why this one you might ask
well it is because our V20 and the Oneplus are similar.
So here is what somebody who is willing to help with a h990ds or H990 (It wont brick your device don't worry)needs to do:
1.First install this modded twrp here is the Link (Made from Pheonix591's twrp): https://drive.google.com/file/d/1pBrjWnKqRFFsQ-By_ElE3pW3LbWsg9sx/view?usp=sharing
2. Boot into the TWRP and go to advanced options then select terminal
Now type Treble and wait for a few seconds (This command is taken from the trebel port for oneplus 3 @simonsh)
Next reboot to whatever rom you are using(If it doesn't boot or bootloops something went wrong retry from step 2)
After it boots successfully go back to twrp and check in wipe and advanced wipe for Vendor
Now here is the problem the partition is only about 100 megabytes which we cant really use for treble it is too small.
So I am pinging a person who might be able to help us :
@runningnak3d I need your help in making the partition larger as it is again only about 100megabytes
Edit: So Runningnak3d has stopped developing for the V20 :crying: and I had just remembered that @x86cpu might be able to help so pinging him, we want as much people as possible.
Uhh so seems like my wifi is not properly working I will upload the twrp
Mysteriouslog6 said:
Ok so heres the full story (It's short):
So my V20 bricked itself for no reason (I was on stock for a few days unrooted no unlock nothing)
and while going through xda I stumbled upon this:https://forum.xda-developers.com/on...eble-lineageos-15-1-treble-oneplus-3-t3830455
Treble on the oneplus 3 and 3t. Why this one you might ask
well it is because our V20 and the Oneplus are similar.
So here is what somebody who is willing to help with a h990ds or H990 (It wont brick your device don't worry)needs to do:
1.First install this modded twrp here is the Link (Made from Pheonix591's twrp):
2. Boot into the TWRP and go to advanced options then select terminal
Now type Treble and wait for a few seconds (This command is taken from the trebel port for oneplus 3 @simonsh)
Next reboot to whatever rom you are using(If it doesn't boot or bootloops something went wrong retry from step 2)
After it boots successfully go back to twrp and check in wipe and advanced wipe for Vendor
Now here is the problem the partition is only about 100 megabytes which we cant really use for treble it is too small.
So I am pinging a person who might be able to help us :
@runningnak3d I need your help in making the partition larger as it is again only about 100megabytes
Click to expand...
Click to collapse
Running naked moved on and stopped developing for the V20 a long time ago.
Sent from my LG-H910 using XDA Labs
cnjax said:
Running naked moved on and stopped developing for the V20 a long time ago.
Sent from my LG-H910 using XDA Labs
Click to expand...
Click to collapse
That's really sad I was hoping someone can help me with the partition problem, what about @x86cpu ?
Mysteriouslog6 said:
Ok so heres the full story (It's short):
So my V20 bricked itself for no reason (I was on stock for a few days unrooted no unlock nothing)
and while going through xda I stumbled upon this:https://forum.xda-developers.com/on...eble-lineageos-15-1-treble-oneplus-3-t3830455
Treble on the oneplus 3 and 3t. Why this one you might ask
well it is because our V20 and the Oneplus are similar.
So here is what somebody who is willing to help with a h990ds or H990 (It wont brick your device don't worry)needs to do:
1.First install this modded twrp here is the Link (Made from Pheonix591's twrp): https://drive.google.com/file/d/1pBrjWnKqRFFsQ-By_ElE3pW3LbWsg9sx/view?usp=sharing
2. Boot into the TWRP and go to advanced options then select terminal
Now type Treble and wait for a few seconds (This command is taken from the trebel port for oneplus 3 @simonsh)
Next reboot to whatever rom you are using(If it doesn't boot or bootloops something went wrong retry from step 2)
After it boots successfully go back to twrp and check in wipe and advanced wipe for Vendor
Now here is the problem the partition is only about 100 megabytes which we cant really use for treble it is too small.
So I am pinging a person who might be able to help us :
@runningnak3d I need your help in making the partition larger as it is again only about 100megabytes
Edit: So Runningnak3d has stopped developing for the V20 :crying: and I had just remembered that @x86cpu might be able to help so pinging him, we want as much people as possible.
Click to expand...
Click to collapse
Mind if I help I recently acquired a vs995 for cheap so for know at least im back. I experimented with trebe on the g5 and was able to build a treblized los 15.1 but the problem was no gsi would boot here's what I used to build it.
https://review.lineageos.org/c/LineageOS/android_device_lge_h850/+/222974
https://review.lineageos.org/c/LineageOS/android_device_lge_msm8996-common/+/221553
https://review.lineageos.org/c/LineageOS/android_kernel_lge_msm8996/+/222018
I then added this to BoardConfigCommon.mk:
# Treble
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
BOARD_VNDK_RUNTIME_DISABLE := true
BOARD_VNDK_VERSION := current
PRODUCT_FULL_TREBLE_OVERRIDE := true
I would also like to mention that a few years ago @King_lilrowrow said he was working on/achieved treble on the G5 I'd contact him as well for help.
What is 'treble' / 'treblizing'... Curious what it does.
kaluna00 said:
What is 'treble' / 'treblizing'... Curious what it does.
Click to expand...
Click to collapse
The command does this (From @simonsh thread)
Code:
/sbin/sgdisk --typecode=5:8300 /dev/block/sdf
/sbin/sgdisk --change-name=5:vendor /dev/block/sdf
It basically makes the sdf block the vendor partition (Works as nothing has interfered with the working of the phone so the partition is unused but it is too small need help with that)
kaluna00 said:
What is 'treble' / 'treblizing'... Curious what it does.
Click to expand...
Click to collapse
So treble aka project treble is something google implemented with android 8 that splits system/vendor to / system and /vendor basically it gives vendor files which are device-specific code and drivers used to interact with the phone's hardware there own separate partition. Now since /system without vendor is mostly free of device-specific code it means that the phones os can be upgraded with messing with building and modifying the device-specific code, this is were GSIs (generic system images) come in, flashing a gsi essentially means we can modify and upgrade our OS like a custom rom but instead of spending hours working on a custom rom we can just build a system image which is very fast and easy and it can do just as much as a custom rom as far as enhancing the user experience goes.
That's the best I can explain it here is an article explaining it more and as far as trebilizing goes it's just a term used when someone gets treble working on an old device that doesn't support it from the factory.
ROMSG said:
Mind if I help I recently acquired a vs995 for cheap so for know at least im back. I experimented with trebe on the g5 and was able to build a treblized los 15.1 but the problem was no gsi would boot here's what I used to build it.
https://review.lineageos.org/c/LineageOS/android_device_lge_h850/+/222974
https://review.lineageos.org/c/LineageOS/android_device_lge_msm8996-common/+/221553
https://review.lineageos.org/c/LineageOS/android_kernel_lge_msm8996/+/222018
I then added this to BoardConfigCommon.mk:
# Treble
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
BOARD_VNDK_RUNTIME_DISABLE := true
BOARD_VNDK_VERSION := current
PRODUCT_FULL_TREBLE_OVERRIDE := true
I would also like to mention that a few years ago @King_lilrowrow said he was working on/achieved treble on the G5 I'd contact him as well for help.
Click to expand...
Click to collapse
Thanks for wanting to help I will send a link for the vs995 with a custom twrp. Also isn't the BoardConfigCommon.MK in the source for lineage os I will try building it with the modifications
Mysteriouslog6 said:
Thanks for wanting to help I will send a link for the vs995 with a custom twrp. Also isn't the BoardConfigCommon.MK in the source for lineage os I will try building it with the modifications
Click to expand...
Click to collapse
Thanks, BoardConfigCommon.mk is a device tree file and specific to any rom. Here this Commit outlines one of the issues @x86cpu had with getting treble working.
@ROMSG
Thanks a bunch for the explanation. I appreciate you breaking it down I like that. I'll do some homework and check out that link after work. Take care!
Mysteriouslog6 said:
Thanks for wanting to help I will send a link for the vs995 with a custom twrp. Also isn't the BoardConfigCommon.MK in the source for lineage os I will try building it with the modifications
Click to expand...
Click to collapse
Any update on the vs995 custom twrp?
ROMSG said:
Any update on the vs995 custom twrp?
Click to expand...
Click to collapse
Sorry for the late reply I will send it tomorrow itself (Will have to somehow see if the TWRP boots or not)
Heres the link:
twrp-treble-vs995.img
drive.google.com
ROMSG said:
Any update on the vs995 custom twrp?
Click to expand...
Click to collapse
I have sent the TWRP just check the latest post
Mysteriouslog6 said:
I have sent the TWRP just check the latest post
Click to expand...
Click to collapse
Just saw it thanks
Mysteriouslog6 said:
Ok so heres the full story (It's short):
So my V20 bricked itself for no reason (I was on stock for a few days unrooted no unlock nothing)
and while going through xda I stumbled upon this:https://forum.xda-developers.com/on...eble-lineageos-15-1-treble-oneplus-3-t3830455
Treble on the oneplus 3 and 3t. Why this one you might ask
well it is because our V20 and the Oneplus are similar.
So here is what somebody who is willing to help with a h990ds or H990 (It wont brick your device don't worry)needs to do:
1.First install this modded twrp here is the Link (Made from Pheonix591's twrp): https://drive.google.com/file/d/1pBrjWnKqRFFsQ-By_ElE3pW3LbWsg9sx/view?usp=sharing
2. Boot into the TWRP and go to advanced options then select terminal
Now type Treble and wait for a few seconds (This command is taken from the trebel port for oneplus 3 @simonsh)
Next reboot to whatever rom you are using(If it doesn't boot or bootloops something went wrong retry from step 2)
After it boots successfully go back to twrp and check in wipe and advanced wipe for Vendor
Now here is the problem the partition is only about 100 megabytes which we cant really use for treble it is too small.
So I am pinging a person who might be able to help us :
@runningnak3d I need your help in making the partition larger as it is again only about 100megabytes
Edit: So Runningnak3d has stopped developing for the V20 :crying: and I had just remembered that @x86cpu might be able to help so pinging him, we want as much people as possible.
Click to expand...
Click to collapse
Hello, since Android 12 beta has released recently, i get to know that we can use the GSI image to update “any” (in terms of project treble supported) device to a newer android version without the need of building the rom per device.
So that i started to explore on a few xda threads trying to get Treble on LG V20. After digging into it, i updated my TWRP to the latest image (official TWRP 3.5.2_9 H990 which is the Official TWRP build commit based on Pheonix591's twrp build), then i saw that the /vendor shows up on mount, but not on either Wipe or Backup, which Phoenix591’s reddit post stated that this means there’s no vendor partition on it.
I followed this thread, since my TWRP is not modded (as the link in your comment does not work) I typed two sgdisk commands which the Treble command does, after a reboot, i saw a Vendor partition in Backup showed 0mb, Vendor partition DOES NOT appears on Wipe.
Next, as what i saw from @x86cpu ’s comment, he said he repartitioned and created the /vendor partition of 512mb by resizing the /system partition, unfortunately i am new to partitioning the Android device, i haven’t figured out how i can do that.
I tried to do sgdisk —print /dev/block/mmcblk0, it showed a single 64gb MBR FAT32 Partition instead of showing the system partition, it seems to be showing the micro sd card instead of the system volume, so i tried to unplug the sd card and reboot, now /dev/block/mmcblk0 is not found. I also tried to list info of /dev/block/sdf which we have wrote the partition name “vendor” to the 5th parnum of /sdf, it shows that the partition is only 4kb.
Since i have a H990N (Hong Kong version of the H990) i used the Dirty Santa patch to get TWRP installed on the device, that means the device’s bootloader is NOT fully unlocked, so the device might have difference between official unlocked device like the VS995.
Is there anything i could try ?
kwankiu said:
Hello, since Android 12 beta has released recently, i get to know that we can use the GSI image to update “any” (in terms of project treble supported) device to a newer android version without the need of building the rom per device.
So that i started to explore on a few xda threads trying to get Treble on LG V20. After digging into it, i updated my TWRP to the latest image (official TWRP 3.5.2_9 H990 which is the Official TWRP build commit based on Pheonix591's twrp build), then i saw that the /vendor shows up on mount, but not on either Wipe or Backup, which Phoenix591’s reddit post stated that this means there’s no vendor partition on it.
I followed this thread, since my TWRP is not modded (as the link in your comment does not work) I typed two sgdisk commands which the Treble command does, after a reboot, i saw a Vendor partition in Backup showed 0mb, Vendor partition DOES NOT appears on Wipe.
Next, as what i saw from @x86cpu ’s comment, he said he repartitioned and created the /vendor partition of 512mb by resizing the /system partition, unfortunately i am new to partitioning the Android device, i haven’t figured out how i can do that.
I tried to do sgdisk —print /dev/block/mmcblk0, it showed a single 64gb MBR FAT32 Partition instead of showing the system partition, it seems to be showing the micro sd card instead of the system volume, so i tried to unplug the sd card and reboot, now /dev/block/mmcblk0 is not found. I also tried to list info of /dev/block/sdf which we have wrote the partition name “vendor” to the 5th parnum of /sdf, it shows that the partition is only 4kb.
Since i have a H990N (Hong Kong version of the H990) i used the Dirty Santa patch to get TWRP installed on the device, that means the device’s bootloader is NOT fully unlocked, so the device might have difference between official unlocked device like the VS995.
Is there anything i could try ?
Click to expand...
Click to collapse
So in regards to partitioning you have to build a ROM with that partiton table in place for it too work and I have gotten treble to work (this was on myt h830) however no gsi will boot. I had to use this tool to add vender in order to flash my treble rom. I used the 800MB option in order for vender to show up.
Here are some 15.1 device tress I made for tbe VS995. I used the changes from x86cpu
GitHub - ROMSG/Treble-android_device_lge_msm8996-common
Contribute to ROMSG/Treble-android_device_lge_msm8996-common development by creating an account on GitHub.
github.com
GitHub - ROMSG/android_device_lge_vs995
Contribute to ROMSG/android_device_lge_vs995 development by creating an account on GitHub.
github.com
GitHub - ROMSG/Treble_android_device_lge_v20-common
Contribute to ROMSG/Treble_android_device_lge_v20-common development by creating an account on GitHub.
github.com
ROMSG said:
So in regards to partitioning you have to build a ROM with that partiton table in place for it too work and I have gotten treble to work (this was on myt h830) however no gsi will boot. I had to use this tool to add vender in order to flash my treble rom. I used the 800MB option in order for vender to show up.
Here are some 15.1 device tress I made for tbe VS995. I used the changes from x86cpu
GitHub - ROMSG/Treble-android_device_lge_msm8996-common
Contribute to ROMSG/Treble-android_device_lge_msm8996-common development by creating an account on GitHub.
github.com
GitHub - ROMSG/android_device_lge_vs995
Contribute to ROMSG/android_device_lge_vs995 development by creating an account on GitHub.
github.com
GitHub - ROMSG/Treble_android_device_lge_v20-common
Contribute to ROMSG/Treble_android_device_lge_v20-common development by creating an account on GitHub.
github.com
Click to expand...
Click to collapse
Thanks for your reply ! I used the tool in your comment, at first i tried take use /system space to resize a 512mb /vendor partition unfortunately this makes the /system partition only at 5gb which result in Error:7 while flashing new ROMs, so i removed the partition and did it again by adding a 512mb /vendor using space AFTER /data, i checked the partition by fdisk -l /dev/block/sda the /vendor partition is created successfully with 512gb partition size, but no “/vendor” Partition was shown on the Wipe page of TWRP (while the partition was shown in Backup and Mount), not sure whether this affect us on going Treble or not, but wiping /vendor should be possible via terminal commands.
ROMSG said:
So in regards to partitioning you have to build a ROM with that partiton table in place for it too work and I have gotten treble to work (this was on myt h830) however no gsi will boot. I had to use this tool to add vender in order to flash my treble rom. I used the 800MB option in order for vender to show up.
Here are some 15.1 device tress I made for tbe VS995. I used the changes from x86cpu
GitHub - ROMSG/Treble-android_device_lge_msm8996-common
Contribute to ROMSG/Treble-android_device_lge_msm8996-common development by creating an account on GitHub.
github.com
GitHub - ROMSG/android_device_lge_vs995
Contribute to ROMSG/android_device_lge_vs995 development by creating an account on GitHub.
github.com
GitHub - ROMSG/Treble_android_device_lge_v20-common
Contribute to ROMSG/Treble_android_device_lge_v20-common development by creating an account on GitHub.
github.com
Click to expand...
Click to collapse
One more thing, I actually misunderstood the partition yesterday that i said it was 0mb, in fact, the backup page shows 0mb is a normal behaviour as the vendor partition is empty, i didnt check how big is the partition size, but I believe it should be 100mb after running the command “Treble”. Anyways, thanks for pointing out the tools which makes it 512mb now !

Lenovo Zuk Z2 plus Android 12 gsi bootloop

I flash android 12 beta Google gsi from the link below, I flashed it with twrp and I am facing bootloop in my z2 plus, any solution??
Generic System Image releases | Android Developers
Generic System Image releases | Platform | Android Developers
developer.android.com
I flashed the arm64
Exactly same problem here. If you find a solution please please please give a message on [email protected]
I am busy in fixing my sim card not working
If you flash a GSI image ( read: Vanilla ROM - AOSP ) then Android's OEM-created /vendor & /modem partitions gets lost. Probably /esf partition, too.
Hence you must not be surprised that phone is bootlooping
jwoegerbauer said:
If you flash a GSI image ( read: Vanilla ROM - AOSP ) then Android's OEM-created /vendor & /modem partitions gets lost. Probably /esf partition, too.
Hence you must not be surprised that phone is bootloop
Click to expand...
Click to collapse
jwoegerbauer said:
If you flash a GSI image ( read: Vanilla ROM - AOSP ) then Android's OEM-created /vendor & /modem partitions gets lost. Probably /esf partition, too.
Hence you must not be surprised that phone is bootlooping
Click to expand...
Click to collapse
This shouldn't be the case because earlier I have formatted my device using so flash tool. Each and every system partition got lost including efs(nvdata and nvram in my case). I actually found another reason: Kernel is 32 bit which doesn't support 64 bit gsi. I tried finding a 64 bit firmware for my device but there's none.

[PX5][Android 10] Patched recovery

This is the Android 10 recovery image by HCT (version 10.3.1) patched to skip signature checking on .zip files
Tested on MTCE_LM (Eunavi). Use at your own risk
It can be flashed from a root shell (either adb or via terminal emulator) by performing the following steps
1. upload recovery via adb
Code:
adb push hct_recovery_patched.img /sdcard/
2. flash recovery
Code:
# backup current recovery
dd if=/dev/block/by-name/recovery of=/sdcard/recovery_backup.img
# write new recovery
dd if=/sdcard/hct_recovery_patched.img of=/dev/block/by-name/recovery
NOTE: If you do not disable the "flash_recovery" service in /init.rc, AND you have a stock kernel, recovery will be restored to the original version after rebooting.
There are 3 ways to avoid this:
- Flash magisk (or a modified kernel) while in recovery. The patch will then fail to apply and recovery won't be overwritten
- Disable "flash_recovery" by doing "adb remount" and editing /init.rc (comment out the following)
Code:
service flash_recovery /system/bin/install-recovery.sh
class main
oneshot
- Neuter the service by either:
- removing /system/bin/install-recovery.sh​- replacing /system/bin/install-recovery.sh with a dummy script​- removing /system/recovery-from-boot.p​
Woo-hoo, after hundreds of rubbish posts in the MTCD forums, we have a real development post!
Great work and thanks for sharing this, these forums need more like you.
Thanks for the kind comment!
I have to admit that it was frustrating to see the lack of information sharing on this forum, and the pervasive pay-per-use model.
I spent a lot of time just getting Android 10 installed (starting from Android 9), and i had to bring the head unit to my desk as working in the car was rather hard and all i achieved was a brick.
I unfortunately had to bring it back in the car now (can't sit on my desk forever) but, now that i figured out how to make bootable recoveries, i was wondering how hard it could be to have TWRP or at least a hassle-free recovery to install Android 10 from Android 9.
As a first step, this recovery makes it possible to install Magisk or other zip files without doing it manually within adb.
Cheers!
Your work is really good!
Thanks a lot for it.
Now you can also modify ROM's without signatur errors when installing.
Wouldn't it be good if we had an app like the ModInstaller ?
So a one click installation of the recovery without shell or adb.
I have now built an app.
And now need help.
Namely, in the app is the recovery and the script.
Unfortunately, the flash process is not started.
It always comes only the first message from the script.
The app is open source and the script and the recovery are in res/raw.
In the attach you will find the finished app and pictures.
If someone has a solution, he can write me or make a pull request on Github.
Source code:
GitHub - jamal2362/RK33XX-Custom-Recovery-Installer: Application for flashing custom recovery on Rockchip Android Head-Units.
Application for flashing custom recovery on Rockchip Android Head-Units. - GitHub - jamal2362/RK33XX-Custom-Recovery-Installer: Application for flashing custom recovery on Rockchip Android Head-Units.
github.com
The script:
RK33XX-Custom-Recovery-Installer/script at master · jamal2362/RK33XX-Custom-Recovery-Installer
Application for flashing custom recovery on Rockchip Android Head-Units. - RK33XX-Custom-Recovery-Installer/script at master · jamal2362/RK33XX-Custom-Recovery-Installer
github.com
First of all, congrats for the work!
DISCLAIMER:
I don't own ModInstaller, i have never bought a copy of it and i don't intend to do so.
Analysis is purely done from Youtube videos, open source code analysis and existing and openly available binary images.
I was working to figure out how to make a FLOSS alternative to ModInstaller.
The issues i found in all my attempts are the following:
- A6 recovery is the only one that can boot from SD Card (which can then be used to flash A9 -> A10 with the 2SD trick)
- (it took me a long time to pull these information together and unbrick my unit)​- The A6 recovery is unable to directly flash A10 RKAF/RKFW images (sdupdate.img) due to the code being too old
- a failure will be observed while writing super.img. This happens because the device needs to be repartitioned, and the A6 recovery is not doing it correctly​- A9 recovery is buggy. Booting it with no system installed will result in a black screen.
- it will only boot succesfully after being written by the A6 flash tool, which writes the "misc" partition with the recovery commands to run (the "hint" i get from this is that the misc partition is important)​- A10 recovery can't be loaded by the A6 recovery. I always got a black screen after flash. Is it a flash issue? is it an issue with the recovery itself? hard to know
Theory: maybe the recovery could be written over the kernel partition? ("boot")
This way, the recovery will always run after being flashed instead of requiring an explicit "enter recovery" trigger (buttons, misc partition, etc.)
Besides these experiments, in parallel, i did some bug fixing to this repository: https://github.com/liftoff-sr/rockchip-tool/commits/master (i'm "smx-smx")
That allows me to unpack nad repack "sdupdate.img" , "reduced recovery images" and "full IMG files".
With those tools. i tried to swap "recovery.img" in the A6 image, but i always got the black screen upon booting from SD.
Either A9/A10 breaks sdboot or the bootloader crashes before it gets there.
Since this also happens when being flashed, this could either be a bug in the flashing program or a bug in the boot stack (which fails to run recovery perhaps due to a dirty state of the internal flash). It's hard to know for sure without having a UART connection with the board.
BUT, we have an alternative, in the form of the recovery built-in ISP flash tool.
This is the code that reads "sdupdate.img" from the SD Card and flashes it
After reading the recovery source code, i realised that this code can only be triggered correctly when booting from the SD card.
It detects this state by reading /proc/cmdline and probing for specific values (https://github.com/rockchip-android...6f72b7d3123dab27135ac41d55029/sdboot.cpp#L206)
This means the bootloader can (and will) pass those arguments under specific conditions (https://github.com/rockchip-linux/u...c873f178c/arch/arm/mach-rockchip/board.c#L358)
If you check here https://github.com/rockchip-linux/u...3f178c/arch/arm/mach-rockchip/boot_mode.c#L47 you can see the magic word that needs to be written to the "misc" partition in order to trigger that code.
Note that, besides the well known "sdboot", "usbboot" is also possible.
I'm not sure if the ROM can physically boot from USB, but the bootloader and recovery do support (according to code) passing the flag to enable flashing from USB.
So, recapping, there are these ways we can try:
a - try to overwrite "boot" with "recovery" (but it might not work due to the partitioning layout, e.g. jumping from A6 -> A10)
- note: uboot might also need to be written when doing this.
b - making a modified "sdupdate.img" that flashes recovery on top of boot, and all the other core partitions like "misc", "uboot", "trust", "vbmeta"
c - writing "misc" from android in order to triggers the "rkfwupdate" mode
d - taking a dump of the first portion of the flash in various states (A6, A8, A9, A10), and having a "dd" that writes it back to the beginning of the flash (i suspect this is how ModInstaller does it)
Considering cases "b" and "c" depend on a recovery that can write them correctly (and the A6 one is buggy), this leaves us with "a" and "d"
Considering that ModInstaller does it in one shot, and doesn't seem to matter about the partitioning layout, i believe "d" might be the most viable option...
Using the "rockchip-tool" repository i linked from github, the partition table can be dumped from any .img file
You can observe "Image/parameter.txt" from the extracted firmware
This is the partition table from A6's recovery:
[email protected](uboot)
[email protected](trust)
[email protected](misc)
[email protected](resource)
[email protected](kernel)
[email protected](dtb)
[email protected](dtbo)
[email protected](vbmeta)
[email protected](boot)
[email protected](recovery)
[email protected](backup)
[email protected](security)
[email protected](cache)
[email protected](system)
[email protected](metadata)
[email protected](vendor)
[email protected](oem)
[email protected](frp)
[email protected](userdata)
And this is the partition table from A9's recovery
[email protected](uboot)
[email protected](trust)
[email protected](misc)
[email protected](resource)
[email protected](kernel)
[email protected](dtb)
[email protected](dtbo)
[email protected](vbmeta)
[email protected](boot)
[email protected](recovery)
[email protected](backup)
[email protected](security)
[email protected](cache)
[email protected](system)
[email protected](metadata)
[email protected](vendor)
[email protected](oem)
[email protected](frp)
[email protected](userdata)
Notice how uboot, trust, misc, resource, kernel, dtb, and others live in the same space. (2000, 4000, 6000, 8000, 10000, ...)
What we could do is create a raw blob that spans that address range, and "dd" it directly to /dev/mmcblk0 at the right offset.
So i would focus on converting recovery images to raw blobs, with recovery-as-kernel so it boots straight away on the first try.
Bump a real thread.
Is it possible to convert it to a file installed by SDDiskTool?
marchnz said:
Bump a real thread.
Click to expand...
Click to collapse
I created a flashing tool to flash recovery within Android, using Rockchip's own code: https://forum.xda-developers.com/t/...chip-firmware-flash-tool-for-android.4458299/
blala said:
I created a flashing tool to flash recovery within Android, using Rockchip's own code: https://forum.xda-developers.com/t/...chip-firmware-flash-tool-for-android.4458299/
Click to expand...
Click to collapse
This file hct_recovery.patched.img does not appear to be installed via rkupdate
sadaghiani said:
Is it possible to convert it to a file installed by SDDiskTool?
Click to expand...
Click to collapse
It needs to be converted, yes
I'll take a look this afternoon
blala said:
It needs to be converted, yes
I'll take a look this afternoon
Click to expand...
Click to collapse
Is it possible to create a boot image that includes moded recovery & magisk and moded kernel ?
If by image you mean firmware image then yes, it can be done with https://github.com/liftoff-sr/rockchip-tool
But what i would recommend is the modded recovery only, with the magisk .zip to use in Recovery
Otherwise you risk flashing a kernel that doesn't match with kernel modules or is otherwise not fully compatible with the installed system
blala said:
If by image you mean firmware image then yes, it can be done with https://github.com/liftoff-sr/rockchip-tool
But what i would recommend is the modded recovery only, with the magisk .zip to use in Recovery
Otherwise you risk flashing a kernel that doesn't match with kernel modules or is otherwise not fully compatible with the installed system
Click to expand...
Click to collapse
boot.img file included recovery+magisk+kernel
Flashing a boot.img (Kernel, for example) in an Android mobile phone via adb shell
Flashing a boot.img (Kernel, for example) in an Android mobile phone via adb shell - script.sh
gist.github.com
MTCD has separate boot and recovery partitions.
Perhaps you can adapt both recovery/kernel to be in the same image but the bootloader won't know about that (and will always boot from "recovery" partition)

Categories

Resources