yashsingh1/xdaforums huggingface dataset:
[Galaxy S 4 i9505 Original Android Development] Pcsx2006:
Ok I got it thanks
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
[MENTION=5207461]Salman A.[/MENTION] [MENTION=5048731]911-Future_Maker[/MENTION]

It turns out the SD card corruption issue is not specific to MTK devices. I was able to reproduce the issue with the stock ROM on my S7 Edge when booting from an extsd-slot.

Anyway... the issue is fixed in the latest snapshot (9.0.0.r71.g0e7407e)! Just update the ramdisk and you should never see that notification again.

It was just 2 lines that caused all the trouble: https://github.com/chenxiaolong/DualBootPatcher/commit/e8544a497aafb7af499a8c36b53295a01c43cc14
[Galaxy S 4 i9505 Original Android Development] kopitalk:
What's the purpose of updating ramdisk from within the app?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
It updates all the multiboot binaries, allowing you to get the latest changes without needing to repatch and reflash the ROM.
[Galaxy S 4 i9505 Original Android Development] kopitalk:
When you say the latest changes, do you mean that of the dual boot patcher? That's cool :good:

Edit: I suppose we can update the ramdisk without having to boot into each rom?
[Galaxy S 4 i9505 Original Android Development] 911-Future_Maker:
[MENTION=4277844]chenxiaolong[/MENTION] Hooray bro, I'm glad you keep an eye of this problem thanks! Will try this build and will report. Hope for the best. :fingers-crossed:

---------- Post added at 11:19 ---------- Previous post was at 11:08 ----------

Incorrect. Guys listen to me please..I'm kind of multiboot maniac lol. :D Flashing in twrp (or whatever custom recovery) works and it's even better sometimes when in-app flashing is having issues for some reason. Just make sure you patch the rom for the corresponding slot. The code mbtool is written in by [MENTION=4277844]chenxiaolong[/MENTION] is intelligent enough to don't touch any other rom except the one it was patched for.
[Galaxy S 4 i9505 Original Android Development] dave7802:
Holy Moly

My S7 Edge has just dual booted.

Amazing!!! Thanks [MENTION=4277844]chenxiaolong[/MENTION] Beer incoming

For anyone who has issues finding ROMS it will work on, The two i used as a Test:

Superman ROM as Primary:

http://xdaforums.com/s7-edge/development/rom-s7-edge-rom-v1-1-t3356699

SuperStock ROM: (Data Slot 1) - Experienced issues as SD Card for Storage, But need to revisit and test properly.

http://xdaforums.com/s7-edge/development/rom-superstock-rom-g93xf-bpif-11-oct-t3478202
[Galaxy S 4 i9505 Original Android Development] hellwing:
Xiaomi redmi 3s

Can you add support of my phone?
[Galaxy S 4 i9505 Original Android Development] monkteo:
You use the last patch ?

or which one ?

THX
[Galaxy S 4 i9505 Original Android Development] dave7802:
If this was a reply to me, I used the latest Build yes (Yesterday)

9.0.0.r71.g0e7407e Mon, 7 Nov 2016 23:02:59 -0500

Dont forget to update ramdisk
[Galaxy S 4 i9505 Original Android Development] monkteo:
Yes and THX ! (press the wrong button):good:
[Galaxy S 4 i9505 Original Android Development] welder73:
Thank you for the answer :svetius:

Oh,I don't have Samsung,I have LG G4,but I think it doesn't matter because I can boot two roms with Dual Boot Patcher...

I'm asking because I wanna keep my stock rom intact and flash another stock based rom on data-slot with TWRP...

I can flash and boot CM and AOSP roms but I can't flash that stock based rom because it has an Aroma installer and it isn't supported by Patcher.
[Galaxy S 4 i9505 Original Android Development] dave7802:
The way around this (I have not tired, but should work)

Install you ROM via Aroma, set it up, Install Dual Boot Patcher and Backup ROM within Patcher app.

