Help with rooting Aligator S5065 Duo MT6580 Android 7.0 - Android Q&A, Help & Troubleshooting

I need help to root my Aligator S5065 Duo phone. It ha Andoid 7.0 and the chipset is Mediatek MT6580.
Here is some info from the phone:
BB Chip : mt6580
MS Board. : ALIGATORS5065
Build Time : Tue Jan 23 15:35:41 CST 2018
Krenel Ver. : 3.18.35+ ([email protected]) (gcc version 4.8 (GCC)) #2 SMP PREEMPT Tue Jan 23 16:11:14 CST 2018
Android Ver. : 7.0
SW Ver. : alps-mp-n0.mp2-V1-droi6580.weg.n
Custom Build Verno. : unknown
IMEI1 : XXX
IMEI2 : XXX
Modem Ver. ALIGATOR_S5065_OS_1.1_2018 0123
Bar code : 010901MT000000000000003891_155648
The idea was:
1) make a full backup using MTK Droid Tool
2) flash TWRP using SP Flash Tool
3) boot TWRP and install Magisk
Problems:
1) MTK Droid Tool v2.5.3. doesn't support this chipset and I didn't found a newer version - so no full backup
I've tried to download a stock ROM or a full backup.
I have found MT6580__ALIGATOR__ALIGATOR_S5065__alps-mp-n0.mp2-V1_droi6580.weg.n__Android_7.0.ispff but it seems to need Infinity CM2 Dongle for flashing, which I don't own.
I have also found ALIGATOR S5065 – 7.0_MT6580_WL581M.LG.ALIG.HB.N.F.S12.B18.0927.V3.02_OS_1.1_20170927.zip which seems to be usable but not exactly the same as I have in my phone, at least it contains a scatter file. With the help of this scatter file I have I've read back my phone but the read imgs are considerably bigger, than the original ones in the zip - that doesn't seem right?
2) I have downloaded TWRP_3.2.3-0_20180803_UNOFFICIAL_MT6580_N.zip which should be a TWRP recovery for my chipset and the same kernel version, so I hoped it could work. But when trying to flash it with SP Flash Tool I get "PMT changed for the ROM" error message. The suggested solution for this error seem to be very risky (formating the phone, atc.), so I didn't dare to try ...
Now I'm stuck and I don't know how to proceed.
Any help would be really appreciated

Some progress:
I got a custom TWRP recovery image from Matty1993 <- thank you very much
I flashed it using adb and fastboot:
adb devices - successfully listed my device
adb reboot bootloader
fastboot flash recovery c:\adb\recovery.img - got this error message: "FAILED (remote: 'not allowedin locked state')"
Locked bootloader, unlocking ...
fastboot flashing unlock
- (bootloader) Start unlock flow
- OKAY [ 18.800s]
- Finished. Total time: 18.816s
Flashing the recovery.img
fastboot flash recovery c:\adb\recovery.img
Sending 'recovery' (10226 KB) OKAY [ 0.359s]
Writing 'recovery' OKAY [ 0.640s]
Finished. Total time: 1.030s
Success
fastboot reboot-bootloader
Rebooting into bootloader OKAY [ 0.000s]
Finished. Total time: 0.016s
fastboot erase cache (I don't know if it was a good idea but it was in the tutorial, I was following)
******** Did you mean to fastboot format this ext4 partition?
Erasing 'cache' OKAY [ 0.109s]
Finished. Total time: 0.125s
fastboot reboot
Rebooting OKAY [ 0.000s]
Finished. Total time: 0.016s
Now when booting the phone complains:
Orange state
Your device has been unlocked and can't be trusted
Your device will boot in 5 seconds
In 5 second it starts to boot but it stays forever on the "POWERED BY android" logo
I can boot to TWRP recovery (also fastboot), so I did and flashed magisk (because the main goal was to root my phone) and selected to delete cache/dalvik.
I'm not able to switch off the phone, it reboots. I had tu pull the battery (luckily it's removable).
The phone info changed
BB Chip : mt6580
MS Board. : ALIGATORS5065
Build Time : Tue Jan 23 15:35:41 CST 2018
Krenel Ver. : 3.18.35+ ([email protected]) (gcc version 4.8 (GCC)) #2 SMP PREEMPT Tue Jan 23 16:11:14 CST 2018
Android Ver. : 7.0
SW Ver. : alps-mp-n0.mp2-V1-droi6580.weg.n
Custom Build Verno. : unknown
IMEI1 : unknown
IMEI2 : unknown
Modem Ver. ALIGATOR_S5065_OS_1.1_2018 0123
Bar code : unknown
The IMEIs and Bar code are now "uknown".
What did I wrong and what to do, to fix it?

forget MTK Droid Tool it is outdated and does not support scatter for devices > 4 GB. you can use SP Flash Tool for full ROM dump. First thing you should do is backup your nvram partition, hopefully it is not too late...
https://www.getdroidtips.com/backup-restore-imei-nvram-data-mediatek
If you already have backup of stock boot.img:
- copy file to /external_sd/TWRP/BACKUPS folder
- rename it to boot.emmc.win
- create a backup of current boot (just in case)
- restore renamed stock boot.emmc.win from TWRP
regarding boot stuck:
- Format Data and Wipe Cache from TWRP, reboot recovery, wipe again (Wipe -> Format Data -> type yes)
- reboot TWRP, check if /system /data and /cache is mounted/mountable (you should see folders or files inside)
- reboot system and wait 5 minutes, first boot may take a while because the data partition is forced encrypt
- if android is completely booted, check IMEI
Now, if your device is in good condition, reboot recovery and make a full TWRP backup.

Thank you very much for your help.
I did a dump before, using the SP Flash Tool and the scatter from the downloaded ALIGATOR S5065 – 7.0_MT6580_WL581M.LG.ALIG.HB.N.F.S12.B18.0927.V3.0 2_OS_1.1_20170927.zip file.
So I have a sort of a "backup"
Now I'm going to read and I'll report back how it went.

blakegriplingph said:
NVRAM data must have been wiped off somehow, as that's one reason as to why your serial numbers have gone kaput.
Click to expand...
Click to collapse
If this is the case, you can "download" (=flash) your backup files from SP Flash Tool. In scatter file change entries to "is_download: true". Open the edited scatter file with SP Flash Tool. Make sure you uncheck all checkboxes, except nvram, nvdata (and cache, if you still have problems with this partition). Double click on file name and select the file for each partition. Make sure EMMC_USER is selected. The file sizes must fit partition size. Do NEVER flash PRELOADER! Press start, then connect phone, then insert battery.
nvram.bin 5120 KiB (0x00500000)
nvdata.bin 32768 KiB (0x02000000)
cache.img 409600 KiB (0x19000000)
If done, hold Volume Up key while unplug + plug in USB cable, this will boot into recovery. Wipe Cache and Data

My sizes of the backup files:
nvram.bin 5 242 880 seems OK
nvdata.bin 33 554 432 seems OK
cache.img 419 430 400 bigger
Is there a way I can check the integrity of them before flashing?
And what when I get the "PMT changed for the ROM" error message?
I've attached the used scatter file

Should be fine if you use same scatter file used for read back. If you got "PMT changed" (probably wrong scatter file), you must restore all partitions (except preloader) with the exactly same scatter file you have created your backup. Then your phone should be restored to its original state no matter if scatter file was wrong. Once you get your phone in good condition, you can create your own scatter file with current partition layout from WwR MTK v2.30

Matty1993 said:
All good mate yeah orange state is because you unlocked bootloader and didnt factory reset [...]
If you still get dramas with orange state let me know ill manually patch the dm-verity out of your boot.img for you
Click to expand...
Click to collapse
Orange state just mean unlocked bootloader, you can't get rid of. Do not lock the bootloader again, just leave it orange state is fine...

I thought so and it doesn't really bother me

Matty1993 said:
Your device comes with out of the box encryption in your boot.img fstab your system path will be /dev/block/platform/mtk-msdc/******/msdc/by-name/system /system ext4 ro wait, "verify"
Click to expand...
Click to collapse
Zdendav said:
I did all the steps:
- wipe, format
- factory reset
hangs on the "POWERED BY android" logo, when trying to boot
- flashed boot.img in fastboot
- reboot
I was not fast enough to go onto TWRP, it tried to boot, hangs on the "POWERED BY android" logo
-reboot into TWRP
- wipe, format
- factory reset
still hangs on the "POWERED BY android" logo, when trying to boot
I can borrow exactly the same phone from a relative (fully working) - maybe I should do a full backup of it, then I'll have "clean" images of boot, recovery etc.
Meanwhile I did another full backup and this time I used WwR MTK v2.30 to create a correct scatter.
I attach both scatter files.
Click to expand...
Click to collapse
as @Matty1993 already figured out, your phone seems fine, just dm-verity prevents to boot because of recovery checksum mismatch. You have to disable dm-verity.
Install Disable_Dm-Verity_ForceEncrypt.zip from TWRP. This will patch your boot.img and modify fstab entries. Format Data, then use "Copy Log" option and upload recovery.log here

