F2FS support - General Omni Discussion

People around i9300 kernel developement backported F2FS and managed to boot modified omnirom.
Should I bring this stuff to upstream?

GR0S said:
People around i9300 kernel developement backported F2FS and managed to boot modified omnirom.
Should I bring this stuff to upstream?
Click to expand...
Click to collapse
f2fs for external SD cards: Sure
f2fs for /data - Not until the next Android revision, you can put all the infrastructure there, but changing from ext4 to f2fs would require wiping /data

Entropy512 said:
f2fs for external SD cards: Sure
f2fs for /data - Not until the next Android revision, you can put all the infrastructure there, but changing from ext4 to f2fs would require wiping /data
Click to expand...
Click to collapse
Wiping is okay.
We can try f2fs on /system, it gets formatted each time anyway. I know it won't give us massive performance boost, but it will be nice start point for now.
Why we can't use f2fs on /data?
Moto X has it already.
PS: can I use debian's arm binaries in recovery? Specifically f2fs tools.

GR0S said:
Wiping is okay.
We can try f2fs on /system, it gets formatted each time anyway. I know it won't give us massive performance boost, but it will be nice start point for now.
Why we can't use f2fs on /data?
Moto X has it already.
PS: can I use debian's arm binaries in recovery? Specifically f2fs tools.
Click to expand...
Click to collapse
Because /data is currently ext4 on the device you specified initially, and you can't change filesystems without wiping. Making users wipe at this point in the 4.4 cycle is NOT OK.
Not much if any benefit of f2fs on /system - Moto G doesn't even use f2fs for /system (it does for /data)

Entropy512 said:
Because /data is currently ext4 on the device you specified initially, and you can't change filesystems without wiping. Making users wipe at this point in the 4.4 cycle is NOT OK.
Not much if any benefit of f2fs on /system - Moto G doesn't even use f2fs for /system (it does for /data)
Click to expand...
Click to collapse
Anythng else? Will it work as intended if I will just patch kernel, patch device, format.
I remember Dees_Troy mentioned /data/media trickery may not work.

Related

[GUIDE][HOWTO] Multi-boot Android systems on Xperia TX