Wipe install Stock, Setup and install Dual Boot Patcher.

Set Kernel, Then restore from Backup on Data Slot 1.

Its a long way around,
[Galaxy S 4 i9505 Original Android Development] monkteo:
Fail to switch (in the rest OK)

Install dualboot-set kernel-update ramdisk-patch rom-flash-and fail to switch.
[Galaxy S 4 i9505 Original Android Development] dave7802:
N7, is nauget right? 7.0

Try a TW, 6.0

The reason is kernel I belive, there is specific changes just for the N7 ports. I had no luck getting a N7 to work, but I have not had alot of spate time, enough to try the basics and see what what before going into the untested area
[Galaxy S 4 i9505 Original Android Development] welder73:
I believe that would be successful but I don't want to wipe my stock rom...
[Galaxy S 4 i9505 Original Android Development] dave7802:
Backup your stock and do the same thing...... More stages and more disk space though.
[Galaxy S 4 i9505 Original Android Development] bvlgvr:
TWRP source code for serranoltexx

I wasn't sure who to ask ... but is this maybe the source code you need?

https://github.com/Eskuero/android_kernel_samsung_serranoltexx

The link is from this post here on [DEV]How to compile TWRP touch recovery:

http://xdaforums.com/showpost.php?p=48766185&postcount=257

Thanks again.
[Galaxy S 4 i9505 Original Android Development] ewangw:
[MENTION=4277844]chenxiaolong[/MENTION], so I have nougat running on my MXP but it took some doing. Getting it to work in anything other than primary slot was impossible for me because mounting /modem /firmware would always fail. The overall ROM would load, but without the firmware it would not recognize SIM, Baseband, etc.

To get this going, I ended making a backup of my MM Stock 6.0 in DBP just saving the boot and System on ext-sd. I then factory reset my phone and sideloaded my chosen nougat ROM, which worked without any issues (not sure if I got lucky or not). So, I now have AICP 12.1 loaded as primary, was able to restore apps through TiBu, and also installed 9.0.0.r69.gfcd8ec1. From there, I was able to restore my MM Stock from the backup I made in DBP in the data slot. I haven't tried extsd slots yet, but will give it a go soon. For now, I still can't load any other Nougat ROMS in any of the slots because of the /firmware issue. Well, they load, just no SIM or baseband. I did try sideloading one of the patched files, but it didn't work out. Any suggestions?

Thanks for all the hard work on DBP!
[Galaxy S 4 i9505 Original Android Development] niufy:
I managed to dual boot with some different roms and everything its ok. But i cant install different kernel from primary one to others roms (data slots) on s7 edge
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Ok, this looks good so far. Can you grab a logcat during boot? I'm willing to bet it's failing on a different issue now, probably because the card is being mounted with the exfat driver as you said. The exfat driver on your device might support both exFAT and FAT32.

EDIT: This test build contains a hack to try FAT32 before trying exFAT: https://jenkins.noobdev.io/job/Dual...tcher-builder && fast,target=android-all-gcc/
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
TouchWiz 7.0 beta? No problemo :)

I should be able to make a test build that supports TW 6.0/7.0 beta on Friday or Saturday. This build will require heavy testing from everyone, even those who do not have Samsung devices. The way SELinux is handled has changed significantly and has thus, has a higher chance of breaking things than usual.

Technical changes: https://github.com/chenxiaolong/DualBootPatcher/issues/90

Screenshot:
[Galaxy S 4 i9505 Original Android Development] 911-Future_Maker:
[MENTION=4277844]chenxiaolong[/MENTION] As always you're a genius dude! The test build r72 worked! :highfive: No corruption issue even on extsd-slot now, great! I'd still grab a logcat and will post here to find out why is this happening. Cheers.

Edit: Just went back to r71 to reproduce the problem and to grab the logcat. According to the liveboot.log mbtool tries and successfully mounts the fat32 partition as exfat.