aIecxs said:
Should be fine if you use same scatter file used for read back. If you got "PMT changed" (probably wrong scatter file), you must restore all partitions (except preloader) with the exactly same scatter file you have created your backup. Then your phone should be restored to its original state no matter if scatter file was wrong. Once you get your phone in good condition, you can create your own scatter file with current partition layout from WwR MTK v2.30
Click to expand...
Click to collapse
I did try and I got the "PMT changed" even when I selected all partitons except preloader ..
I did borrow exactly the same phone from a relative and created a full backup and from it a proper scatter file. I compared both scatter files and there are differences (as expected)
I attach both scatter files
I don't know how to proceed.
1) Lock the bootloader?
2) Flash parts from the borrowed phone? Which parts?
PS I have also a backup of userdata taken in factory mode.

don't flash anything with SP flash tool, just see my previous post. boot + recovery + nvram are identical, but tee1 + tee2 + teeinfo missing, and metadata + userdata have different size. keep the backup created with scatter file from WwR_MTK this seems to be the right one

aIecxs said:
Install Disable_Dm-Verity_ForceEncrypt.zip from TWRP. This will patch your boot.img and modify fstab entries. Format Data, then use "Copy Log" option and upload recovery.log here
Click to expand...
Click to collapse
Done. Did it all in one go (without any reboot), then powered off.
Log is attached

aIecxs said:
don't flash anything with SP flash tool, just see my previous post. boot + recovery + nvram are identical, but tee1 + tee2 + teeinfo missing, and metadata + userdata have different size. keep the backup created with scatter file from WwR_MTK this seems to be the right one
Click to expand...
Click to collapse
Sorry I missed your post until I posted mine ...
I'll keep all backups until it's sorted out.
And thank you very much aIecxs and Matty1993 for all your help

thanks for the log. seems there is something wrong, maybe with TWRP or maybe with phone.
Code:
E:Primary block device '/dev/block/platform/mtk-msdc.0/11120000.msdc0/by-name/userdata' for mount point '/data' is not present!
Failed to mount '/cache' (Invalid argument)
Error installing zip file '/external_sd/Disable_Dm-Verity_ForceEncrypt_04.03.19.zip'
Flash stock boot.img and stock recovery.img from fastboot. reboot into stock recovery. Wipe Data + Cache. reboot to bootloader. boot into TWRP from fastboot. copy log to sdcard and upload again. reboot your phone and wait 5 minutes.

I flashed the stock recovery and boot in fastboot in one go.
Then rebooted to recovery but there is only "Supported API: 3" in the lower left corner of the display and that's all.
What to do next?
Edit: It's even worse, I'm not able to enter fastboot, recovery etc., the phone doesn't react to the volume button and always show the orange message a boot to the Supported API: 3 screen.

This indicates something is wrong with cache partition. Usually a normal system boot from stock boot.img will fix this. If you can't enter fastboot mode, flash recovery from SP Flash Tool. Try this version it has changed fstab. This should fix the /data mount. Then you should be able to enter fastboot again.
Code:
[strike]/data ext4 /dev/block/platform/mtk-msdc.0/11120000.msdc0/by-name/userdata flags=encryptable=/dev/block/platform/mtk-msdc.0/by-name/metadata[/strike]
/data ext4 /dev/block/platform/mtk-msdc.0/11120000.msdc0/by-name/userdata flags=encryptable=/dev/block/platform/mtk-msdc.0/11120000.msdc0/by-name/metadata
Regarding /cache try following from fastboot:
Code:
fastboot format:ext4 cache
after this wipe cache again from stock recovery (you can boot stock recovery from fastboot without flashing it). if cache still not mounted in TWRP, your only choice left is flash backup of cache partition from your friends phone from SP Flash Tool
edit: attachment deleted

Flashed your recovery, now it always boots into twrp, volume buttons still seem to not work, I'm still not able to enter fastboot.
Edit: I was able to enter fastboot by "adb reboot bootloader" when in TWRP, strangely "adb reboot fastboot" booted into TWRP.
I formatted the cache, rebooted into stock recovery, formatted the cache again.
Rebooted into TWRP, in file manager the cache is empty, in the mount menu I'm not able to tick any of the listed partitions to mount it ...
I'm not able to post the new log, it copies it to /data/media but in the file manager the location is empty ...

i have added some mount points, please download and flash again. you can copy recovery.log from adb
Code:
adb pull /tmp/recovery.log C:\adb\recovery.log
please post output of df and mount
Code:
adb shell
mount
busybox df -aT

/ # mount
rootfs on / type rootfs (rw,seclabel)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
/ # busybox df -aT
Filesystem Type 1K-blocks Used Available Use% Mounted on
tmpfs tmpfs 463204 44 463160 0% /dev
devpts devpts 0 0 0 0% /dev/pts
proc proc 0 0 0 0% /proc
sysfs sysfs 0 0 0 0% /sys
selinuxfs selinuxfs 0 0 0 0% /sys/fs/selinux
tmpfs tmpfs 463204 32 463172 0% /tmp
adb functionfs 0 0 0 0% /dev/usb-ffs/adb

Related

How to use nvflash to flash clean system?

