[DEV]Merge boot.img and recovery.img in one image bootReco.img - Android Software/Hacking General [Developers Only]

The idea is to have only one partition that contains the boot and the recovery at the same times!
Why ?
I a previous thread, I have an issue with the touch panel when I boot into recovery : the kernel detect the recovery mode and disable the touch, not good at all for TWRP
If we merge the boot and recovery images in the same image (say bootReco.img) and flash the result merged image in the boot partition (fastboot flash boot bootReco.img), the kernel detect that we are in the boot partition and will not disable the touch.
The boot.img and recovery.img uses the same kernel (duplicated in each partition), only the ramdisk is different for each partition.
So the only things to merge are the 2 ramdisks.
In the boot, we have only to add a menu that ask for normal boot (default behavior) or the recovery (inside the same boot partition)
Any idea please ?

dreambo said:
The idea is to have only one partition that contains the boot and the recovery at the same times!
Why ?
I a previous thread, I have an issue with the touch panel when I boot into recovery : the kernel detect the recovery mode and disable the touch, not good at all for TWRP
If we merge the boot and recovery images in the same image (say bootReco.img) and flash the result merged image in the boot partition (fastboot flash boot bootReco.img), the kernel detect that we are in the boot partition and will not disable the touch.
The boot.img and recovery.img uses the same kernel (duplicated in each partition), only the ramdisk is different for each partition.
So the only things to merge are the 2 ramdisks.
In the boot, we have only to add a menu that ask for normal boot (default behavior) or the recovery (inside the same boot partition)
Any idea please ?
Click to expand...
Click to collapse
Why not just build a kernel that does not do the unwanted behavior and flash that? Seems like it would be much easier to me.

wildermjs8 said:
Why not just build a kernel that does not do the unwanted behavior and flash that? Seems like it would be much easier to me.
Click to expand...
Click to collapse
You are right, but I do not have the kernel sources, the vendor of the phone MAZE Alpha does not provide that.
Can any one help me to have the kernel sources ?
The SOC is MT6757D by Mediatek, who must provide this sources, Mediatek or MAZE ?

Related

miminal boot image

I would like to pass a minimal boot image (something like ttylinux-arm) to fastboot. As I understand it, fastboot does not require the image be signed. If that is correct, is there any other fundamental obstacle to doing this other than building the image in a way that fastboot can deal with it.
I don't need the radio or buttons to work.
Also, from reading through the limited documentation that I've been able to find, it looks like 'fastboot boot' will boot an image from flash media and load it into memory without any ROM overwite - correct? I'd want to avoid touching the existing filesystem.
correct fastboot boot will load a kernel and intramfs packed into boot.img or recovery.img into ram and boot from it. Upon reboot you will boot from kernel on nand or whatever native filesystem your device has. Fastboot boot is for testing kernels without having to flash them to nand.

[RECOVERY][enchilada] Unofficial TWRP 3.2.1-3 for OnePlus 6 by wuxianlin

