[KERNEL][RECOVERY][F2FS][EXP][4.4] LegoKernel [28/02/14]

Search This thread

legolas93

Senior Member
Jul 13, 2010
644
1,267
LegoKernel - With F2FS

NOTE This kernel version doesn't support "All-F2FS"

This is a Kernel for Android 4.4. I made this for SlimKat so i don't know if this will work with other roms.
Some users reported working also on:
  • Cyanogenmod (Reported by: buggatti)
  • Carbon (Reported by: Nosterius)
  • OmniROM (Reported by: SkOrPn)

What is F2FS?

F2FS (Flash-Friendly File System) is a flash file system created by Kim Jaegeuk at Samsung for the Linux operating system kernel. The motive for F2FS was to build a file system that from the start takes into account the characteristics of NAND flash memory-based storage devices (such as solid-state disks, eMMC, and SD cards), which are widely used in computer systems ranging from mobile devices to servers.

The idea was of ss2man44. F2FS helps Nexus 7 2012 where he needs: IO Speed and slowdown after long period (months?) of use. This Filesystem is used in others phone too like Moto X where he shows good performance.

I tested this myself for some weeks without problems and i'm happy.

I started from the stock Slim kernel.
There are also others features by me:
  • Ported sl[aou]b from Linux 3.4
  • Ported timer and workqueue from Linux 3.4
  • Ported random from Linux 3.13-rc4
  • Ported rwsem from Linux 3.11
  • Kernel NEON Mode
  • Etc..Etc..
  • Added GPU OC (Franco way..)
  • Added Toggle for FSYNC
  • Revert CPU OC things (We don't need it and it was a bit dirty..)

Instructions:

I already said that i did this for SlimKat so my advice is to start this procedure with a working SlimKat rom or another rom that is reported to work good. (See the start of this post)

F2FS is a Filesystem so we have to Format our memory in this mode. How can we do this? We need a "special" TWRP and LegoKernel


I said "FORMAT" so it's obvious that you will lose all your data (even Movies..Music..all!). Backup them on PC to restore easily at the end.
Now..

  • Reboot in Recovery (To know that you are on "special" TWRP note that the BackKey is Red at the bottom-right)
  • Go to Wipe menu
  • Format Data (Not the simple Wipe!)
  • Reboot

Enjoy. (Now you may want to restore your backup)

Report back how do you feel your tablet now. I have a very positive opinion about this thing!! :D

Changelogs:
- 28/02/13: Add Kexec Support

Some thing you have to know:
  • After the switch to F2FS you can use only kernel with F2FS Support
  • Backup made with standard TWRP may not work with "special" TWRP and reverse.

How come back?
  • Flash a standard TWRP
  • Format Data
  • Flash your previous ROM/Kernel
  • Reboot

Github
 
Last edited:

Erovia

Senior Member
Sep 16, 2012
818
262
It's great that someone else beside sgt.meow (Oxydo kernel) picked up ss2man44's idea. :good:
 

legolas93

Senior Member
Jul 13, 2010
644
1,267
MultiROM v22a - With F2FS

I have adapted Tassadar MultiRom to work with F2FS. (All credits to him)

You need:
  • Its Multirom zip. Here
  • Kernel with F2FS Support and Kexec Support
    (As now LegoKernel-F2FS-140228 is the only LegoKernel that work with MultiROM)
  • TWRP with F2FS Support and MultiROM. Here (For Grouper)
  • TWRP with F2FS Support and MultiROM. Here (For Tilapia)

If you already switched to F2FS:

  • Move Multirom zip and Kernel to your tablet
  • Flash TWRP with F2FS Support and MultiROM with Fastboot or Flashify
  • Reboot in Recovery
  • Flash Kernel
  • Flash MultiROM zip
  • Reboot

If you didn't switch to F2FS and want to do it now:

  • Copy Kernel to your tablet
  • Flash Kernel with your current Recovery
  • Flash TWRP with F2FS Support and MultiROM with Fastboot
  • Reboot in Recovery
  • Format Data in Wipe menu (you will lose all your files!!) Not the simple Wipe!
  • Reboot
  • Copy MultiROM zip to your tablet
  • Reboot in Recovery
  • Flash MultiROM zip
  • Reboot

Some things you have to know: (READ THEM)
  • All your ROMs must support F2FS so if you want to use "normal" ROMs you have to "share kernel"

I have tested this with SlimKat as Primary and CM11 as other ROM
 
Last edited:

frantisek.nesveda

Senior Member
Jan 10, 2012
342
524
Hi,
this mod works well for me on my Nexus 7 3G running CyanogenMod 11. I've been running this just for a few hours, but the filesystem performance seems much better, my N7 no longer lags when installing apps, which it did before.
The only problem, or rather inconvenience, I had is that the recovery is not made for the N7 3G, so it won't install ROMs and stuff made for tilapia, as it expects them made for grouper. It would be cool to have a tilapia version of the recovery, or some instructions in the OP on how to use it there.

If you want to use this mod on tilapia, you have to:
  1. Install the special recovery by legolas93 from the first post.
  2. Format /data from within the recovery (format, not just wipe).
  3. Install back a recovery made for tilapia and DO NOT FORMAT /DATA!
  4. Install your ROM/gapps/hippo/etc.
  5. Flash the modified kernel from the firts post.
Anyway, big thanks to legolas93 for doing this. Have you also considered making /system and /cache as f2fs? Do you think it would have any significant benefits?
 

SkOrPn

Senior Member
Jun 3, 2007
2,994
948
Albuquerque, NM
www.planetamd64.com
Hmm, well I decided to try this as well, however after flashing the kernel I sat it down for a few minutes so I could fire up my laptop (it has Fastboot on it) and when I came back to the tablet it was turned off. I turned it on and now out of the blue its asking for a password to decrypt the storage?

I have ran CM11 for the past year on it and purchased it brand new from Google last January. However, after trying my Google email password it is still asking for a password.

Anyway, I decided to do a full wipe, installed CM11 2/28, LegoKernel and Gapps. And upon rebooting its still taking me to a screen asking for a password. Anyone know why it would spontaneously ask for a password? is there a default password I am supposed to use with this kernel by chance? lol, I am at a loss and I usually have everything under control grr haha

EDIT:
CM11 2/28 is installed
Latest LegoKernel
Latest PA_Gapps
And I have not been able to flash the latest TWRP on it yet. But I do have the latest TWRP (MultiROM version) on it.

EDIT: #2, Ok I managed to use Fastboot on my laptop and I flashed the special TWRP. I went a head and re-wiped factory-reset and also re-flashed the CM11 rom and the latest LegoKernel, but after a reboot its still asking for some unknown password. Why would it need a password all of a sudden?
 
Last edited:

frantisek.nesveda

Senior Member
Jan 10, 2012
342
524
Hmm, well I decided to try this as well, however after flashing the kernel I sat it down for a few minutes so I could fire up my laptop (it has Fastboot on it) and when I came back to the tablet it was turned off. I turned it on and now out of the blue its asking for a password to decrypt the storage?

I have ran CM11 for the past year on it and purchased it brand new from Google last January. However, after trying my Google email password it is still asking for a password.

Anyway, I decided to do a full wipe, installed CM11 2/28, LegoKernel and Gapps. And upon rebooting its still taking me to a screen asking for a password. Anyone know why it would spontaneously ask for a password? is there a default password I am supposed to use with this kernel by chance? lol, I am at a loss and I usually have everything under control grr haha
Did you format the /data partition with the modified recovery? This happens when Android can't access the /data partition, in this case very probably because there is a mismatch between the filesystem on /data (ext4) and the filesystem the kernel expects (f2fs). You have to first format the /data partition so it would have f2fs.
 

SkOrPn

Senior Member
Jun 3, 2007
2,994
948
Albuquerque, NM
www.planetamd64.com
Did you format the /data partition with the modified recovery? This happens when Android can't access the /data partition, in this case very probably because there is a mismatch between the filesystem on /data (ext4) and the filesystem the kernel expects (f2fs). You have to first format the /data partition so it would have f2fs.
I cant remember now if I did or didn't format /data. I remember formatting everything except for OTG I think, lol.

Anyway, I used NRT and put the device back to stock, then I installed the modified F2FS TWRP recovery. Now I have the modified Recovery installed, and a fresh stock rom rooted with usb debug enabled. I just finished downloading the latest CM11 Rom and the LegoKernel and put it into my freshly formatted sdcard. I am sitting in TWRP at this moment but worried about flashing the kernel again. haha

Going to try again. Will report back. But first, let me make sure I have this right since I am trying to flash a ROM at the same time now.

1st. Flash the CM11 ROM
2nd. Flash the LegoKernel
3rd. Format /data???
4th. Flash Gapps?

I am almost certain I did this before, that's why I am asking.
 

frantisek.nesveda

Senior Member
Jan 10, 2012
342
524
1st. Flash the CM11 ROM
2nd. Flash the LegoKernel
3rd. Format /data???
4th. Flash Gapps?
That should do it. Remember, you have to format /data, just wiping is not enough. And you'll have to flash gapps via sideload, because formatting /data also removes everything on /sdcard.
Personally, I'd format /data first, just to be sure you don't delete a part of the CM11 ROM after installing, but I think CM11 recovery zip doesn't flash anything into /data anyway, so it doesn't matter.
 
Last edited:

SkOrPn

Senior Member
Jun 3, 2007
2,994
948
Albuquerque, NM
www.planetamd64.com
That should do it. Remember, you have to format /data, just wiping is not enough. And you'll have to flash gapps via sideload, because formatting /data also removes everything on /sdcard.
Personally, I'd format /data first, just to be sure you don't delete a part of the CM11 ROM after installing, but I think CM11 recovery zip doesn't flash anything into /data anyway, so it doesn't matter.

Ok, that must be what I am doing wrong then. I somehow was not aware that wiping /data was not going to do it. I did the above but I wiped /data and now I am back to the password screen yet again. Not sure if I have to go all the way back to stock again or not now.
 

frantisek.nesveda

Senior Member
Jan 10, 2012
342
524
Ok, that must be what I am doing wrong then. I somehow was not aware that wiping /data was not going to do it. I did the above but I wiped /data and now I am back to the password screen yet again. Not sure if I have to go all the way back to stock again or not now.
It will be enough if you now just format /data and flash gapps again. You probably never had to go back to stock anyway, I didn't and everything went well.
 
  • Like
Reactions: SkOrPn

SkOrPn

Senior Member
Jun 3, 2007
2,994
948
Albuquerque, NM
www.planetamd64.com
It will be enough if you now just format /data and flash gapps again. You probably never had to go back to stock anyway, I didn't and everything went well.
Yeah everything seems OK now. Just waiting for Google to re-install all my apps. Wish I had realized there was a difference between wipe and format, and that the format data button is just staring you in the face too. lol

Thanks for your help bud. :good:
 

legolas93

Senior Member
Jul 13, 2010
644
1,267
Hi,
this mod works well for me on my Nexus 7 3G running CyanogenMod 11. I've been running this just for a few hours, but the filesystem performance seems much better, my N7 no longer lags when installing apps, which it did before.
The only problem, or rather inconvenience, I had is that the recovery is not made for the N7 3G, so it won't install ROMs and stuff made for tilapia, as it expects them made for grouper. It would be cool to have a tilapia version of the recovery, or some instructions in the OP on how to use it there.

If you want to use this mod on tilapia, you have to:
  1. Install the special recovery by legolas93 from the first post.
  2. Format /data from within the recovery (format, not just wipe).
  3. Install back a recovery made for tilapia and DO NOT FORMAT /DATA!
  4. Install your ROM/gapps/hippo/etc.
  5. Flash the modified kernel from the firts post.
Anyway, big thanks to legolas93 for doing this. Have you also considered making /system and /cache as f2fs? Do you think it would have any significant benefits?

Sorry. I dind't have time to do the tilapia recovery. But now i have just uploaded a TWRP Recovery with F2FS and MultiROM for Tilapia! Let me know if it is ok :)

I think that TWRP need some non-trivial edits from TWRP-guys to be able to use /system and /cache as f2fs. Anyway i don't think that we will gain some big benefits because..
- /cache is used very little..maybe only by recovery (i'm not 100% sure..)
- /system is used only by reading from it 99% of time so i dubt that we will gain some major benefits

Even Moto X use f2fs only for /data partition, maybe this is the best way to use it!
 

chaostrodamis

Senior Member
Mar 14, 2010
507
118
Google Pixel 4 XL
Google Pixel 5
hows the battery life on this kernel, plus im running Kang-aroo kernel which mean ill lose all of the neat tweaks it supports, will you be adding tweaks and mods to this kernel or is this minimum version going to be how it stays moving forward.
 
Last edited:

Fransis88

Senior Member
Apr 19, 2011
321
45
Wtf
emeqa6eh.jpg


Enviado desde mi Nexus 5 mediante Tapatalk
 

Fransis88

Senior Member
Apr 19, 2011
321
45
You failed to use the format button. I did the exact same thing. All you have to do now is go back into the modified TWRP and use the "format data" button. It will work perfectly after that.

Sent from my Nexus 7 using Tapatalk

thanks for the help, actually after formatting data, everything worked properly.
but I have several questions:
1 tilapia and my tablet is use AOSP omnirom.
2nd f2fs using the modified recovery, and I can not use another kernel not support this file format?
3rd, I lost the multiboot startup.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 59
    LegoKernel - With F2FS

    NOTE This kernel version doesn't support "All-F2FS"

    This is a Kernel for Android 4.4. I made this for SlimKat so i don't know if this will work with other roms.
    Some users reported working also on:
    • Cyanogenmod (Reported by: buggatti)
    • Carbon (Reported by: Nosterius)
    • OmniROM (Reported by: SkOrPn)

    What is F2FS?

    F2FS (Flash-Friendly File System) is a flash file system created by Kim Jaegeuk at Samsung for the Linux operating system kernel. The motive for F2FS was to build a file system that from the start takes into account the characteristics of NAND flash memory-based storage devices (such as solid-state disks, eMMC, and SD cards), which are widely used in computer systems ranging from mobile devices to servers.

    The idea was of ss2man44. F2FS helps Nexus 7 2012 where he needs: IO Speed and slowdown after long period (months?) of use. This Filesystem is used in others phone too like Moto X where he shows good performance.

    I tested this myself for some weeks without problems and i'm happy.

    I started from the stock Slim kernel.
    There are also others features by me:
    • Ported sl[aou]b from Linux 3.4
    • Ported timer and workqueue from Linux 3.4
    • Ported random from Linux 3.13-rc4
    • Ported rwsem from Linux 3.11
    • Kernel NEON Mode
    • Etc..Etc..
    • Added GPU OC (Franco way..)
    • Added Toggle for FSYNC
    • Revert CPU OC things (We don't need it and it was a bit dirty..)

    Instructions:

    I already said that i did this for SlimKat so my advice is to start this procedure with a working SlimKat rom or another rom that is reported to work good. (See the start of this post)

    F2FS is a Filesystem so we have to Format our memory in this mode. How can we do this? We need a "special" TWRP and LegoKernel


    I said "FORMAT" so it's obvious that you will lose all your data (even Movies..Music..all!). Backup them on PC to restore easily at the end.
    Now..

    • Reboot in Recovery (To know that you are on "special" TWRP note that the BackKey is Red at the bottom-right)
    • Go to Wipe menu
    • Format Data (Not the simple Wipe!)
    • Reboot

    Enjoy. (Now you may want to restore your backup)

    Report back how do you feel your tablet now. I have a very positive opinion about this thing!! :D

    Changelogs:
    - 28/02/13: Add Kexec Support

    Some thing you have to know:
    • After the switch to F2FS you can use only kernel with F2FS Support
    • Backup made with standard TWRP may not work with "special" TWRP and reverse.

    How come back?
    • Flash a standard TWRP
    • Format Data
    • Flash your previous ROM/Kernel
    • Reboot

    Github
    12
    MultiROM v22a - With F2FS

    I have adapted Tassadar MultiRom to work with F2FS. (All credits to him)

    You need:
    • Its Multirom zip. Here
    • Kernel with F2FS Support and Kexec Support
      (As now LegoKernel-F2FS-140228 is the only LegoKernel that work with MultiROM)
    • TWRP with F2FS Support and MultiROM. Here (For Grouper)
    • TWRP with F2FS Support and MultiROM. Here (For Tilapia)

    If you already switched to F2FS:

    • Move Multirom zip and Kernel to your tablet
    • Flash TWRP with F2FS Support and MultiROM with Fastboot or Flashify
    • Reboot in Recovery
    • Flash Kernel
    • Flash MultiROM zip
    • Reboot

    If you didn't switch to F2FS and want to do it now:

    • Copy Kernel to your tablet
    • Flash Kernel with your current Recovery
    • Flash TWRP with F2FS Support and MultiROM with Fastboot
    • Reboot in Recovery
    • Format Data in Wipe menu (you will lose all your files!!) Not the simple Wipe!
    • Reboot
    • Copy MultiROM zip to your tablet
    • Reboot in Recovery
    • Flash MultiROM zip
    • Reboot

    Some things you have to know: (READ THEM)
    • All your ROMs must support F2FS so if you want to use "normal" ROMs you have to "share kernel"

    I have tested this with SlimKat as Primary and CM11 as other ROM
    8
    i maked it exactly with CM11 but at reboot the nexus 7 is unusable, i got continuously this error:
    "Unfortunately, the process com.android.phone has stopped"
    Please someone can help me? i dont understand what i wrong :(
    Thanks

    CyanogenMod added support for multi-sim devices in the beginning of March, so every kernel needs to have /system/framework/telephony-msim.jar in their BOOTCLASSPATH to be able to work on new CM nightlies. I repacked the kernel with a modified init.environ.rc in the ramdisk to incorporate this change, so it can work on CyanogenMod. All credits to @legolas93 for LegoKernel and @carlo93 for information about the patch. The modified kernel is attached to this post.

    TL;DR: Use the kernel attached to this post if you want it to work on CyanogenMod.
    3
    What is f2fs ??? Can someone explain to me what are its advantages and disadvantages ???

    http://en.wikipedia.org/wiki/F2FS

    Benefits = Its new and built for mobile device flash NAND. Its also the most stable FS yet, you can't even cause file corruption from removing power in the middle of a write. Random writes are somewhere around 3-4 times faster than ext4 when full journaling is used. Remove journaling and its on par or slightly faster than ext4.
    Disadvantages = Its new and not built for platter disks. Its also not yet a finished product, still has many features not yet implemented. It also seems to be targeted for mobile devices, which means not really a desktop file system. Not really sure why that is though, but that is what one of the thorough review testers told me at Phronix.
    3
    Hi,
    this mod works well for me on my Nexus 7 3G running CyanogenMod 11. I've been running this just for a few hours, but the filesystem performance seems much better, my N7 no longer lags when installing apps, which it did before.
    The only problem, or rather inconvenience, I had is that the recovery is not made for the N7 3G, so it won't install ROMs and stuff made for tilapia, as it expects them made for grouper. It would be cool to have a tilapia version of the recovery, or some instructions in the OP on how to use it there.

    If you want to use this mod on tilapia, you have to:
    1. Install the special recovery by legolas93 from the first post.
    2. Format /data from within the recovery (format, not just wipe).
    3. Install back a recovery made for tilapia and DO NOT FORMAT /DATA!
    4. Install your ROM/gapps/hippo/etc.
    5. Flash the modified kernel from the firts post.
    Anyway, big thanks to legolas93 for doing this. Have you also considered making /system and /cache as f2fs? Do you think it would have any significant benefits?