Hallo, now that we have the tool, how can we make a full clean system restore, because i did, wipe my prime, and i cannot flash via Fastboot then it came up with this message
C:\Users\Benjamins\Desktop>fastboot flash system system.blob
sending ‘system’ (524288 KB)…
OKAY [ 97.339s]
writing ‘system’…
FAILED (remote: (InvalidSize))
finished. total time: 159.786s
I have a optimus 2x where i could restore with nvflash, but it seems i cannot find anyway of doing that on the prime yet :/
butbhgyt said:
Hallo, now that we have the tool, how can we make a full clean system restore, because i did, wipe my prime, and i cannot flash via Fastboot then it came up with this message
C:\Users\Benjamins\Desktop>fastboot flash system system.blob
sending ‘system’ (524288 KB)…
OKAY [ 97.339s]
writing ‘system’…
FAILED (remote: (InvalidSize))
finished. total time: 159.786s
I have a optimus 2x where i could restore with nvflash, but it seems i cannot find anyway of doing that on the prime yet :/
Click to expand...
Click to collapse
if im not mistaken you have to flash via apx mode, to enter apx mode begin booting your tablet like normal, then while it is attempting to boot hold both the powerbutton and up vol key this will send you into apx mode where the screen just goes blank.
Next type the following command
wheelie --blob blob.bin to boot strap into nvflash
now proceed as you normally would with nvflash
(i believe the commands may be slightly altered in this version of nvflash so you may want to run nvflash help to make sure you are using the right commands)
- Cheers
shreddintyres said:
if im not mistaken you have to flash via apx mode, to enter apx mode begin booting your tablet like normal, then while it is attempting to boot hold both the powerbutton and up vol key this will send you into apx mode where the screen just goes blank.
Next type the following command
wheelie --blob blob.bin to boot strap into nvflash
now proceed as you normally would with nvflash
(i believe the commands may be slightly altered in this version of nvflash so you may want to run nvflash help to make sure you are using the right commands)
- Cheers
Click to expand...
Click to collapse
Thanks for the quick answer.
I got to the nvflash part, but from here i don't know what commands i should use to flash my ROM to my prime.
I think maybe that my partitions tables is broken, is there a way to fix that, because every time i try to format whit Fastboot i get this message
Code:
C:\Users\Benjamins\Desktop>fastboot format data
formatting 'data' partition...
Formatting is not supported for filesystem with type ''.
FAILED ()
finished. total time: 0.014s
butbhgyt said:
Thanks for the quick answer.
I got to the nvflash part, but from here i don't know what commands i should use to flash my ROM to my prime.
I think maybe that my partitions tables is broken, is there a way to fix that, because every time i try to format whit Fastboot i get this message
Code:
C:\Users\Benjamins\Desktop>fastboot format data
formatting 'data' partition...
Formatting is not supported for filesystem with type ''.
FAILED ()
finished. total time: 0.014s
Click to expand...
Click to collapse
Unfortunately im not very well versed in NVflash or fastboot yet, however if you were able to successfully able to generate the files in AndroidRoot's guide you should be able to perform a full system recovery, how is an entirely different issue
hopefully these help:
Code:
c:\>nvflash --help
Nvflash started
nvflash action [options]
action (one or more) =
--help (or -h)
displays this page
--cmdhelp cmd(or -ch)
displays command help
--resume (or -r)
send the following commands to an already-running bootloader
--quiet (or -q)
surpress excessive console output
--wait (or -w)
waits for a device connection (currently a USB cable)
--create
full initialization of the target device using the config file
--download N filename
download partition filename to N
--setboot N
sets the boot partition to partition N
--format_partition N
formats contents of partition N
--read N filename
reads back partition N into filename
--getpartitiontable filename
reads back the partition table into filename
--getbit filename
reads back BIT into filename
--dumpbit [options] {debug|regress|force}
dumps the structure of bit on terminal in text form --getbct
reads back the BCT from mass storage
--odm C Data
ODM custom command 'C' with associated data
--go
continues normal execution of the downloaded bootloader
options =
--configfile filename
indicates the configuration file used with the following commands:
--create, --format_all
--bct filename
indicates the file containing the BCT
--rcm file1 file2
specifies the encrypted and signed RCM message data files
got from nvsbktool for talking to bootrom in odm secure mode
--bl filename
downloads and runs the bootloader specified by filename
--odmdata N
sets 32bit customer data into a field in the BCT, either hex or
decimal
--diskimgopt N
sets 32bit data required for disk image convertion tool
--format_all
formats all existing partitions on the target device using the config fil
e,
including partitions and the bct
--setbootdevtype S
sets the boot device type fuse value for the device name.
allowed device name string mentioned below:
emmc, nand_x8, nand_x16, nor, spi
--setbootdevconfig N
sets the boot device config fuse value either hex or decimal
--verifypart N
verifies data for partition id = N specified. N=-1
indicates all partitions
Intended to be used with --create command only.
--setbct
updates the chip specific settings of the BCT in mass storage to
the bct supplied,used with --create, should not be with --read,and
--format(delete)_all,format(delete)_partition,--download, and--read
--setblhash <bct file>
send encrypted bct file got from nvsbktool to miniloader to support
downloader bootloader or microboot in secure mode
--sync
issues force sync commad
--rawdeviceread S N filename
reads back N sectors starting from sector S into filename
--rawdevicewrite S N filename
writes back N sectors from filename to device starting from sector S
--deviceid N
sets the device ID of the target either hex or decimal
--transport <transportname>
transportname should be <jtag> for emulation platforms and <usb> for othe
r platforms
or it can be <simulation> for doing whole Nvflash process on host side,de
vice not needed
--instance <n>
instance number of the device
--updatebct <bctsection>
bctsection should refer to the section of the bct we are updating.
Curently we suport updates for following sections
<SDRAM> updates SdramParams and NumSdramSets fields
<DEVPARAM> updates DevParams, DevType and NumParamSets
<BOOTDEVINFO> updates BlockSizeLog2, PageSizeLog2 and PartitionSize
--devparam <P> <B> <N>
P is the logical page_size of the device. Default size is 2048 bytes
B is the erase group size of the device.
N is total number blocks of the device (erase group units)
you could try the following but keep in mind im completely guessing and there is no guarantee this will work
first to see if your partitiontable is whack run
nvflash --getpartitiontable <insertwhatyouwantonamethepartitiontable>
---------- Post added at 12:58 PM ---------- Previous post was at 12:26 PM ----------
I just realized that you are trying to flash .blob files, with the bootloader that comes with the NVflash mod you must use .img files you will need to get blob unpacking tools from Android Root to unpack blob files then flash them partition by partition
see this post
http://forum.xda-developers.com/showpost.php?p=28969489&postcount=126
shreddintyres said:
Unfortunately im not very well versed in NVflash or fastboot yet, however if you were able to successfully able to generate the files in AndroidRoot's guide you should be able to perform a full system recovery, how is an entirely different issue
hopefully these help:
Code:
c:\>nvflash --help
Nvflash started
nvflash action [options]
action (one or more) =
--help (or -h)
displays this page
--cmdhelp cmd(or -ch)
displays command help
--resume (or -r)
send the following commands to an already-running bootloader
--quiet (or -q)
surpress excessive console output
--wait (or -w)
waits for a device connection (currently a USB cable)
--create
full initialization of the target device using the config file
--download N filename
download partition filename to N
--setboot N
sets the boot partition to partition N
--format_partition N
formats contents of partition N
--read N filename
reads back partition N into filename
--getpartitiontable filename
reads back the partition table into filename
--getbit filename
reads back BIT into filename
--dumpbit [options] {debug|regress|force}
dumps the structure of bit on terminal in text form --getbct
reads back the BCT from mass storage
--odm C Data
ODM custom command 'C' with associated data
--go
continues normal execution of the downloaded bootloader
options =
--configfile filename
indicates the configuration file used with the following commands:
--create, --format_all
--bct filename
indicates the file containing the BCT
--rcm file1 file2
specifies the encrypted and signed RCM message data files
got from nvsbktool for talking to bootrom in odm secure mode
--bl filename
downloads and runs the bootloader specified by filename
--odmdata N
sets 32bit customer data into a field in the BCT, either hex or
decimal
--diskimgopt N
sets 32bit data required for disk image convertion tool
--format_all
formats all existing partitions on the target device using the config fil
e,
including partitions and the bct
--setbootdevtype S
sets the boot device type fuse value for the device name.
allowed device name string mentioned below:
emmc, nand_x8, nand_x16, nor, spi
--setbootdevconfig N
sets the boot device config fuse value either hex or decimal
--verifypart N
verifies data for partition id = N specified. N=-1
indicates all partitions
Intended to be used with --create command only.
--setbct
updates the chip specific settings of the BCT in mass storage to
the bct supplied,used with --create, should not be with --read,and
--format(delete)_all,format(delete)_partition,--download, and--read
--setblhash <bct file>
send encrypted bct file got from nvsbktool to miniloader to support
downloader bootloader or microboot in secure mode
--sync
issues force sync commad
--rawdeviceread S N filename
reads back N sectors starting from sector S into filename
--rawdevicewrite S N filename
writes back N sectors from filename to device starting from sector S
--deviceid N
sets the device ID of the target either hex or decimal
--transport <transportname>
transportname should be <jtag> for emulation platforms and <usb> for othe
r platforms
or it can be <simulation> for doing whole Nvflash process on host side,de
vice not needed
--instance <n>
instance number of the device
--updatebct <bctsection>
bctsection should refer to the section of the bct we are updating.
Curently we suport updates for following sections
<SDRAM> updates SdramParams and NumSdramSets fields
<DEVPARAM> updates DevParams, DevType and NumParamSets
<BOOTDEVINFO> updates BlockSizeLog2, PageSizeLog2 and PartitionSize
--devparam <P> <B> <N>
P is the logical page_size of the device. Default size is 2048 bytes
B is the erase group size of the device.
N is total number blocks of the device (erase group units)
you could try the following but keep in mind im completely guessing and there is no guarantee this will work
first to see if your partitiontable is whack run
nvflash --getpartitiontable <insertwhatyouwantonamethepartitiontable>
---------- Post added at 12:58 PM ---------- Previous post was at 12:26 PM ----------
I just realized that you are trying to flash .blob files, with the bootloader that comes with the NVflash mod you must use .img files you will need to get blob unpacking tools from Android Root to unpack blob files then flash them partition by partition
see this post
http://forum.xda-developers.com/showpost.php?p=28969489&postcount=126
Click to expand...
Click to collapse
Thank you very much, I managed to flash all my partition in Fastboot now, when i unpacked them with blobunpack, my prime is back alive thanks to you
People have to remember they are no longer using asus bootloader/fastboot, when they AndroidRoot.
sent from my tf201
Oops

KEXEC for Sony Xperia Sola