FIRST OF ALL, we should say thanks to @alvinhochun 's work on porting kexec hardboot patch to Xperia M. His original thread is here: http://forum.xda-developers.com/showthread.php?t=2568151
And @Tasssadar who has ported kexec hardboot patch on MSM chips. Original thread is here: http://forum.xda-developers.com/nexus-4/orig-development/kexec-hardboot-patch-t2472316/post46223952
As for the kernel patch and kexec binary for TX, they are here: http://forum.xda-developers.com/showthread.php?t=2747215
OK let's begin our tour on TX...
0. Disclaimer
This is a rather dangerous hack. I'm not responsible for data loss, broken SD cards, dead internal storage or bricked phones. Try this at your own risk. Proceed only when you know what you are doing.​
1. Requirements
a. ROM with “kexec hardboot” patched kernel. My OmniROM build will do the job. Since Alx31Tse is also using my kernel source for TX, the Carbon builds for TX may be capable of handling this as well. This ROM should be installed into internal storage : just flash it in recovery as usual.​b. External MicroSD card which is big enough for your ROMs. One ROM takes up ~4GB space.​c. Some basic knowledge of partitions, device nodes, ramdisk modding(check this thread by letama: http://forum.xda-developers.com/showthread.php?t=2418893).​
2. Partitioning the external sdcard
a. Plan the partitions​
Each ROM need three partitions : system, data and cache. You need at least 1.4GB system + 2GB data + 400MB cache for stock ROMs. The system partition for third-party ROMs can be shrinked to ~900MB. Of course you can set your own data partition size if 2GB does not suit your needs. The space left can be used for storing data just like a normal sdcard.
For example, I'm using a 16GB card and going to install two stock ROMs (9.1.B.1.67 + 9.2.A.0.295). So I have to create at least 6 partitions for them:
1.4GB system for 295
2GB data for 295
400MB cache for 295
1.4GB system for 67
2GB data for 67
400MB cache for 67
There is ~8GB left after all these partitions. This can be used as a normal sdcard. Just create another partition for it.​
b. Go partitioning it!​
Everyone has his own way of doing this. I prefer using a USB card reader and Disk Utility that comes with Ubuntu.
Erase the card and initialize it with GUID Partition Table (GPT). Of course you can use MBR, but I didn't test it. Be careful in the following steps if you choose MBR.
Create the “normal sdcard” partition. In my example, create a 8GB partition here and format it with FAT32. THIS PARTITION SHOULD BE THE FIRST ONE ON THE CARD! Otherwise Android system may not be able to recognize it.
Create the partitions for guest systems. There are no particular order for the partitions. Just make sure you remember their order. DO NOT FORMAT them for now.
In my example:
PART 1: 8GB, FAT32
PART 2: 1.4GB unformatted
PART 3: 2GB unformatted
PART 4: 400MB unformatted
PART 5: 1.4GB unformatted
PART 6: 2GB unformatted
PART 7: 400MB unformatted​
3. Kernel mods for guest systems
For each guest system:
a. Unpack its kernel.​
If you are going to install a full stock ROM, please choose a corresponding kernel with recovery built-in in Android Development section.
If you are going to install a third-party ROM (OmniROM, CM etc) or customized stock ROM (Rockers etc), chances are that their kernels have recovery built-in already and you can proceed.
Now unpack the kernel.
We have zImage(sec0.bin), ramdisk(sec1.bin) now. The rest can be ignored.​
b. Modify the mount entries in fstab (and other files)​
fstab is the file that suggests the real device for the /system, /data and /cache mount points. Modding it will make it possible to mount the partitions other than the ones in internal storage on /system /data and /cache, so that we can separate different systems into different partitions.
Now you have to be clear about “how the partitions on external card will be presented in your phone” (their device nodes). In my example (GPT with 7 partitions):
PART 1: 8GB → /dev/block/mmcblk1p1
PART 2: 1.4GB → /dev/block/mmcblk1p2
PART 3: 2GB → /dev/block/mmcblk1p3
PART 4: 400MB → /dev/block/mmcblk1p4
PART 5: 1.4GB → /dev/block/mmcblk1p5
PART 6: 2GB → /dev/block/mmcblk1p6
PART 7: 400MB → /dev/block/mmcblk1p7
As has been mentioned above, mmcblk1p1 is for normal file storage, p2~p4 is for 295, p5~p7 is for 67.
Files that need modding:
(sec1.bin/sbin/ramdisk.cpio) /fstab, /fstab.qcom, /init.target.rc
Click to expand...
Click to collapse
(sec1.bin/sbin/ramdisk-recovery.cpio) /fstab, /fstab.qcom, /etc/recovery.fstab, /etc/twrp.fstab
Click to expand...
Click to collapse
The fstabs are easy to deal with. Just change the block device name for /system /cache and /data to /dev/block/mmcblk1p* accordingly. The init.target.rc has only one line that should be modded. For example,
FOR 9.1.B.1.67 in my example:
ramdisk.cpio/fstab:
/data ext4 /dev/block/mmcblk1p6
/cache ext4 /dev/block/mmcblk1p7
/boot/modem_fs1 raw /dev/block/platform/msm_sdcc.1/by-name/modemst1
/boot/modem_fs2 raw /dev/block/platform/msm_sdcc.1/by-name/modemst2
Click to expand...
Click to collapse
ramdisk.cpio/fstab.qcom:
/dev/block/mmcblk1p5 /system ext4 ro,barrier=1,discard wait,check
/dev/block/mmcblk1p6 /data ext4 nosuid,nodev,noatime,barrier=1,noauto_da_alloc,discard wait,check,encryptable=footer
/dev/block/mmcblk1p7 /cache ext4 nosuid,nodev,noatime,barrier=1,discard wait,check
/dev/block/platform/msm_sdcc.1/by-name/SDCard /mnt/int_storage ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check
Click to expand...
Click to collapse
ramdisk.cpio/init.target.rc:
(SEARCH FOR /system)
on post-fs
mount ext4 /dev/block/mmcblk1p5 /system ro remount barrier=1
Click to expand...
Click to collapse
Just do the same for ramdisk-recovery.cpio. For example:
ramdisk-recovery.cpio/etc/recovery.fstab
/boot emmc /dev/block/mmcblk0p4
/system ext4 /dev/block/mmcblk1p5
/cache ext4 /dev/block/mmcblk1p7
/data ext4 /dev/block/mmcblk1p6 length=-16384
/sdcard ext4 /dev/block/mmcblk0p15
/external_sd auto /dev/block/mmcblk1p1 /dev/block/mmcblk1
Click to expand...
Click to collapse
And replace mmcblk1p5~p7 with p2~p4 then do it all again for 9.2.A.0.295's ramdisk.cpio & ramdisk-recovery.cpio
NOTE: All these fstab and rc files should be rw-r—r-- and owned by root:root. Otherwise the system may fail to boot.
Now repack the ramdisk.cpio, ramdisk-recovery.cpio and then the whole ramdisk.​
4. Installing the guest systems
Take notice of the texts in red. Change them to fit your needs.
a. Preparing the guest systems​If you are installing full stock ROM (FTF format), you can use Flashtool to dump the system image (Flashtool > Tools > Sin Editor, load system.sin from FTF archive and dump data). Then write the image to the sdcard by “dd if=system.ext4 of=/dev/sdb2“ on the computer.
If you are installing ROMs in ZIP format, you need to modify updater-script and replace all (for 9.1.B.1.67 in my example)
/dev/block/mmcblk0p12 or /dev/block/platform/msm_sdcc.1/by-name/System to /dev/block/mmcblk1p5
Click to expand...
Click to collapse
/dev/block/mmcblk0p13 or /dev/block/platform/msm_sdcc.1/by-name/Cache to /dev/block/mmcblk1p7
Click to expand...
Click to collapse
/dev/block/mmcblk0p14 or /dev/block/platform/msm_sdcc.1/by-name/Userdata to /dev/block/mmcblk1p6
Click to expand...
Click to collapse
And
remove /dev/block/mmcblk0p4 or /dev/block/platform/msm_sdcc.1/by-name/Kernel formatting/writing lines
Click to expand...
Click to collapse
Then repack the ROM and push it into phone's internal sdcard.​
b. Boot the guest kernel/system​Remember we have zImage and modded ramdisk for each guest system? adb push them to /data partition. The kexec binary is needed as well. Now you can use the kexec binary(check the beginning of this thread) to boot your guest kernel and then recovery.
For example:
I pushed 295 kernel zImage to /data/boot4.3/zImage-stock, modded ramdisk to /data/boot4.3/initrd-stock, and kexec binary to /data/kexec. Now execute as root:
Code:
cd /data
chmod 755 kexec
busybox sync
busybox mount -o remount,ro /system
busybox mount -o remount,ro /cache
busybox mount -o remount,ro /data
busybox sync
./kexec --load-hardboot [COLOR="Red"]./boot4.3/zImage-stock[/COLOR] –initrd=[COLOR="Red"]./boot4.3/initrd-stock[/COLOR] --mem-min=0x85000000 --command-line="`cat /proc/cmdline`"
busybox sync
./kexec -e # phone reboots and guest kernel (295) starts
NOTE: the guest kernel's cmdline may not be exactly the same as the host one. However, it doesn't matter much. 67 and 295 both boot fine using the same cmdline as OmniROM. Since bootloader will append some parameters to the command line, using guest's sec3 without appending these parameters manually is not a good idea.​
c. Preparing filesystems and installing ROMs in ZIP​After the phone reboots, press Vol buttons at purple LED to go into recovery. Now you are in the recovery for your guest system (295).
FORMAT (not wipe) /data and /cache there. For ZIP ROMs you need to format /system as well.
Then install the modded ZIP file if needed. You can also flash SuperSU or anything else to this guest system in the recovery (remember to check if there are wrong block device paths in updater-script).
After finishing the installation of one guest system, reboot and you will go into the host ROM. Execute the commands again and specific the next guest system's zImage and ramdisk to boot into the next guest system. Then do the formatting and flashing things as described above.​
5. Boot into guest systems
Once you finish installing all the guest systems, reboot. Then in the host ROM you can execute the commands in Step 4 again to boot into the corresponding guest system. Don't press any key after the reboot. If there's nothing wrong, you will see the bootanimation and then the Android system. Since external sdcards may not be as fast as internal storage, the first boot may take very long time. If you see the bootanimation, just be patient and it will boot up finally.​
===========================================================
I know I can't speak English well and it's hard to make myself clear. So if you feel confused, please post your questions here so that everyone who knows the answer will be able to help.
And if you are skilled in Android things, you can choose your own way to achieve the goal:
Partition the sdcard → Mod fstsb and rcs to mount partitions on sdcard to /system etc → Mod the ROM installation script → Boot into guest recovery to format(initialize) data & cache &system and flash ROM → Boot into the guest Android OS
Click to expand...
Click to collapse
This is a little bit complicated. But I do hope this will add more fun to our device
Thanks for your sharing
got it
Although this is labeled for the Xperia TX, after reading through everything, it looks like this works on all devices, you just have to change a few things. Good job putting this together! (Even though I don't have an Xperia TX)
r3pwn said:
Although this is labeled for the Xperia TX, after reading through everything, it looks like this works on all devices, you just have to change a few things. Good job putting this together! (Even though I don't have an Xperia TX)
Click to expand...
Click to collapse
Yeah, it seems that the guide applies to all devices with patched kernels
updateing said:
Yeah, it seems that the guide applies to all devices with patched kernels
Click to expand...
Click to collapse
This guide is nice, full of content, and detailed, but wouldn't it have been easier, though, to just make a MultiROM port?
r3pwn said:
This guide is nice, full of content, and detailed, but wouldn't it have been easier, though, to just make a MultiROM port?
Click to expand...
Click to collapse
I have thought of porting MultiROM, but I'm running a tight schedule...sorry
Whether this Xperia V can also be made from ??
Mircinko96 said:
Whether this Xperia V can also be made from ??
Click to expand...
Click to collapse
It's applicable to Xperia V in theory. But you need a kernel with kexec hardboot patch, which hasn't appeared yet (as far as I have seen). If you know how to compile a kernel, you can try patching the kernel yourself.
.........
do I need linux to unpack kernel?

Convert cache partition to F2fs on Cm13 ?

Hi all ,
I tried to convert the cache partition to f2fs on my xt1068 but kept getting stuck on boot animation I followed the XDA conversion guide but still failed.my data partition is f2fs.does anyone know if cm13 support cache partition on f2fs or I am doing something wrong.
Steps I followed
Booted in to twrp latest
Made a backup of cache partition
Changed it to f2fs
Put a tick on use rm_rf instead of formating
Then restored cache
It got stuck on boot animation
I also tried wiping but still no joy
Plz help
Thanks in advance
What's the point f2fs on a partition that isn't even used much?
lewl~
// Also we don't support F2FS for /cache in CM.
LuK1337 said:
What's the point f2fs on a partition that isn't even used much?
lewl~
// Also we don't support F2FS for /cache in CM.
Click to expand...
Click to collapse
Thanks a bunch for the prompt reply.much appreciated.

How can I flash roms with f2fs?

Guys I'm new here and I do not know much about roms or recovery modes and it's functions. I have a question for you. Some of the roms support f2fs filesystem but whenever I try to install them on my device, it flash roms by using ext4 function. I have never be able to flash them by using f2fs. For example Los 13, Los 14.1, RR roms have f2fs filesystem support. I convert my system and cache to f2fs from ext4 but it doesnt work at all. It installs the roms by using ext4 always. How can I flash them with f2fs filesystem. I have heard that f2fs is faster than ext4 therefore I want try it
Follow these steps:
novafusion.pl/tutorials/how-to-use-f2fs-s3-mini/
danilisilva7 said:
Follow these steps:
novafusion.pl/tutorials/how-to-use-f2fs-s3-mini/
Click to expand...
Click to collapse
I have tried that but whenever I try to install a rom with a filesystem formatted as f2fs, it converts it to ext4 at the beginning of the installation. Can I convert my filesystem after installing a rom? For example after the installation of LineageOs 14, can I convert my filesystem as f2fs? Does it harm my phone?

[Q] F2FS Confusion

I finally decided to take the risk of converting to the F2FS file system. I'm a little confused on just how far I should go with it. The readily available guides only mention changing the cache and data partitions. I have made this jump, and I absolutely notice a difference. My question is that there is also an option to format the system partition to F2FS, but I can't find anything concrete on its benefits. Honestly I can't find much of anything about it. Does anyone have any experience with F2FS system partition conversion?
You don't write anything to system partition as it's pure read-only. F2FS would make zero difference. It's just a hassle making ROMs work with /system under F2FS.
Lawstorant said:
You don't write anything to system partition as it's pure read-only. F2FS would make zero difference. It's just a hassle making ROMs work with /system under F2FS.
Click to expand...
Click to collapse
Thanks, that makes complete sense to me. So I'm done then? Just go with what I have?
donkeypunch1257 said:
Thanks, that makes complete sense to me. So I'm done then? Just go with what I have?
Click to expand...
Click to collapse
Don't format the system partition to F2FS. There is zero benefit from this since, as stated above, it is mounted as R/O at boot time, diminishing any positive effect F2FS may have the phone's performance (slower reads, faster writes, theoretically.) Anyways, most ROMs format /system to ext4 when being flashed, so there's that too. Just go with what you have, which is ext4.

F2FS in MIUI

Hi, wouldn't it be sufficient to switch to a custom kernel with f2fs driver to be able to run MIUI with a f2fs file system? It is even possible? With LineageOS you still cannot use f2fs on the /system partition (maybe in the initial ramdisk there is no f2fs driver ?) but at least /data and /cache partition, also on MIUI. Is there a way to do that?
I'm trying without success, installed a custom kernel which claims to have f2fs support, formatted the cache partition in f2fs to do some testing, typed the 'df' command in the linux shell but no cache partition is displayed.
Using f2fs on the /system isn't a good idea to begin with, the /system is a read only partition so you wouldn't benefit from anything that f2fs gives.

Categories

Resources