[Galaxy S II Original Android Development] Lanchon:
thanks orlando, now i finally know what misc is and how we deal with it in misc-less devices. i always knew there was a flag to talk to the bootloader somewhere, but didnt know where. also, i now know why i9100 recoveries always mount /cache during boot :)

> One way I tested to switch to emulated storage is to format /data in TWRP.

it's great that this tested ok. but people will want to migrate editing the existing xml file. a flashable zip that does that would be great, please see the OP for more info on doing that.

> In this build I replaced CM-recovery with TWRP 3.0.3 with emulated storage support.

WARNING!!! most people will believe that they are running emu build with your rom, when in fact they are running whatever non-emu isorec TWRP they had flashed before your rom. wiping data on the non-emu TWRP will erase their old sdcard!!! to remove your separately-flashed isorec recovery and run the recovery bundled with the rom (which supports emu in this case), please flash this:

https://www.androidfilehost.com/?fid=24369303960682947

when things settle, you should probably provide a separately-flashable isorec TWRP. please mark the isorec with "EMU" visible in the UI as part of the version info, PLEASE! it will save a lot of confusion down the road.

> I didn't had the time yet to check REPIT

you just download the REPIT zip, rename it (as a poor man's way of passing parameters to it) according to the OP, charge batt and plug into a power source, and flash it.

> I had to update fstab to get sdcard0 visible in emulated storage mode.

> repit intSD to 8mb-swap leads to corrupt SD message in OS and can't be formatted within OS (wasn't possible in cm13 either). Although can be formatted through recovery (isorec-twrp). After fixing intSD in twrp, the access of intSD within OS is possible again. Formatting within OS still not working (neither as portable, nor as internal).

orlando, as per the optional test procedure in the OP, by "repit intSD to 8mb-swap" he means resize sdcard partition to 8MB *and* changing its type to "swap". the idea of the change is wiping the FAT fs and replace it with anything that cannot be mounted (such as a linux swap header).

so users wont want to see the old vestigial sdcard in the android UI after they migrate. one very valid way of doing this is removing the entry from android's fstab. another is wiping the FS, but this gives trouble as described above by the tester.

so... what i suggest is either of these options:

- remove sdcard from Android's fstab. in the emu build, i don't see much reason to have it. data migration from non-emu to emu should be done in twrp anyway, because android's FUSE blocks access to certain parts of the internal sdcard, whatever that is, through permission synthesis.

- change the fstab so that sdcard is seen as "removable" by android. i guess this should stop android from complaining if it can't mount it on boot, make it mostly disappear from the UI (except in the format storage UI), and make the "format storage" UI work. (BUT BEWARE: android could eff up and do something horrible to your phone if you format a "removable" sdcard that is actually an internal partition. shouldn't, but till we test, who knows. proceed with caution.)

thanks!