11,2441,1538292,-; (4)[1:init]mblog: [Attempt 1/10] Finding and mounting external SD
11,2442,1538364,-; (4)[1:init]mblog: Matching devices against pattern: /devices/mtk-msdc.0/11240000.MSDC1*
11,2443,1543446,-; (4)[1:init]mblog: /default.prop contains fuse-exfat override: false
11,2444,1543476,-; (4)[1:init]mblog: Using fuse-exfat: 0
4,2445,1543753,-; (4)[1:init][EXFAT] trying to mount...
4,2446,1544250,-; (4)[1:init][EXFAT] mounted successfully
3,2447,1544401,-; (1)[0:swapper/1][SOFTIRQ DURATION WARN] SoftIRQ:9, dur:5261693 ns > 5 ms,(s:1539130922,e:1544392615)
11,2448,1548868,-; (4)[1:init]mblog: Successfully mounted /dev/block/mmcblk1p1 (exfat) at /raw/extsd
11,2449,1548917,-; (4)[1:init]mblog: Successfully mounted partitions

Also you know I already asked this in the past, but as we're now on v9 and v10 is coming is it still not possible to tweak the mbtool to dynamically create the system.img on extsd? I'm interested in this because now I have 2.5GB system images, but in fact the /system is only using 700MB-1GB.

And something I'm curious about. Is it possible to implement the backup/restore functions in the aroma installer? Because I found out something interesting. Sometimes the backup hangs, I'm waiting a bit ~30sec-1min, still no go and then the only choice I have is to kill the patcher's process. I thought the backup failed, but when trying to restore it restores the rom 1:1 with all user apps and settings, so the patcher freezes, but it's actually working in the background. If backup in recovery is possible I might be able to bypass this. The backup hangs only on K6000 Pro and not on K3 Note and only when backing up things in /data. Probably some permission issue with the /data partition.
[Galaxy S 4 i9505 Original Android Development] ceanth:
I switched ROMS on my LG in order to grab some files required for MIUI build, once I restored my backup I had the same PIN issue, I did manage to delete the .key file and got back into my backup rom however now I cannot setup a new pin. When I go to setup a new pin the device tells me that there is a pin already setup and I need to enter this again, is there any other location that you know of which contains the pin/key? I am running CM14.1 so maybe there have been some changes in the new version of Android.
[Galaxy S 4 i9505 Original Android Development] nikkali25:
Good day sir.Can we request for lenovo k4 7010a48?
[Galaxy S 4 i9505 Original Android Development] MrHomebrew:
Ready to test any time
[Galaxy S 4 i9505 Original Android Development] MrHomebrew:
I am on the Galaxy S7 edge 7.0 Nougat update.

Not working.

Which build should I use.

Or do we need to add compatibility?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
It's not released yet.
[Galaxy S 4 i9505 Original Android Development] MrHomebrew:
Thought so.

Let me know when it is ready and I will do some testing
[Galaxy S 4 i9505 Original Android Development] yfriday14:
When do I need to force ram update?

Do I need to boot into each slot and make ram update, or it is enough to do it from actual rom?

This is not described in descriptions.
[Galaxy S 4 i9505 Original Android Development] saszseb:
Yes.

---------- Post added at 11:16 AM ---------- Previous post was at 11:13 AM ----------

No, it won't.
[Galaxy S 4 i9505 Original Android Development] yfriday14:
Not sure. [MENTION=4277844]chenxiaolong[/MENTION] wrote, that the primary rom is also needed to be patched.

If primary rom is not patched, can cause problems.