Entire credit goes to @wuxianlin; I've just mirrored and organised stuffs.
Downloads:
Baidu
AFH mirror
Fixed variant by @joemossjr & @charlieb620
Sources:
https://github.com/wuxianlin/android_device_oneplus_enchilada
http://wuxianlin.com/
Screenshots:
https://m.weibo.cn/status/4243215098108813
Instructions:
Download required files from Downloads section.
Unlock the bootloader.
Reboot to bootloader.
Boot into TWRP: fastboot boot recovery-xx.img
Change Partition slot using TWRP: [Reboot => Change_Slot]
(for example, if you're in slot A, change it to slot B and vice versa)
Flash twp-installer zip.
Flash Magisk (use latest) for root access (optional).
Success!
Reserved for future.
Sweet, will give it a shot! Thanks!
Sent from my [device_name] using XDA-Developers Legacy app
Nice
Can't you just do fasboot flash recovery nameofrecovery.img?
JazzieBoi said:
Can't you just do fasboot flash recovery nameofrecovery.img?
Click to expand...
Click to collapse
https://forum.xda-developers.com/showpost.php?p=76626087&postcount=127
Nice
Sent from my ONEPLUS A6000 using Tapatalk
akaHardison said:
Finally,TWRP is ready.
Sent from my ONEPLUS A6000 using Tapatalk
Click to expand...
Click to collapse
Finally? Dude the phone has been out like 3 days in the US and less than 2 weeks I believe anywhere else.
Get some patience maybe.
Is this still a temporary recovery or does this method make TWRP your permanent recovery?
Eric214 said:
Is this still a temporary recovery or does this method make TWRP your permanent recovery?
Click to expand...
Click to collapse
You need to flash TWRP-installer in TWRP, if you want permanent recovery.
Thaaank you very much!
Titokhan said:
Download required files from Downloads section.
Boot into TWRP: fastboot boot recovery-xx.img
Click to expand...
Click to collapse
Which files are required? There are a bunch of different files on that Baidu page.
Which image file should be booted to?
Displax said:
You need to flash TWRP-installer in TWRP, if you want permanent recovery.
Click to expand...
Click to collapse
where can I get twrp-installer from?
Displax said:
You need to flash TWRP-installer in TWRP, if you want permanent recovery.
Click to expand...
Click to collapse
so will making twrp permanent remove the a/b partition? that means i can't flash a/b compatible roms?
@nathanchance... I miss you
Enviado desde mi ONEPLUS A6003 mediante Tapatalk
There is really a lot of files in there. Which img should I boot into for the twrp?
There is a textfile in chinese (i assume) which I let go through google translate:
textfile
Maybe this will give some new information:
Code:
One plus six use ab partition, bring a lot of inconvenience to the brush, temporarily suggest less toss
One, unlock BootLoader (pay attention to backup data)
1. Developer Options Open OEM Unlock
2. Enter the fastboot mode: adb reboot bootloader
3. Unlock: fastboot oem unlock
The mobile phone prompts whether to unlock, the volume key selects Yes, the power button confirms
4 wait to boot
Second, brush into the specific boot
1. The disk boot folder has many types of boot
Introduction:
Official boot: the official original boot, recovery mode for the official recovery
Twrp boot: After brushing into recovery mode becomes twrp
Boot-with-magisk: automatically install migisk after brushing, recovery mode is official recovery, need to install magisk apk
Twrp boot-with-magisk: automatically install migisk after brushing, recovery mode is twrp, need to install magisk apk
name:
For example, boot-180513-h2os.img is based on the hydrogen OS 180513 version, be sure to match the use
Other files are similarly named
2. Brushing method
Enter the fastboot mode: adb reboot bootloader
Brush into the boot partition (boot.img is the path to the file being flushed into)
Fastboot flash boot boot.img
or
Fastboot flash boot_a boot.img
Fastboot flash boot_b boot.img
3. Restart
Fastboot reboot
Third, fastboot brush
Network disk fastboot flashable folder stored fastboot mode can be brushed into the img file
For example, you want to brush the system.img to the system partition (system.img is the path to the file you are working on)
Fastboot flash system system.img
or
Fastboot flash system_a system.img
Fastboot flash system_b system.img
For example, you want to brush the vendor.img to the vendor partition (vendor.img is the path to the file to be scanned)
Fastboot flash vendor vendor.img
or
Fastboot flash vendor_a vendor.img
Fastboot flash vendor_b vendor.img
Fourth, twrp card brush official ROM reserved twrp method
Twrp card brush official ROM brush common patch /twrp folder under the patch package
Note, twrp card brush official ROM, in fact, brush into the current partition does not start, after brushing is complete, activate the partition, restart after running this partition, but at this time twrp run in the current boot partition, need to restart the system into twrp Or restart the recovery mode into twrp, restart the boot partition and the partition started at this time is consistent, brush into the patch for the current boot partition has a role, otherwise the patch package is likely to be brushed into the next boot does not start Partition
Fifth, install magisk
If it is fastboot brush boot, directly brush into the boot with magisk
If it is twrp card brush official ROM, card brush twrp patch, restart twrp or restart boot into twrp, and then brush the patch under the commonly used patch / magisk folder
Six, install the supersu
Twrp card brush official ROM, card brush twrp patch, restart twrp or restart boot into twrp, and then brush the patch / supersu folder patch, even the computer input adb disable-verify, prompt Successfully disabled verity, restart
Seven, install xposed
If you have installed magisk, install xposed directly in magisk
If you have already brushed supersu according to the above method, add the official xposed patch and restart it.
Eight, third-party ROM
Temporarily unknown
Nine, expand the extension
Interested friends are expected to notice that you can choose to brush img into the _a or _b partition in the tutorial of brushing the img into the corresponding partition.
So how do we know if our phone is currently using a partition or b partition?
1.twrp mode, restart, there will be shown below
2. System mode, adb shell getprop ro.boot.slot_suffix
If _a is a partition, _b is partition b
AB Division, except for Google’s mobile phone, it is rare to see other mobile phones use,,,
So there are few methods related to playing online games,,,
Author:
Wuxianlin
Weibo: wuxianlin000000
You can't flash the recovery image... It boots up slowly into the OS, and that's it. Guess we will have to wait a little longer
The TWRP of OP6 looks like Google Pixel this time
Thanks!!!
But which version (file) do I need for Oxygen OS 5.1.5?
In each filename is someting with h2o-rom?

[RECOVERY] - TeamWin Recovery Project [REDFIN] [OFFICIAL]

[RECOVERY] TWRP 3.6.0_11-0 - TeamWin Recovery Project
Introduction:
Team Win Recovery Project or TWRP for short, is a custom recovery built with ease of use and customization in mind. We started from the ground up by taking AOSP recovery and loading it with the standard recovery options, then added a lot of our own features. It's a fully touch driven user interface , no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.
Key Features:
Touchscreen driven with real buttons and drag-to-scroll
XML-based GUI that allows full customization of the layout true theming!
Settings are saved to the sdcard and persist through reboots
Ability to choose which partitions to back up and which to restore
Ability to choose to compress backups now with pigz (multi-core processor support for faster compression times)
Onscreen keyboard
Easy selection of internal/external storage
In addition to the above new features, TWRP features a scripting engine that allows an app to send commands to the recovery for the recovery to perform during startup. We call this scripting engine OpenRecoveryScript. This engine will be put to use immediately in the GooManager app. GooManager will be able to install recoveries automatically for most supported devices. The app will also let you choose to install multiple zips from within Android, wipe, and run a backup.
We are looking for other talented developers, themers, and device maintainers if they are interested in helping with a free, open source project.
Source Code:
GitHub - https://github.com/TeamWin/android_bootable_recovery
Gerrit Instance - http://gerrit.twrp.me
If you have made your own TWRP build for an unsupported device, please let us know. We might add your build to the list of unofficial builds. Bear in mind that we are working hard to add more devices and we may add your device to our official build list later.
Device Config: https://github.com/bigbiff/android_device_google_redbull
GitHub - bigbiff/android_device_google_redfin
Contribute to bigbiff/android_device_google_redfin development by creating an account on GitHub.
github.com
If others thing don't work, please report the issue and let me know.
Download here:
Test9: https://build.twrp.me/test/redfin/twrp-3.5.0-0-test9-redfin.img
- fix cpu temperature display
- turn off openaes
- MTP: fix 100% CPU
- fix perms for last_log.gz
- one click flash option to keep twrp when updating boot in recovery - thanks @Nebrassy
You need to install a kernel with built-in touch drivers such as ElementX-P5.
First, install ElementX-P5, the use the install ramdisk recovery option in the Install menu to install the TWRP image.
https://build.twrp.me/test/redfin/twrp-3.5.0-0-test1-redfin.img
Please ignore the -10 in the version string when fastbooted into TWRP. I am hoping to get the a11 TWRP branch working in a10 trees.
Test 2: https://build.twrp.me/test/redfin/twrp-3.5.0-0-test2-redfin.img
Test 3: https://build.twrp.me/test/redfin/twrp-3.5.0-0-test3-redfin.img
Decryption and backup restore working. Tested with April Firmware.
Test 4: https://build.twrp.me/test/redfin/twrp-3.5.0-0-test4-redfin.img
Enable MTP. Fix /sdcard bind mount to /data/media/0
Test 5: https://build.twrp.me/test/redfin/twrp-3.5.0-0-test5-redfin.img
Add partitions: misc, boot and persist. Enable repacking into ramdisk. Tested with ElementX-P5.
Test 6: https://build.twrp.me/test/redfin/twrp-3.5.0-0-test6-redfin.img
Fix repacking twrp into recovery. You need to install a kernel with built-in touch drivers such as ElementX-P5.
First, install ElementX-P5, the use the install ramdisk recovery option in the Install menu to install the TWRP image.
Test 7: https://build.twrp.me/test/redfin/twrp-3.5.0-0-test7-redfin.img
Fix wiping Titan M chip. Fix decryption hanging on lineage-18.1 when booting TWRP.
Test 8: https://build.twrp.me/test/redfin/twrp-3.5.0-0-test8-redfin.img
Fix reboot to recovery from fastbootd.
http://twrp.me
Nice work!
Once the encryption element is fixed I will definitely be rocking this!!
Nice to see this, good job on working TWRP for this Device. Thank you.
Is there only the img build. No zip file? How to stay on twrp without zip?
This boots on a pixel 4a5g, but touch controls and adb do not seem to work. Do you think it would take a lot of code changes to enable it on the 4a 5g? The two phones share kernels for what it's worth.
Its possible to root android 12 with this?
Was able to boot to it on the pixel 5. Look forward to the progress! Thanks!
mistermojorizin said:
This boots on a pixel 4a5g, but touch controls and adb do not seem to work. Do you think it would take a lot of code changes to enable it on the 4a 5g? The two phones share kernels for what it's worth.
Click to expand...
Click to collapse
Can you provide me a copy of dmesg?
gogixx said:
Is there only the img build. No zip file? How to stay on twrp without zip?
Click to expand...
Click to collapse
This is a fastboot image only.
bigbiff said:
Can you provide me a copy of dmesg?
Click to expand...
Click to collapse
To get a dmesg, I need to use ADB (which doesn't work while booted into TWRP). So would this capture the info you'd need - boot into TWRP, reboot by holding power button, get a dmesg when it boots?
EDIT: so I'm trying to get it this way but the dmesg.txt comes out blank for some reason
mistermojorizin said:
To get a dmesg, I need to use ADB (which doesn't work while booted into TWRP). So would this capture the info you'd need - boot into TWRP, reboot by holding power button, get a dmesg when it boots?
EDIT: so I'm trying to get it this way but the dmesg.txt comes out blank for some reason
Click to expand...
Click to collapse
Unfortunately that would be from the android kernel. I didn't realize adb wasn't working for you. Are you using windows?
bigbiff said:
Unfortunately that would be from the android kernel. I didn't realize adb wasn't working for you. Are you using windows?
Click to expand...
Click to collapse
yes, windows 10, latest adb drivers. when it boots to TWRP it doesn't recognize that any adb devices are connected.
when booting to android though, I can access ADB without problems
bigbiff said:
This is a fastboot image only.
Click to expand...
Click to collapse
Thank you.
What's the proper installation process (how-to) to flash TWRP on the P5/redfin ?
unibombz said:
Thank you.
What's the proper installation process (how-to) to flash TWRP on the P5/redfin ?
Click to expand...
Click to collapse
There is no flashing of it. You would just boot in to it via fastboot boot *twrpimgfile.img
VivisClone said:
There is no flashing of it. You would just boot in to it via fastboot boot *twrpimgfile.img
Click to expand...
Click to collapse
Thank you for clarifying that it is not flashed to the recovery partition and only booted to when you need TWRP features via
Code:
fastboot boot twrp-3.5.0-0-test1-redfin.img
I was able to get touch working on the 4a5g using these commands:
fastboot flash boot twrp-3.5.0-0-test1-redfin.img
fastboot boot ProtonKernel-pixel5-v1.1.img
ADB Still didn't work. The log said couldn't mount storage. Under "mount" I could check every box except the last two (storage and external storage or sdcard I think).
the backup menu is very different looking than i'm used to. instead of being able to select which partitions to backup, there's only one option - "super (vendor, system, system ext...etc)" The only partition that's not listed there is the boot partition. Also, storage says 0mb . Not sure if it would have backed up anything.
Is it able to make backups on the Pixel 5? Can I get you any info (using the TWRP terminal or file manager mayber) to help development?
mistermojorizin said:
I was able to get touch working on the 4a5g using these commands:
fastboot flash boot twrp-3.5.0-0-test1-redfin.img
fastboot boot ProtonKernel-pixel5-v1.1.img
ADB Still didn't work. The log said couldn't mount storage. Under "mount" I could check every box except the last two (storage and external storage or sdcard I think).
the backup menu is very different looking than i'm used to. instead of being able to select which partitions to backup, there's only one option - "super (vendor, system, system ext...etc)" The only partition that's not listed there is the boot partition. Also, storage says 0mb . Not sure if it would have backed up anything.
Is it able to make backups on the Pixel 5? Can I get you any info (using the TWRP terminal or file manager mayber) to help development?
Click to expand...
Click to collapse
The super partition and other partitions you can backup as byte images. However most of these can be restored from the stock firmware. I am working on decryption right now. I am not sure what to do about adb unless you can pull logcat and dmesg for clues for the 4a5g.
Thanks for this TWRP image.
Side loading works.
TWRP does not read the internal storage... Any ideas?
vandyman said:
Thanks for this TWRP image.
Side loading works.
TWRP does not read the internal storage... Any ideas?
Click to expand...
Click to collapse
Yeah. Encryption in A11 is Wip like Op specified.
Is there the ability to resize system partition?

CrashDump mode after flashing blue_spark kernel r112

Hey folks,
I have rooted (magisk) OnePlus 8 phone with Android 11, w/o TWRP recovery. I'm trying to replace kernel with one of blue_spark, here's what I'm doing
1. Download zip file from https://github.com/engstk/op8/releases/tag/r112
2. Extract and unpack Image.gz
3. Unpack Magisk patched boot.img to /tmp (magiskboot unpack boot.img)
4. Replace kernel with unpacked Image (cp Image /tmp/kernel)
5. Repack boot.img (magiskboot repack boot.img boot-new.img)
6. Boot with boot-new.img (fastboot boot boot-new.img)
And here is when I'm getting into "QUALCOMM CrashDump Mode"
The same result if I build kernel from sources. Repacking boot.img with original kernel works, so problem is unlikely in magiskboot.
I'm trying to figure out the problem, but without kernel logs it's troublesome. Any ideas?
Thanks.
Hm... It looks like, I also have to update DTB. After that device boots successfully. Seems a bit strange to me. What's the difference in supported devices between blu_spark and stock kernel?
Ok, turned out AVB was enabled in the original device tree:
fsmgr_flags = "wait,slotselect,avb";
Switching it off fixes boot process.

[OC] Kernel OC to 1.8GHz

It was modified from latest stock kernel of WearOS 2.
Features:
[OC] Overclocked to 1.8Ghz
[Magisk] Magisk v23.0 pre-installed
How To Use :
Reboot to fastboot
You are supposed to try it first in order to make sure it is suitable to your system by using
Code:
fastboot boot boot.img
If your test is passed, you could input the command below to flash it
Code:
fastboot flash boot boot.img
Enjoy
Download Link: MEGA
Cannot get it to work on my W200, stuck on LG logo and heating up considerably
Xspeed said:
Cannot get it to work on my W200, stuck on LG logo and heating up considerably
Click to expand...
Click to collapse
Sorry for having forgotten that the fstab in the ramdisk was modified in order to support the system partition which had been formatted to ext4 by myself.
You could use magiskboot to edit the boot.img by yourself. Just replace the kernel and kernel_dtb by the one unpacked from the stock boot.img and then repack the image file.
Prebuilt magiskboot can be checked here: https://github.com/TeamWin/external_magisk-prebuilt/tree/android-11/prebuilt
If available, I will reupload the correct version in several month.

Categories

Resources