Hallo, after two days of trying to make kexec working, got it working! Its based on hard boot kexec! We can create now multiboot menu and boot multi roms without need for flashing them! Will make this thread updated including files, kernel and instructions!
munjeni said:
Hallo, after two days of trying to make kexec working, got it working! Its based on hard boot kexec! We can create now multiboot menu and boot multi roms without need for flashing them! Will make this thread updated including files, kernel and instructions!
Click to expand...
Click to collapse
and probably now guys with locked bootloader can boot roms requiring custom kernels
DevSwift1 said:
and probably now guys with locked bootloader can boot roms requiring custom kernels
Click to expand...
Click to collapse
NO because kernel need enabled kexec and reguire some other modifications whick is not exist on stock kernel!!!
Tried to boot stock kernel but failed, seems not stable kexec by now! Need help!
Here is kernel changes (3 commits by Aug.09.2013) -> https://github.com/munjeni/android_kernel_xperiago/commits/jb-dev seems there is problem with clean reboot! Got kexec working with usind zImage from the same kernel version but seems when there is another kernel version its fail! I think it fail on my reboot function implementation! Need help to solve these things!
Got ansfer by self. Stock kernel and everyother without kexec patch ca not be loaded more info here -> http://forum.xda-developers.com/showthread.php?p=44077327
Tomorow will make it better, hope perfectly working.
Ok, lets go multiboot development!
My experience using kexec:
- since hard reboot owerwrite new kernel and ramdisk, I disabled hard reboot. So we need shutdown cpu instead of using function reboot! Since we have no shutdown cpu function we have very slow boot after executing new kernel and ramdisk (curently I am satisfied with slow boot because kexec can boot new kernel and ramdisk, yes its slow but working )
What is needed for kexec boot:
- kexec can not boot non kexec based kernels
- kexec can boot only kexec enabled kernel which mean only kernel which have my kexec patch (you can patch your kernel using kexec patch from my git)
- suported phones by now is only Sola and Go
My idea for multiboot by now:
- making boot menu based on modified CWM recovery
Modified CWM recovery plan:
- create new recovery and add new sub menu for multiboot feature
CWM multiboot menu idea:
- here we can write kexec multiboot functions
CWM kexec function idea:
- mount system, cache, userdata partition from external sdcard EXT4 partitons and mount them (only if these partions is created by you on your sdcard !!! We can create an small submenu for creating these partitons if these partitons not exist, but not now, we can do it later after creating simple kexec main menu))
- after mounting these partitions we can:
- boot android from allready installed android from these partitions
- ability to install new android to these partiton and boot them
Lets go! Before I start making new CWM, I need better ideas! What you think how we can do it??? Waiting your ideas!!!
Maybe we can do it without using CWM???
So, how about another kernel or rom which isn't supporting kexec yet?
Sent from risahikari
munjeni said:
Lets go! Before I start making new CWM, I need better ideas! What you think how we can do it??? Waiting your ideas!!!
Maybe we can do it without using CWM???
Click to expand...
Click to collapse
I cannot think of a way to do this without involving CWM. But we could make use of the volume buttons to select the ROM on boot (by mounting the appropriate partition based on the volume button that has been pressed down when the bootsplash screen is displayed). However this would limit us to the number of ROMs that can be installed to two (or max 3, if we have an option to set a default ROM to boot if no button is pressed).
Brilliant work by the way. You are Godlike! :victory:
itachilinux said:
So, how about another kernel or rom which isn't supporting kexec yet?
Sent from risahikari
Click to expand...
Click to collapse
Simple not supported!
First of all we need to create ramdisk which will boot android located on external sdcard, than if we get it working we can play with kexec. I need your help! If some one get android working from external sdcard than I will continue further. I am allso playing now with new ramdisk and trying to get external android booting!!
Our multiboot is not ready. Only ready is kexec tool and kexec kernel. Our multiboot feature is not yet implemented. Our multiboot is in plan and our multiboot need ideas!
can this be of any help?
http://forum.xda-developers.com/showpost.php?p=42057833&postcount=1
github:
https://github.com/tux-mind/tf201-dev
Changed fstab, recovery.fstab and sony fstab device paths to point to the external sdcard partition, modified updater_script paths, rebooted to the recovery, installed rom to the external sdcard partitions, rebooted, after abnormaly slow boot system booted but is abnormally unresponsive, so I deleted and reverted back to the emmc boot. Sory guys I am stopping here until some one get android booted from sdcard! I have no free time to play with external boot. When you done it I will continue
Any one have idea what is use of the fota kernel??? Got fota kernel and ramdisk kexeced and booted, found some tools in sbin folder, there is fota tools, for example after exacution of the fota-ua got this output:
./fota-ua --help
FOTA-UA May 21 2013 18:05:10
ERROR [181] Parameter Error
Info [745] No status file
Total physical memory: 407695360 bytes
Total available physical memory: 8314880 bytes
Configuration information at runtime:
The number of pages of physical memory SC_PHYS_PAGES: 99535
The number of currently available pages of physical memory _SC_AVPHYS_PAGES: 203
0
Info [88] The number of processors configured _SC_NPROCESSORS_CONF: 2
The number of processors currently online (available) _SC_NPROCESSORS_ONLN: 2
Size of a page in bytes _SC_PAGESIZE: 4096
Logging of resource usage measures:
Maximum resident set size ru_maxrss: 172 KB
Page reclaims ru_minflt: 84
Page faults ru_majflt: 0
Block input operations: 0
Block output operations: 0
Info [468] No sdcard found in mounts
Info [757] Update Failed
WARN [48] Failed to remove /sbin/fota-ua, Read-only file system
WARN [52] Failed to remove /sbin/fota-mke2fs, Read-only file system
WARN [56] Failed to remove /sbin/rb_repart, No such file or directory
Click to expand...
Click to collapse
What we can do with these tools???
Or another tool:
./rb_repart
Repartitioning Tool
(C) Copyright 1999-2011 Red Bend Ltd.
4 Hacharash St. Hod-Hasharon, Israel
Version: 7.0.15.5514
Usage: ./rb_repart
-r [OPTIONAL, DEFAULT] - Run full operation
-t [OPTIONAL] - Run in test mode. Do not perform writes
-c config_file [OBLIGATIONAL] - Configuration file
Click to expand...
Click to collapse
munjeni said:
Any one have idea what is use of the fota kernel??? Got fota kernel and ramdisk kexeced and booted, found some tools in sbin folder, there is fota tools, for example after exacution of the fota-ua got this output:
What we can do with these tools???
Or another tool:
Click to expand...
Click to collapse
Well have you ever updated Sola with OTA,you will notice it boots to recovery and thats fota kernel "f-ota" - friendly over the air update system
XperianPro said:
Well have you ever updated Sola with OTA,you will notice it boots to recovery and thats fota kernel "f-ota" - friendly over the air update system
Click to expand...
Click to collapse
When I tried on Xperia Go to update trought fota it was not worked! I never seen anything related to the fota recovery! Is recovery exist on fota kernel??? Have any menu???
Found some logs:
/data/local/tmp/sbin/fotatools # find / | grep fota
find / | grep fota
/cache/recovery/fota
/cache/recovery/fota/executed
/cache/recovery/fota/report
/cache/recovery/fota/status
/system/bin/fota-snoop
find: /proc/2652: No such file or directory
find: /proc/3172: No such file or directory
find: /proc/3554: No such file or directory
find: /proc/3610: No such file or directory
find: /proc/3723: No such file or directory
find: /proc/3884: No such file or directory
/data/local/tmp/sbin/fota-tad
/data/local/tmp/sbin/fotatools
/data/local/tmp/sbin/fotatools/rb_repart
/data/local/tmp/sbin/fotatools/vold.fstab
/data/local/tmp/sbin/fotatools/toolbox
/data/local/tmp/sbin/fota-mke2fs
/data/local/tmp/sbin/fota-ua
/dev/.fota_ui_down
/dev/.fota_ui_shutdown
/data/local/tmp/sbin/fotatools # ls /cache/recovery
ls /cache/recovery
fota
last_log
/data/local/tmp/sbin/fotatools # ls /cache/recovery/last_log
ls /cache/recovery/last_log
/cache/recovery/last_log
/data/local/tmp/sbin/fotatools # cat /cache/recovery/last_log
cat /cache/recovery/last_log
MR: Master reset starting Sat Aug 10 20:26:26 2013
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /data ext4 /dev/block/mmcblk0p11 (null)
2 /cache ext4 /dev/block/mmcblk0p12 (null)
3 /modemfs ext4 /dev/block/mmcblk0p6 (null)
MR: Got content --wipe_data from /cache/recovery/command
MR: Formatting /cache
Creating filesystem with parameters:
Size: 262144000
Block size: 4096
Blocks per group: 32768
Inodes per group: 8000
Inode size: 256
Journal blocks: 1024
Label: /cache
Blocks: 64000
Block groups: 2
Reserved block group size: 15
Created filesystem with 11/16000 inodes and 2065/64000 blocks
MR: Formatting /data
Creating filesystem with parameters:
Size: 2147483648
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 8192
Label: /data
Blocks: 524288
Block groups: 16
Reserved block group size: 127
Created filesystem with 11/131072 inodes and 17193/524288 blocks
MR: Unlocking gesture
MR: Resetting RFHAL parameters
MR: Cleaning dir /modemfs/RFHAL
MR: Leaving dir /modemfs/RFHAL
MR: Master reset done
/data/local/tmp/sbin/fotatools #
Click to expand...
Click to collapse
I hope it will work on Xperia™ U, I don't know if it could be possible as I don't know how many differences are between Sola's and U's ramdisk and stuff. :/
munjeni said:
Any one have idea what is use of the fota kernel??? Got fota kernel and ramdisk kexeced and booted, found some tools in sbin folder, there is fota tools, for example after exacution of the fota-ua got this output:
What we can do with these tools???
Or another tool:
Click to expand...
Click to collapse
well, on xperia s for example we use fota partition like a it was a recovery partition
otherwise as soon as you unlock your bl (= no more OTA) it becomes usless
mirhl said:
well, on xperia s for example we use fota partition like a it was a recovery partition
otherwise as soon as you unlock your bl (= no more OTA) it becomes usless
Click to expand...
Click to collapse
How you load recovery from ota partition? Seems you have something like LK bootloader???
munjeni said:
How you load recovery from ota partition? Seems you have something like LK bootloader???
Click to expand...
Click to collapse
a sort of
newer kernels when booting recovery, check if FOTA partition has the custom one installed
if yes, they loads that. otherwise standard recovery
more information here
mirhl said:
a sort of
newer kernels when booting recovery, check if FOTA partition has the custom one installed
if yes, they loads that. otherwise standard recovery
more information here
Click to expand...
Click to collapse
Thats good idea, but thats not ideal solution in comparation with phones which have separated recovery/boot partition and bootloader ui like HTC devices which have direct recovery load trought bootloader, these solution only working if primary boot partition is modified and added "few lines" for booting recovery from seccond partition (like ota partition). Will be perfect solution if we make LK bootloader for separating recovery/boot partition, allso with LK we will be able to create custom emmc layout, by now I can not see any small bootloader for NovaThor on google search, seems thats not public. Searching for a way for creating bootloader based on kernel. How we can modify curent kernel and make them bootloader??? We can modify recovery and make them bootloader kexec based, but I am not happy with kexec because we need to fix them first because loading an kernel trought current kexec patch is very slow! I will be happy if some one look into my git and find a solution for fixing them!
mirhl said:
well, on xperia s for example we use fota partition like a it was a recovery partition
otherwise as soon as you unlock your bl (= no more OTA) it becomes usless
Click to expand...
Click to collapse
What about if I relock my bootloader, do I will be able to use fota??? Seems ota working only if drm keys is not broken??
munjeni said:
What about if I relock my bootloader, do I will be able to use fota??? Seems ota working only if drm keys is not broken??
Click to expand...
Click to collapse
i have a locked bootloader but on xperia u and if you want anything i will happly help and mine has never been unlocked
---------- Post added at 04:59 PM ---------- Previous post was at 04:44 PM ----------
bobthecooldad said:
i have a locked bootloader but on xperia u and if you want anything i will happly help and mine has never been unlocked
Click to expand...
Click to collapse
just read this about fota
http://forum.xda-developers.com/showpost.php?p=12615775&postcount=1
and the orginal file is checked and if it isnt the correct one the phone wont boot