So the primary rom can not be left untouched.
[Galaxy S 4 i9505 Original Android Development] saszseb:
You wrote about secondary ROM.
[Galaxy S 4 i9505 Original Android Development] yfriday14:
The stock rom must be patched, too.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
The S7/TW 6.0 test builds have been delayed. I ran into some pretty major problems (no ADB, no writing to /sys) with TW 7.0 despite it booting, so I'll need a few more days to workaround the issue.
[Galaxy S 4 i9505 Original Android Development] pehoko:
How to back up original rom to boot from TWRP as seem that secondary that I added as data slot not working and booting?

... I have performed restore backup, no need to answer, tnx.
[Galaxy S 4 i9505 Original Android Development] Weathon:
I have the same problem,

but i can't for me your solution also doesnt work :/ any workaround other than patching it on windows?
[Galaxy S 4 i9505 Original Android Development] tomazf:
hello,

in my sgs4, the primary rom is optimized cm13 an secondary is samsung stock 4.4. everything works, but there is a problem with memory, in sd card there is writted 7,8 GB as normal and in common memory tehere is 0mb.

it wouldn't represent a problem, but i can not use dualbook apk in second rom, eventhougt it is installed and can be clicked. it is working, but when i want to switch roms it just stops working and the app is closed.

any help would be appreciated, how to make it work (dualboot apk in secondary rom).

thanks
[Galaxy S 4 i9505 Original Android Development] Technical:
Definitively, patcher does not work on Asus Zenfone 2 ZE551ML with MM bootloader.

Nor a single ROM works as primary as when ramdisk is updated, phone always boot on TWRP.
[Galaxy S 4 i9505 Original Android Development] gc_geforce:
I have the same problem, it patches done and it installs fine and then booting will try the kernel message and then it reboots into recovery.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Test/beta builds for the upcoming 9.1.0 builds are ready for testing! https://github.com/chenxiaolong/DualBootPatcher/pull/299

NOTE: While this release focuses on TouchWiz 6.0 and 7.0 support, a significant part of the code for handling SELinux has been changed. This affects

every

device, so please test if you can! And be sure to have a backup!

Changes:

Add support for TouchWiz 6.0 and 7.0 beta

Add support for Boot UI on the S7 Flat/Edge

Add support for patching zipped Odin images (including ones with multiple *.tar.md5 files)

Detect filesystem type instead of trial-and-error mounting. This fixes issues where a FAT32 partition may be mounted with the exfat driver.

Fix flashing patched Odin images on certain devices

Fix "cannot connect to mbtool" errors on certain Nougat ROMs

Fix system crash if Samsung pushes out an SELinux policy update

Bugs:

SD card is inaccessible in TouchWiz 7.0 (with stock kernel) when booting from an extsd-slot. This may not be fixable.
[Galaxy S 4 i9505 Original Android Development] yfriday14:
So now I can patch & flash tar based modems, too?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Any reason you need to patch and flash a modem? Do you need different modems for different ROMs?

If so, the patcher doesn't care about the contents of the modem image (whether it is FAT32, ext4, a tarball, etc.). You should be able to copy it to /sdcard/MultiBoot/[ROM ID]/modem.img
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
This is now properly fixed in the test builds at http://xdaforums.com/showpost.php?p=69691865&postcount=10280 :)

This existed in the early days of version 8.0.0, but was removed due to a couple issues:

Any Android 5.0+ ROM that uses the system.new.dat file needs to have an image with the exact size. Otherwise, the flashing process will complete successfully, but the image cannot be mounted. This is because the system.new.dat file represents a compressed 2.5GB image in your case.

To workaround that, I originally had some code to shrink the image to the minimal size after flashing. However, this turned out to be extremely unreliable because more than 80% of the ~50 devices supported at the time were missing a kernel patch and caused the shrunk images to be corrupted. Even up-to-date Nexus devices were affected.

With that said, you can manually shrink the images from recovery. To shrink to the minimum size, run (from adb or TWRP terminal):

resize2fs -M /external_sd/multiboot/[ROM ID]/system.img

or to shrink to a specific size (1500MB in this example), run:

resize2fs /external_sd/multiboot/[ROM ID]/system.img 1500M

Yes, the backup process runs with more permissions than most of Android. It couldn't kill the background process even if it wanted to. :) With that said, I did find out that the freezes are caused by Android trying to kill the background service of the app in order to save power. That should be relatively easy to fix.

I might look into adding it to the AROMA stuff too. It'll just be less useful since you won't be able to specify a backup name, backup location, etc.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
This might be fixed by the 9.1.0 test builds at http://xdaforums.com/showpost.php?p=69691865&postcount=10280.

The issue sounds suspiciously similar to what I encountered when adding support for TouchWiz 7.0. It boils down to Nougat using the new binary /file_context.bin file versus the old text-based /file_contexts file. Some ROMs support both formats, so what the patcher originally did was convert /file_contexts.bin to /file_contexts and then patch that file. However, it seems that some ROMs removed support for the old format, so the test builds add support for properly patching the new format.
[Galaxy S 4 i9505 Original Android Development] rifle007:
[MENTION=4277844]chenxiaolong[/MENTION] can you add support to xiaomi redmi 2 and redmi 3. Please check PM. I attached some logs for both phone. I have add some code for both phone to devices.json and it's worked. Thank you..
[Galaxy S 4 i9505 Original Android Development] yfriday14:
In stock rom modem worked fine, but under Resurrection Remix MM wifi often disconnects.

Just want to test with newest modem, if it fixes the wifi disconnects problem.

---------- Post added at 09:04 AM ---------- Previous post was at 08:40 AM ----------

Could be possible to add command

resize2fs -M /external_sd/multiboot/[ROM ID]/system.img

as a feature into Dual Boot Patcher app?

This would make possible to shrink the non-current rom system images.
[Galaxy S 4 i9505 Original Android Development] monkteo:
good morning so what we have here...................
[MENTION=4277844]chenxiaolong[/MENTION] you are the Man
[Galaxy S 4 i9505 Original Android Development] 911-Future_Maker:
Thanks for your hard work dude! :)

So I can try to shrink the system images, but it's not guaranteed it will work right? Is there a chance the rom I'm shrinking to be messed up to a non working condition?
[Galaxy S 4 i9505 Original Android Development] 911-Future_Maker:
Read carefully. Chen can add it no problem, BUT there is a high chance it won't work because of the kernel of your phone.
[Galaxy S 4 i9505 Original Android Development] yfriday14:
I have a

XXUHPG1_COMBINED.tar

modem file.

It has

modem.bin

and

NON-HLOS.bin

I understand, that I rename modem.bin to modem.img and copy to

/internal/MultiBoot/extsd-slot-cm13/

folder.

But what do I need to do with NON-HLOS.bin?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Ah, I didn't realize you had a Samsung device. Unfortunately, this feature can't work on Samsung devices. The bootloader prevents modems from being flashed unless you're booted into download mode. If you have the files in the right place, it will appear as though it flashed properly, but the device will simply ignore everything that was flashed to the modem partition.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Yup, that's correct. It shouldn't mess up your ROM to a non-working condition because if it's corrupted, it shouldn't mount the image at all. Worst case, you can just reflash the ROM. Always good to have a backup though :)

If you really want to shrink the images, you can do that from a Linux PC or VM with the same command. The kernel bug has been fixed ages ago in desktop Linux distros so you shouldn't run into any issues.
[Galaxy S 4 i9505 Original Android Development] yfriday14:
Thanks for the informations!

1) What if shrink the CM13 image on desktop, then I need to upgrade it?

2) What happens with the shrinked image in case of dirty flash upgrade?

3) what happens in case of clean flashing?

4) Is it expanded automatically?

5) Is it becoming corrupted?

6) What is the name of the kernel bug?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
In every case, it will fail because the image is smaller than what CM13 expects. CM13 contains a compressed version of the (large) image ("system.new.dat" in the zip file) so when it gets flashed to a smaller file, parts of the image will be missing.