I need help with a MTK6752 device

Hello guys,
I have a Ulefone Be Touch 2 (with a MT6752 cpu) that only boot and stay on the ulefone logo, and I can't install any ROM (official or custom ones)...
In fact, the tools (latest SPFlashTool v5.1628 and the one provided by ulephone I used successfully earlier) do the download process until 100% without error message, but the only thing that seems to be on the phone (and working) is the recovery.
With this two softwares I am able to install the official recovery or TWRP (2.8.7.0 from needrom), and they both are usable.
But when I try to do something in recovery mod, it tells me that cache or system partitions (and others) are not mounted (or found).
In SPFlashTool, I tryed many features without success but I have (NAND and UFS) errors when doing memory tests :
#External RAM:
#
# Type = DRAM
#
# Size = 0x80000000 (2048MB/16384Mb)
#
#NAND Flash:
#
# ERROR: NAND Flash was not detected!
#
#EMMC:
#
# EMMC_PART_BOOT1 Size = 0x0000000000400000(4MB)
# EMMC_PART_BOOT2 Size = 0x0000000000400000(4MB)
# EMMC_PART_RPMB Size = 0x0000000000400000(4MB)
# EMMC_PART_GP1 Size = 0x0000000000000000(0MB)
# EMMC_PART_GP2 Size = 0x0000000000000000(0MB)
# EMMC_PART_GP3 Size = 0x0000000000000000(0MB)
# EMMC_PART_GP4 Size = 0x0000000000000000(0MB)
# EMMC_PART_USER Size = 0x00000003a3e00000(14910MB)
#
#UFS:
#
# ERROR: UFS was not detected!
I don't understand what it meens and how can I change the recovery if the NAND is gone? Are system partitions and recovery stored in different places/memory (types)?
I searched and read on differents thread (the UBT2 review, mtk6755 ERROR: NAND Flash was not detected by split52 , [GUIDE] How to 'unbrick' your Mediatek MT65xx...) and googled and watched related videos but didn't find anything than matches and can really help me.
So, if someone can help me I would really be grateful.
Thank you in advance.
I'm sorry if I post this thread in the wrong section (I think it's the first I creat).
sylkyls
I had a problem like your's when I walked all over my partition layout because of a botched flash. Didn't have UFS errors tho. No info anywhere. Had to verify my scatter file and recovery fstab layout agreed with each other. Ended up modifying my scatter file. Took it one partition at a time using the fstab until the recovery recognized all partitions then backed up my files, reformatted and flashed the stock rom using SPF Tools. Took a while to boot. After that, the original scatter file worked. Still don't make sense why it worked that way but it got me back working.
smith901 said:
I had a problem like your's when I walked all over my partition layout because of a botched flash. Didn't have UFS errors tho. No info anywhere. Had to verify my scatter file and recovery fstab layout agreed with each other. Ended up modifying my scatter file. Took it one partition at a time using the fstab until the recovery recognized all partitions then backed up my files, reformatted and flashed the stock rom using SPF Tools. Took a while to boot. After that, the original scatter file worked. Still don't make sense why it worked that way but it got me back working.
Click to expand...
Click to collapse
Thank you smith901,
I don't know how to do this: I can run a terminal into the recovery but if I do cat /etc/fstab or less /etc/fstab , I only have :
/system ext4 rw
/cache ext4 rw
/data ext4 rw
/external_sd auto rw
I think I'm doing the wrong way.
Could you tell me (or redirect me to) a method please?
Have a nice day
sylkyls
sylkyls said:
Thank you smith901,
I don't know how to do this: I can run a terminal into the recovery but if I do cat /etc/fstab or less /etc/fstab , I only have :
/system ext4 rw
/cache ext4 rw
/data ext4 rw
/external_sd auto rw
I think I'm doing the wrong way.
Could you tell me (or redirect me to) a method please?
sylkyls
Click to expand...
Click to collapse
Seems to be fstab problems.
Use whatever unpacking tool you are comfortable with to unpack the stock recovery and TWRP. Then replace your fstab files in the root and /etc directories after changing what you want, rw to /system or whatever. Modify the twrp.fstab file in /etc using the values from stock fstab. You might have to add in or replace your rc and mt6735 files also. Repack then flash. The log screen in TWRP will let you know what partitions can't be read. Choosing the correct encryption partition took some trial & error.
Once you get it all to read, the modified twrp.fstab, files in the unpacked stock recovery folder plus a device tree, and the TWRP building thread will get a recovery built by yourself as soon as you can sync from git.
smith901 said:
Seems to be fstab problems.
Use whatever unpacking tool you are comfortable with to unpack the stock recovery and TWRP. Then replace your fstab files in the root and /etc directories after changing what you want, rw to /system or whatever. Modify the twrp.fstab file in /etc using the values from stock fstab. You might have to add in or replace your rc and mt6735 files also. Repack then flash. The log screen in TWRP will let you know what partitions can't be read. Choosing the correct encryption partition took some trial & error.
Once you get it all to read, the modified twrp.fstab, files in the unpacked stock recovery folder plus a device tree, and the TWRP building thread will get a recovery built by yourself as soon as you can sync from git.
Click to expand...
Click to collapse
Thank you again, but I'm really sorry that I can't apply your instructions... ( unpacking with 7-zip does not give me any fstab file )
Could you try to do it with the official rom please? ( download link is in the bottom of this page: http://ulefone.com/download/betouch2.html , at the next step my phone needs the "option 2" rar file).
With custom roms (zip files flashable with a custom recovery or rar archive), I can unpack thems and obtain/open a fstab file ( recovery.fstab ) but not with things flashable with SPFlashTool.
sylkyls
sylkyls said:
Thank you again, but I'm really sorry that I can't apply your instructions... ( unpacking with 7-zip does not give me any fstab file )
Could you try to do it with the official rom please? ( download link is in the bottom of this page: http://ulefone.com/download/betouch2.html , at the next step my phone needs the "option 2" rar file).
With custom roms (zip files flashable with a custom recovery or rar archive), I can unpack thems and obtain/open a fstab file ( recovery.fstab ) but not with things flashable with SPFlashTool.
sylkyls
Click to expand...
Click to collapse
I meant an unpacking tool like Carliv Image Kitchen or Android Image Kitchen. I'm rarely this helpful so once I finish cleaning the carpet I'll have a look.
The recovery.fstab file look slim in this recovery but that is what they made.
Download Aindroid Image Kitchen.
Follow the instructions to unpack your stock recovery and TWRP recovery.
Make the changes you want. Copy needed files, /etc/recovery.fstab, fstab.mt6752 and probably the *.rc files from stock to TWRP. Just check everything to be sure.
Repack TWRP then flash.
I don't use Windows so I couldn't use the program provided in the archive.
sylkyls,
did you solve the issue? I have the same problem.
cmarqz said:
sylkyls,
did you solve the issue? I have the same problem.
Click to expand...
Click to collapse
Hello,
Sorry every one but I forgot to follow this thread as I had a lot of work and someone giave me another phone ( a samsung note 4 N910F) that I repared (and am using now) and then I did let my ulefone away from my priorities.
Sorry cmarqz but I didn't try the solution proposed by smith901 on my MTK6752 device.
Maybe I'll try it later.
Did you find a solution for your device?
Best regards XDA users.

[REPARTITION] Nexus 7 (2013) Repartition [FLO/DEB] [16GB/32GB] [UA TWRP]

Nexus 7 (2013) Repartition​
No one is responsible for your actions except yourself. Everything written further may potentially brick your device, although risk is reduced to minimum.
This repartition package offers 1.5G /system; a /vendor partition and it is fully backward compatible with any ROM (including stock system.img).
Known-issues
HTML:
- If repartition pack says that device isn't correct,
than, if partition table wasn't modified before,
congrats! your device has different memory chip
that those I worked with. No worry, PM me and
I'll add support for it.
DO THE BACKUPs. Repartition will erase all your data
USB connection to PC is MANDATORY else you will not have opportunity to push ROM to your device
Backup
# Before processing further we highly recommend you backup persist and EFS using adb
# Or you might lose your IMEI/WIFI + BT mac addresses
Code:
adb root
adb shell
dd if=/dev/block/mmcblk0p2 of=/sdcard/modemst1.img
dd if=/dev/block/mmcblk0p3 of=/sdcard/modemst2.img
dd if=/dev/block/mmcblk0p4 of=/sdcard/persist.img
Now you can find 3 *.img files at path /sdcard. Copy them to your PC since internal memory will be erased.
Installation
HTML:
# This mod is backwards compatible with any ROM so we highly recommend NOT to reverse it if repartition went well.
# You should use ONLY recovery from this thread since other don't support all benefits of this mod.
# When installing ROM just after you flashed zip and before installing GAPPs you MUST make a resize in TWRP since all roms are build for ~800M system.
# Package is unified for flo and deb. To restore stock layout use same zip and steps as for repartition.
1. Boot into recovery (You need to allow system partition modification to be able resize /system in recovery).
2. Backup your data & Move your files from flash to your PC.
3. Flash repartition pack zip.
4. Do the actions asked by repartition pack (go to Terminal in ordinary recovery and input word that pack will tell you. Everything else will be done automatically).
5. Phone will reboot into recovery.
6. Install TWRP from below (it is build with support of new partitions layout and sizes. It can be differed from official TWRP by next format 3.x.x-1 UA).
7. Format everything. (mount errors will not affect formatting!)
- In TWRP: Wipe > Format data
- Type yes
- Once this completes go to: Wipe > Advanced Wipe
- Tick all the boxes and wipe. There should be no further mount errors. (Thanks [user=7694808]@mr_rubbish[/user] for corrections in formatting).
8. Install ROM which you like.
9. Enjoy better flash partition layout.
If something gone wrong - we recommend you NOT to do anything by yourself. Write here for help, else you may do only worse.
Downloads:
Repartitioning package: GitHub
Credits:
Special thanks to
- Unlegacy-Android team;
- Sudokamikaze;
- rlw6534 for Kingston MMC layout;
- surfrock66 for his gide for Nexus 5;
As usual, feedback is appreciated
XDA:DevDB Information
Nexus 7 (2013) Repartition, Tool/Utility for the Nexus 7 (2013)
Contributors
Clamor
Source Code: https://github.com/clamor95/android_device_unlegacy_recovery
Version Information
Status: Stable
Created 2018-09-19
Last Updated 2019-01-18
Common issues and F. A. Q.
Repartition pack should be safe for most devices. Common mistakes, issues and their solution will be published here.
1. You shouldn't flash any internal parts of repartition pack (*.sh files) only flash whole zip using TWRP. You may use my scripts for personal use or projects but authorship should to be kept.
2. If something isn't mounting after repartition try to format partitions that don't mount using Wipe -> Advanced Wipe in TWPR. Ideally you should format in that way all partitions in Advanced Wipe menu (see 5-th step of installation guide).
3. If you want to be sure that repartition went well I enclose loging zip. Flash it after repartition (when device reboots into TWRP). It won't modify anything only generates a partition.log in root of internal storage and outputs your current partition layout to screen. You should check if your layout is same as those fragments I provide under spoiler (file systems doesn't matter). If there are any differences you have to describe what you did and enclose partition.log to your post.
FLO/DEB STOCK
Code:
22 671088640B 1551892479B 880803840B system
23 1551892480B 2139095039B 587202560B cache
FLO/DEB MODIFIED
Code:
22 614429696B 2187293695B 1572864000B system
23 2187293696B 2270167039B 82873344B cache
...
30 2348843008B 2610987007B 262144000B vendor
4. After flashing most ROMs system size will reduce to stock, you need to resize /system in TWRP or use flashable resize zip for ROMs that support addon.d (automatic resize when dirty flashing updates).
5. After returning to stock partition table you won't be able to get into the Recovery from the bootloader anymore, but when you start the tablet normally it goes straight in the Recovery. It is normal state. New partition table proposes larger /recovery size (16MB) while stock gives only 10MB. During restoring stock process, it is impossible to restore larger recovery backup into new smaller partition. Whether not to leave user without recovery excess, recovery backup restores into /boot partition. Just flash ordinary TWRP and install ROMs from it.
6. Don't install the zip file from the USB OTG. Copy them into the /sdcard. Else you will get message after flashing repartition pack.
Code:
"Can not extract updater-script. Do you have it in package?
Updating partition details...
...done"
Link not working for the repartitioning package...
@rlw6534 should be fine now
Any chance you give details on backing up persist and EFS with dd command? I'm not really a noob but I also don't want to mess up my tab...
@rlw6534 You actually should't brake anything. Added an instruction how to backup EFS and persist.
OK. Tried to flash on a clean, freshly wiped system (Flo 32G), all stock, ext4 on cache and Data, TWRP 3.2.3-0. Got the following:
******Applying dark magic******
This is not a Nexus 7 (2013)
Updater process ended with ERROR: 1
How to restore files, that we copied from our tablet using dd command ? (I haven't done anything yet. Just asking)
Sent from my whyred using XDA Labs
@rlw6534 your partition table was modified.
@MikiGry same commands, just switch paths.
Clamor said:
@rlw6534 your partition table was modified.
@MikiGry same commands, just switch paths.
Click to expand...
Click to collapse
Do you mean that despite this error message:
******Applying dark magic******
This is not a Nexus 7 (2013)
Updater process ended with ERROR: 1
The partition table has been modified correctly?
@lollyjay No it wasnt. Package has 2 step security system. It checks if partition table was modified and in what way (by package itself, by user or it is stock). Second step is that package itself doesn't modify anything, it needs manual confirmation in terminal, else no changes will be applied.
Clamor said:
@lollyjay No it wasnt. Package has 2 step security system. It checks if partition table was modified and in what way (by package itself, by user or it is stock). Second step is that package itself doesn't modify anything, it needs manual confirmation in terminal, else no changes will be applied.
Click to expand...
Click to collapse
Thanks
So do I NOT flash the modded twrp first?
Your instructions said to flash it after reboot to recovery
@lollyjay actually it shouldn't metter, but after would be better
Clamor said:
@lollyjay actually it shouldn't metter, but after would be better
Click to expand...
Click to collapse
I'm going to do this when I get home. This might mean that flo/deb will get Android 9 Pie
@lollyjay look through UA ROM thread I wrote there about P on flo/deb
Clamor said:
@lollyjay look through UA ROM thread I wrote there about P on flo/deb
Click to expand...
Click to collapse
Sorry but can you give me a link?
Clamor said:
@rlw6534 your partition table was modified.
@MikiGry same commands, just switch paths.
Click to expand...
Click to collapse
I have previously used sysrepart.zip and sysrepartundo.zip from this thread, although not recently:
https://forum.xda-developers.com/showpost.php?p=76278047&postcount=19
I returned it to stock a while back (827MB). Perhaps I need to sgdisk a stock partition table?
@rlw6534 Every manual repartition or repartition made not by my pack needs an individual look and partition table restore.
@lollyjay here
Clamor said:
@rlw6534 Every manual repartition or repartition made not by my pack needs an individual look and partition table restore.
@lollyjay here
Click to expand...
Click to collapse
OK. Here is my partition layout. My userdata appears to be smaller than stock, but there isn't enough room on mmcblk0 to increase it to the size that your script is looking for. I have no idea how that could have been changed without bricking the tab. Everything else looks normal. Ideas?
Code:
Model: MMC MMC32G (sd/mmc)
Disk /dev/block/mmcblk0: 30937186304B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 67108864B 156745727B 89636864B fat16 radio
2 201326592B 204472319B 3145728B modemst1
3 204472320B 207618047B 3145728B modemst2
4 268435456B 283795455B 15360000B ext4 persist
5 335544320B 336343039B 798720B m9kefs1
6 336343040B 337141759B 798720B m9kefs2
7 402653184B 403451903B 798720B m9kefs3
8 403451904B 406597631B 3145728B fsg
9 469762048B 471298047B 1536000B sbl1
10 471298048B 472834047B 1536000B sbl2
11 472834048B 474931199B 2097152B sbl3
12 474931200B 480174079B 5242880B aboot
13 480174080B 480698367B 524288B rpm
14 536870912B 553648127B 16777216B boot
15 603979776B 604504063B 524288B tz
16 604504064B 604505087B 1024B pad
17 604505088B 606041087B 1536000B sbl2b
18 606041088B 608138239B 2097152B sbl3b
19 608138240B 613381119B 5242880B abootb
20 613381120B 613905407B 524288B rpmb
21 613905408B 614429695B 524288B tzb
22 671088640B 1551892479B 880803840B ext4 system
23 1551892480B 2139095039B 587202560B ext4 cache
24 2147483648B 2148532223B 1048576B misc
25 2214592512B 2225078271B 10485760B recovery
26 2281701376B 2281709567B 8192B DDR
27 2281709568B 2281717759B 8192B ssd
28 2281717760B 2281718783B 1024B m9kefsc
29 2348810240B 2348843007B 32768B metadata
30 2415919104B 30937169407B 28521250304B ext4 userdata
@rlw6534 Thanks!

[RECOVERY][DUALBOOT][Unified][A10][A11][OOS11]Orangefox-DualBoot-Unified-Reborn[21-03-2021]

{
"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"
}
Orangefox-DualBoot-Guac-Unified - Android 10/11 version
THANKS TO:
- Zackptg5 - The father of this mod
- DrakePL (Orangefox Recovery)
- Ae3NerdGod, Neel P, Whismasterflo
- Muphetz, Varun Soma, Pranav - for testing
#include <std_disclaimer.h>
/*
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
Click to expand...
Click to collapse
Modified recovery and installer script for all OP7/Pro/5G variants that re-purposes userdata for true dual booting. You can still use this as a regular stock twrp zip - one stop shop for magisk, verity, and/or forced encryption modifications
Disclaimer
I am not responsible for anything bad that happens to your device. Only experienced users should be using this mod
This is no walk in the park mod. Although I have extensively tested it, there is always the possibility of a brick with anything that involves repartitioning. Make sure you have a backup and know how to reparititon your phone back to stock (there's a guide at the end of this readme with the basics)
YOU'VE BEEN WARNED - Use at your own risk
Click to expand...
Click to collapse
Limitations
If you set a password, regardless of encryption status, it'll corrupt the other slot if it's also password protected.
Note that some roms set one automatically Either don't use a password on one slot, or leave one slot (I'll use 'a' in this example) unencrypted and:
Setup rom, password, and everything on slot a
Boot back into twrp, choose common data as storage, and backup userdata (if not using a/b/c layout, backup TWRP folder to your computer)
Setup rom, password, and everything on the other slot (b)
Boot back into twrp, switch back to slot a (reboot back into twrp), and restore the twrp backup
If you messed this up and are unencrypted - delete these files in /data/system if present: locksettings.db gatekeeper.password.key password.key gatekeeper.pattern.key pattern.key gatekeeper.gesture.key gesture.key
If you messed this up and are encrypted - you lost the data on that slot:
Unmount metadata in twrp gui
Format metadata with this command:
Code:
mke2fs -t ext4 -b 4096 /dev/block/sda$metadata_partnum
where metadata_partnum is the partition number of the current metadata partition (you can find this with sgdisk /dev/block/sda --print). DO NOT FORGET THE PARTITION NUMBER. If you do, you'll format all of sda which results in a brick
Reboot into twrp and format data in gui
Storage settings only supports 128 and 256gb userdata partitions
Just a cosmetic issue as it'll say that system is taking up the difference
Some other features/notes
Can choose between stock layout, a/b userdata, or a/b/c userdata where 'c' is a common data partition that'll show up in both roms - it's quite handy
Option to choose between ext4 and f2fs
Disables verity - fstabs are modified for dual boot and so this is a must unless you choose stock layout in which case it's optional
Option to disable forced encryption
Option to install magisk
Quickmode for faster rom testing
Failsafe to keep from changing slots automatically when used in conjunction with rom install
Common Data
If you choose a/b/c layout - you'll have a/b userdata, but you'll also get a 3rd userdata partition I call 'Common Data'
The name 'Common Data' gives away its purpose - to store files that you'll access on both slots/roms. So stuff like zips, pictures, music, TWRP backups, etc.
In TWRP, this shows up as another storage option for backup/restore and on your pc as well - your phone will have 'Common Storage' and 'Internal Storage'
In order to be accessible when booted, some parts of the system are modified so that the it'll be accessible WITHOUT root by the following mechanisms:
​
The common data partition is mounted to /sdcard/CommonData
.nomedia file is placed in CommonData so files in it won't be picked up twice if you decide to mount over internal storage as outlined below
Furthermore, if your use case is like mine where my music files are in common data, you can make 'mounts.txt' file in /datacommon containing a list of every FOLDER to mount directly over top of sdcard. So for example:
/datacommon/Music -> /sdcard/Music
This of course mounts over anything there (overwrites it for as long as it's mounted) so make sure that you don't have the same folder in both datacommon and regular data
Note that there are 3 exceptions to this folder mounting rule:
All - if this is the FIRST line, ALL folders in datacommon will be mounted
Android
lost+found
The reasoning should be obvious - lost+found isn't something you should need to mess with and Android is for regular data partition only - that's OS specific and should be on separate slots
Note that you should have 1 folder listed on every line, for example:
PHP:
Music
Pictures
ViPER4AndroidFX
Flashing Instructions (if Android 11, see second post)
You MUST be booted into TWRP already when flashing this zip (you can grab a bootable twrp image from here)
Since this modifies data - the zip CANNOT be on sdcard or data at all UNLESS you do not want to repartition/format
If you flash from data, the zip will copy itself to /tmp and instruct you to flash it from there OR you can just install twrp/magisk/disver-fec
You could do the above or copy it to a place like /dev or /tmp and flash it from there
Alternatively, you can adb sideload it
Read through ALL the prompts - there's lots of options
How to Flash Roms
Nothing changes here except ONLY FLASH IN TWRP
Roms always flash to the opposite slot. Keep that in mind and you'll be fine
So don't take an OTA while booted - boot into twrp, switch slots, reboot into twrp, flash rom
Normal flash procedure:
Boot into twrp
reboot into twrp selecting slot you do NOT want rom installed to
Flash rom
Flash this zip
Reboot into twrp
When using failsafe mode,
TWRP will boot into the slot you were in BEFORE you flashed the rom.
TWRP will almost certainly show the incorrect "current slot" at the reboot menu.
The slot selection buttons still work. If youve kept track in youre head, and the zip didnt fail; pick the correct slot now
or reboot to recovery, then switch into the slot which contains the new rom youve just installed
Flash everything else
Quickmode usage NOT RESPONSIBLE FOR BUGS, BRICKS OR MISTAKES! USE AT OWN RISK!
Change the zip name to enable quickmode options (Case Sensitive!)
keeps current layout
add the words fast or quick in the zip file to enable quickmode with the following default options:
ForceEncryption disabled for both slot
s​
Magisk installed to both slots
add any of the following options to the name of the zipfile to custimize quickmode to your liking, capitilizing the letter of the slot youd like to enable that option for:
fec.ab will ENABLE force encrytion for the capitalized slot letter
su.ab or magisk.ab will ENABLE the installation of magisk for the capitalized slot letter
Example: if the file is named Orangefox-DualBoot-fast-fec.AB-su.aB.zip then:
ForceEncryption will be ENABLED on both slot _a and slot _b
Magisk will be installed on slot _b, but NOT installed on slot _a
ADVANCED USERS ONLY NOT RESPONSIBLE FOR BUGS, BRICKS OR MISTAKES! USE AT OWN RISK!
confirm.y will skip the final confirmation before any work is done, and run the options chosen or defaults if none specified
the word warp this can be used instead of fast or quick and confirm.y if you'd also like to use quickmode without confirmation
Failsafe usage / explaination
I've had a few instances where a rom doesnt agree with whats going on, and the dualboot zip gets stuck on a slot and never finishes. This results in forcing the phone off, and leaves the phone in a non bootable state, with an unprepared slot. Not to mention a stock, or worse, no recovery at all. Bootloop city.
Enter the failsafe option: just add ` nofail ` or ` failsafe ` (case sensitive) to the zip name like above, and the zip will revert the slot change caused by the rom install and keep you able to boot back into the current slot's TWRP so you can sort out the slot youre working on. Pair this with a usb drive or commondata, and youre (relatively) safe to flash on the go, or from your bed with the computer off.
Notes
After applying the failsafe, the reboot screen in TWRP will ALMOST CERTANLY show the incorrect slot until you either manually select a slot or reboot recovery.
This adds a step or two to the flashing process, make sure you've read that.
[/QUOTE]
Help! I Can't Boot!
Usually this is because you switched roms without formatting data first. This should be flashing 101 but we all forget sometimes. Plus this slot stuff can get confusing
If it only happens with a/b/c and not any other layout, there's a good chance it's selinux related. Try setting selinux to permissive at kernel level with this mod (source here).
Click to expand...
Click to collapse
How to Manually Repartition Back to Stock
In the event any step in the repartioning fails, the entire installer aborts. The good news is that this prevents a potential brick. The bad is that you need to manually revert back
Boot into twrp. If sgdisk is not present in sbin, grab it from this zip (in tools) and adb push it to /sbin and chmod +x it
sgdisk /dev/block/sda --print Note that /dev/block/sda is the block that userdata and metadata are stored on - no other block is touched by this mod. This will show up the current partition scheme. Stock looks something like this (on OP7 Pro):
PHP:
Number Start (sector) End (sector) Size Code Name
1 6 7 8.0 KiB FFFF ssd
2 8 8199 32.0 MiB FFFF persist
3 8200 8455 1024.0 KiB FFFF misc
4 8456 8711 1024.0 KiB FFFF param
5 8712 8839 512.0 KiB FFFF keystore
6 8840 8967 512.0 KiB FFFF frp
7 8968 74503 256.0 MiB FFFF op2
8 74504 77063 10.0 MiB FFFF oem_dycnvbk
9 77064 79623 10.0 MiB FFFF oem_stanvbk
10 79624 79879 1024.0 KiB FFFF mdm_oem_dycnvbk
11 79880 80135 1024.0 KiB FFFF mdm_oem_stanvbk
12 80136 80263 512.0 KiB FFFF config
13 80264 969095 3.4 GiB FFFF system_a
14 969096 1857927 3.4 GiB FFFF system_b
15 1857928 1883527 100.0 MiB FFFF odm_a
16 1883528 1909127 100.0 MiB FFFF odm_b
17 1909128 1913223 16.0 MiB FFFF metadata
18 1913224 1945991 128.0 MiB FFFF rawdump
19 1945992 61409274 226.8 GiB FFFF userdata
You may have different size userdata - mine is 256gb - depending on your device but that doesn't matter. You just need to see where they're located
Take note of the number (I'll call userdata_num for the sake of this tutorial) and start sector (userdata_start) for the first partition AFTER rawdump, and the end sector (userdata_end) of the last parititon on sda
sgdisk /dev/block/sda --change-name=17:metadata - renames metadata partition back to non-ab stock
sgdisk /dev/block/sda --delete=19 - this deletes the entire partition - use this command for each user/metadata partition after rawdump (ones generated by this zip)
sgdisk /dev/block/sda --new=$userdata_num:$userdata_start:$userdata_end --change-name=$userdata_num:userdata - this creates the new userdata partition
Final step is to format the new userdata partition: mke2fs -t ext4 -b 4096 /dev/block/sda$userdata_num $userdata_size - where userdata_size can be calculated with this shell command: sgdisk /dev/block/sda --print | grep "^ *$userdata_num" | awk '{print $3-$2+1}'
​
MAKE SURE YOU VERIFY ALL VARIABLES HERE ARE SET PROPERLY - if you mess this up, you could format all of sda resulting in a brick
Run sgdisk /dev/block/sda --print again to make sure everything is correct and then reboot back into twrp
Changelog
Click to expand...
Click to collapse
21/03/2021 - V1.8
Updated companion app to 2.8.7
05/03/2021 - V1.6
Updated init.mount_datacommon.sh to support the application sharing
Updated the dual boot companion app V2.6 BETA
Added mounting inactive system to sdcard/DualBoot/
Added mounting inactive SDcard to sdcard/DualBoot/
EXPERIMENTAL - Added application sharing between ROMs (Only A/B/C Layout)
Localizations update
Minor bugfix here and there.
13/02/2021- V1.5
Updated the dual boot companion app V1.7.2
Updated Orangefox recovery to latest git
06/02/2021- V1.3
Updated the dual boot companion app
Fixed the Orangefox full screen bug on OP7 pro
05/02/2021- V1.1
Added the dual boot companion app
Fixed the OOS11 flashing bug
20/01/2021- V1.0
It works with OxygenOS 11 ( WARNING: --- Stay unencrypted! --)
Magisk 21.4 updated
New version of Orangefox recovery (R11) - 20-01-2021 update
Know bug: Flashing from OOS11 slot can overwrite the same slot.
19/11/2020 - A11-0.4
Fixed root install for Android 11
Minor improvement
21/10/2020 - A11-0.4
Root not installed if Android 11 - Please do it manually.
CommonData mount fix in Android 11
Minor improvement
Android 11: please install Magisk 20422 and MagiskManager 297
16/10/2020 - A11-0.2
Changed to OrangeFox Recovery
Added check to get the right initrc (Android 11 compliant)
16/10/2020 - A11-0.1
Initial release
Click to expand...
Click to collapse
Download
Orangefox-DualBoot-Guac-Unified-A11-V1.8
GitHub
https://github.com/Invernomut0/OrangeFox-DualBoot-Guac-Unified
Telegram support chat: https://t.me/OrangeFoxDualBootRebornOnePlus7
XDA:DevDB Information
Orangefox-DualBoot-Unified, Tool/Utility for the OnePlus 7
Contributors
invernomut0
if you like my work, send me a beer
Click to expand...
Click to collapse
DUALBOOT COMPANION APP
FLASH PROCEDURE - Android 11
Related to Orangefox-DualBoot-Guac-Unified-A11.zip
WARNING: OOS11 --- Stay unencrypted! ---
Example (starting point)
Slot A A10 Rom
Slot B A10 Rom
1 - Flash from slot A A11/OOS11 rom
2 - Flash Orangefox-DualBoot-Guac-Unified-A11.zip
3 - Reboot to recovery (Now you are in slot B automatically)
4 - Format data
5 - Flash Orangefox-DualBoot-Guac-Unified-A11.zip
7 - Reboot to system
Install magisk manager attached
Ending point
Slot A A10 rom
Slot B A11/OOS11 rom
Now you should have a working A10 rom on slot A and a working A11/OOS11 rom on slot B.
Please report any problems.
Reserved
I am on oos a10, rooted, twrp and encrypted... Can i use this for dual boot oos a10 with some custom a11 without having to decrypt/data loss???
kpmohamedhussain said:
I am on oos a10, rooted, twrp and encrypted... Can i use this for dual boot oos a10 with some custom a11 without having to decrypt/data loss???
Click to expand...
Click to collapse
Hi. All your data will be wiped and you have to reinstall both slots OS since this is repartitioning your userdata into A and B so do a Backup of all your data before.
It works great with A10 and A11. I had a little issue because I had A10 on A and B slot and when flashed this, then A11 ROM, rebooted to other slot flashed this again A11 was working great, but when tried to switch back to the slot with A10, after boot my pin wouldn't work anymore, so needed to delete locksettings.* an *.key files from /data/system.
Thanks for the great job!
vladvlad12 said:
It works great with A10 and A11. I had a little issue because I had A10 on A and B slot and when flashed this, then A11 ROM, rebooted to other slot flashed this again A11 was working great, but when tried to switch back to the slot with A10, after boot my pin wouldn't work anymore, so needed to delete locksettings.* an *.key files from /data/system.
Thanks for the great job!
Click to expand...
Click to collapse
Only set a PIN on one of the slots. Otherwise you will have that issue that your PIN does not work anymore on the other slot if you set it on both!!
Does anyone have OOS Open Beta 17 or 18 working with this recovery?
ImamBukhari said:
Does anyone have OOS Open Beta 17 or 18 working with this recovery?
Click to expand...
Click to collapse
I will try it for you, be back in like 10 minutes with edit.
Back, is not working. It stuck at patching fstabs.
vladvlad12 said:
I will try it for you, be back in like 10 minutes with edit.
Back, is not working. It stuck at patching fstabs.
Click to expand...
Click to collapse
Take a look at the recovery.log in /tmp then to check while it is getting stuck.
Wishmasterflo said:
Take a look at the recovery.log in /tmp then to check while it is getting stuck.
Click to expand...
Click to collapse
Ok, just give me a minute, already installed another ROM, will try to give info u asked in a few minutes. Someone told me when i tried to do same with twrp dual boot that twrp can't yet decrypt OOS Beta 17 and 18
IDK what happened but now my touchscrren is not working...
After stuck at patching I rebooted into fastboot changed active slot to other slot, rebooted into recovery, it enter in OrangeFox Recovery but no touch...
Got a bit scared there... Rebooted to system then back to recovery and touch is working now...
But there is no /tmp folder...
vladvlad12 said:
I will try it for you, be back in like 10 minutes with edit.
Back, is not working. It stuck at patching fstabs.
Click to expand...
Click to collapse
Could you please also provide the postition of init.rc. look at /init.rc and check if the file exists.
invernomut0 said:
Could you please also provide the postition of init.rc. look at /init.rc and check if the file exists.
Click to expand...
Click to collapse
Dualboot still no work with oos beta 17 and 18,,its always stuck when patching fstab ( decrypt).
There's init process called High Assurance Boot (HAB) that verify your system's integrity. Check the script "/vendor/etc/init/hw/init.mmi.hab.rc".
This command show many values, which one to pick.
gdisk /dev/block/sda --print | grep "^ *$userdata_num" | awk '{print $3-$2+1}'
edit: typo, worked fine now...
Tried it with Beta 19 and doesn't work with that either
Download link not working - Magisk 20422 and MagiskManager 297
ImamBukhari said:
Tried it with Beta 19 and doesn't work with that either
Click to expand...
Click to collapse
Do you have OP7 or OP7 pro/T?
invernomut0 said:
Do you have OP7 or OP7 pro/T?
Click to expand...
Click to collapse
I'm using a 7 Pro
kpmohamedhussain said:
Download link not working - Magisk 20422 and MagiskManager 297
Click to expand...
Click to collapse
Files restored
Works great, tested with multiple ROMs...
Having below issues
1. Even if pin not setup in secondary ROM, need to delete files otherwise pin in primary is not accepted
2. After every flash of this recovery, all my magisk settings, modules are all lost
3. Images and videos in common data not visible in gallery

Categories

Resources