It will not be expanded and will most likely get corrupted.

I'm not sure if there's a name for it, but this is the patch that fixes the bug: https://www.redhat.com/archives/dm-devel/2012-June/msg00029.html
[Galaxy S 4 i9505 Original Android Development] MisiekDP:
And now temasek's kernel booted from extsd works fantastic! :laugh:

Thanks! :D
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Yay, finally! :D
[Galaxy S 4 i9505 Original Android Development] MisiekDP:
Good job! You are the best dev I have ever met! Everything works great :D
[Galaxy S 4 i9505 Original Android Development] rifle007:
[MENTION=4277844]chenxiaolong[/MENTION] thanks for add support to redmi 2 and 3 . But sorry i missed some codename redmi 2 for wt8647, the correct is wt86047. And can you add extra path for both phone like tz, tzbak, modem, aboot, abootbak, hyp, hypbak, sbl1, sbl1bak, rpm, rpmbak, cust ? Because it necessary when install MIUI as secondary.

Thanks..
[Galaxy S 4 i9505 Original Android Development] dave7802:
Trying to get MM and N 7.0 to work dual booted.

S7 Edge.

6.0.1 As Primary and 7.0 N for Secondary

Aroma installers, Are they to be avoided as an additional ROM

or is it possible to patch, Boot into TWRP and flash the Aroma installer for an addtional slot Data-1 or Ex-SD-1

Just checking this method, as i have done the above, but switching to secondary ROM, still boots my Primary.

Am wiping the device and starting from fresh using some different ROMs

7.0 as Base and 6.0.1 as Secondary.

Edit: @ chenxiaolong beautiful.

User error, I think the Build numbers never matched up and this is why it failed to boot.

Fresh install, SuperMan Rom for S7 Egde.

After installed, Installed Dual boot, Patched a Aroma Installer (KING_OF_NOUGAT_V2) to be precise.

Booted into TWRP

Installed the ROM via Aroma, Device failed to boot first time.

Rebooted into Recovery (POwer, Vol Down/Vol Up Home)

Used the Aroma to switch to Primary ROM. Once booted i selected the secendary ROM

Update mbtools

Selected Secondary ROM and Rebooted.

Waited about 10 minuets and device booted up.

Dual Booting:

Primary: SuperMan-Rom V1.16 Aroma

Secondary: KING_OF_NOUGAT_V2

Working beautiful so far
[Galaxy S 4 i9505 Original Android Development] monkteo:
:good:

yep with all the rom that I installed in dualboot I do this;

install dualboot - set kernel - patch rom - install patch-rom - update ramdisk for primary and for secondary - change to secondary and boom that it. (short version)
[Galaxy S 4 i9505 Original Android Development] 911-Future_Maker:
[MENTION=4277844]chenxiaolong[/MENTION] I want to report that I successfully resized one of the 2.5gb system images to a custom size of 1.2gb with the 2nd command you provided. I first checked the real space occupied by the system of the particular rom I was going to resize checking the file size of the /system folder in /raw/images. Then when realized that the system was a little less than 1GB I decided to resize it to 1.2GB giving it a bit of room for future installs and stuff. The thing is that I made this while in Android using Terminal. It wanted from me to first run e2fsck to let me proceed further with the resizing. Of course the running rom was different from the one I was resizing. (I was on extsd-slot-sd7 rom while resizing the extsd-slot-sd5). I know you said to do that in recovery or even using Linux. Is that dangerous resizing a file on a mounted partition in Android? Still didn't tried to boot the resized rom, this is what I'm gonna do now lol. :D

Strange to me as I said the size of the system folder in /raw/images previously was ~1GB, but now after resizing it's counting at 390MB, is that a bad sign it won't work when I try to boot it?

Edit: Yup, the rom don't boot :D The system folder in raw/images is 0.0B. It seems Linux is the only help here.