yashsingh1/xdaforums huggingface dataset:
[Galaxy S Advance I9070 Original Android Developmen] pictorul20:
Instructions on how to get f2fs working.

First off, you have to install adb drivers on your computer.

If you already have adb installed just skip this part. You also need to be rooted and usb debugging turned on...

You have to start command prompt in admin mode and look for the folder of your adb files... then to check whether your device is connected you have to type "adb devices" without the ". You'll see a serial number and to its right it will say connected... then just type adb shell and just copy paste the codes that cocafe's provided. Please do a nandroid backup first.

P.S if u have any error type $ su in command prompt. ..hope that it helps...

A backup in TWRP is recommended!!

Make sure that your SD card has enough space!!

1. Reboot to recovery, connect to PC, use ADB commands

2. Backup the data partition as a tarball

Code:

cd /data

tar -cvf /external_sd/data.tar *

3. Now umount /data, we gonna format it (umount all mount points of mmcblk0p5)

Code:

umount /data /sdcard

4. Format the data partition (Do not type a wrong partition number, it is dangerous!)

Code:

cd /dev/block

mkfs.f2fs -l userdata mmcblk0p5

5. Now restore the data

Code:

mount -t f2fs -o rw /dev/block/mmcblk0p5 /data

cd /data

tar -xvf /external_sd/data.tar

Then reboot system, that's it.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Ok, but do you (and where) make any changs to ramdisk files/fstab for them to recognize f2fs - looking at mine files they expect ext4 there and will probably fail after doing this...

What is your fstab entry for /data?
[Galaxy S Advance I9070 Original Android Developmen] pictorul20:
I-m not familiar with this, all i know i checked either it worked or not with terminal emulator and it showed that data partition was f2fs . All other partitions were ext4
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
Hm, I've used this for few months but haven't had problems with data integrity. Only once I had to format corrupted /data partition - exactly after DDR OC which is cause SDMMC OC(before I wrote fix for SDMMC).

That's weird. It should show window "/data is encrypted" or smth like that (some users have this problem, when fstab contained ext4 entries). But for use it on /system and /cache there's only way to edit fstab. (and also needed workaround for TWRP, because it for some reason, can't automatically mount /system - j4fs.ko and param.ko should be loaded from somewhere else).

EDIT. if it's needed for anyone, here's fstab with mountpoints for each partition with F2FS (system, data and cache)

(codina's one)

# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
# Data partition must be located at the bottom for supporting device encryption

#<src> <mnt_point> <type> <mnt_flags and options>
/dev/block/mmcblk0p3 /system f2fs ro wait
/dev/block/mmcblk0p2 /modemfs ext4 noatime,nosuid,nodev,journal_async_commit,errors=panic wait,check
/dev/block/mmcblk0p4 /cache f2fs rw,discard,nosuid,nodev,noatime,nodiratime,flush_merge,background_gc=off,inline_xattr,active_logs=2 wait
/dev/block/mmcblk0p7 /efs ext4 noatime,nosuid,nodev,journal_async_commit,errors=panic wait,check
/dev/block/mmcblk0p9 /preload ext4 ro,noatime,errors=panic wait
/dev/block/mmcblk0p5 /data f2fs rw,discard,nosuid,nodev,noatime,nodiratime,flush_merge,background_gc=off,inline_xattr,active_logs=2 wait,nonremovable,encryptable=/efs/metadata

# Vold managed volumes
/devices/sdi2/mmc_host/mmc0/mmc0 auto auto defaults voldmanaged=sdcard0:8,nonremovable,noemulatedsd
/devices/sdi0/mmc_host/mmc1/mmc1 auto auto defaults voldmanaged=sdcard1:auto

# Recovery
/dev/block/mmcblk0p15 /boot emmc defaults recoveryonly
[Galaxy S Advance I9070 Original Android Developmen] qbastrzem:
GT-i9070P

CM 11 team canjica

CM-mk-r4.2.1

Governor: dynamic

Freq: 100-1200 mhz

IO: sioplus

Three days of testing. It works like a dream. No problems at all. Thanks.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Nice to hear that ;) Thanks for the report ;)

I can see you're using P version. I don't supppose NFC works, but I can try to enable it if you are willing to test it.

btw where are you from?
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
[MENTION=5695278]ChronoMonochrome[/MENTION]

That's what I had in mind:

https://github.com/mkaluza/kernel_common/tree/3_0_31

And we're down to

675 files changed, 49428 insertions(+), 13154 deletions(-)
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
Can't download that repo right now :( (I assume it's something about 1GB sources) - will be able to download, when I go back to study after holidays. But it is encouraging that amount of work can be reduced that way.

EDIT. but I guess, I can download that repo as *.zip, and further merge some commits which I do?
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
yeah... because I just started to wonder, how come after merging 95% of differences my diff compresses to 745k and yours has only 500:)

do diff -Nr or -Nupr
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
about 800M, but try this

git clone --branch 3_0_31 --depth 130 --single-branch https://github.com/mkaluza/kernel_common

it should be < 100M

It's a shallow clone, but should do. You can always unshalow it (google: git shallow clone)

No - a zip from github is a snapshot, not a git repo, so it's not that useful
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
Yeah, I know about zip, but I actually mean, that I can do some changes with snapshot, init it as repo and then merge those changes to repo. But it's really not convenient.

p.s. seems that command above doesn't work.

error: unknown option `single-branch'

Will google it.

UPD. finally got it, that's because of outdated version of git. Mine was 1.7.9.5.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
You may want to hold on a bit - I'll try to do as much as possible with scripts. When all automated methods are exhausted, every help will be very welcome;)

No rush... We've been using old kernel for so long that a week or two more don't make any difference ;)

Tested it... git 1.8
[Galaxy S Advance I9070 Original Android Developmen] Epirex:
MK Kernel source for CM11 compile

hi, i want to add your kernel in my compilation of cm11 but I am a little noob on kernels :p

I just added your source to my local_manifest.xml and I do repo sync to get your kernel to compile? I need something more?

sorry for my bad English :)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Few things I suppose - this kernel was not meant to be part of a distro, so I never thought about it.

For the kernel only, you would probably need to restore original paths and names in usr/u8500_files.list and change default kernel config name somewhere in android build system. To also include ramdisk modifications, there are probably more changes, but I don't even know where to start. I've never built a rom so far...

I think it would be a lot easier if you just included a link to the first post of this thread (or to mediafire download dir) and say that it's an alternative kernel and give people a choice.
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
Yeah, just trying to setup repos, before it will be needed.

Btw, with which sources do you compare branch 3_0_31 ? I can't get same number of deleted and added lines:

$ git diff --stat --diff-filter=MD 3_0_31..sams | tail -n1
1320 files changed, 72075 insertions(+), 93046 deletions(-)

3_0_31 is same branch as in your repo kernel_common, sams is branch with this commit https://github.com/ChronoMonochrome/Chrono_Kernel/commit/0e3d1ceed0bfdc503ef35d27b0f8233416f9cd0f .
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Date: Sun Aug 3 23:36:34 2014 +0200

XXLQL GT-I9070_EUR_JB_Opensource_Update1.zip

That was one of the last updates by samsung for SGA that I've found in August - your commit is from sep 2013, so nearly a year older.

Actually I'll look for something even newer on sam mobile.

and use

$ git diff --stat -M5 --diff-filter=M 3_0_31..sams | tail -n1

the -M switch will force git to look for renames - without this they are treated as remove/add of an entire file. We also don't care about deleted files now, so just skip them for now.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
[MENTION=5695278]ChronoMonochrome[/MENTION]

After first dumb semi-automatic merge we're down to:

455 files changed, 19193 insertions(+), 6875 deletions(-)

It selected modules that would patch cleanly onto 3.0.72

Now I'll try to make it smarter because it's still too much for hand picking...
[Galaxy S Advance I9070 Original Android Developmen] Epirex:
Yes, thanks for your reply

the problem is that the kernel of teamcanjica has a bug LiveOPP 2.2 that causes random reboots and flashes on the screen

so wanted to use your kernel for my compilation, to solve this problem xD
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
I know... but I can't help you here... [MENTION=5840412]ace2nutzer[/MENTION] [MENTION=5695278]ChronoMonochrome[/MENTION] can you help him? I've never built a rom (and my pc can't even do it) so I don't know what should be changed here, let alone test it...
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
Sorry, my PC is too weak too for building ROMs (it's even not x64, but x68, so no any chances here). And I don't think LiveOPP 2.2 is causing reboots. As I can see, it works more stably with most users(not only with codina users, but also with janice), or at least I never heard it works worse than LiveOPP 2.1.

Why we just can't build separate kernel, and then use it instead of ROM's one?

I think it somehow relate to DDR_OPP. But I also noticed it appears only with too low varm, when DDR_OPP is 25% (e.g. varm=0x03 @ 200 MHz, but it's definetely ok with varm=0x05 with even DDR25). So far I can't notice any weird consequences from APE25/DDR25 with screen on, but I use DDR50/APE50 as defaults, just in case, because I remember problems with that in the past.
[Galaxy S Advance I9070 Original Android Developmen] Epirex:
Thanks, I will try to build the kernel separately and then add it to the compilation :)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
You don't even have to build it - just take official recovery zip and get it from there (but it's for 4.4 - which version are you building?)
[Galaxy S Advance I9070 Original Android Developmen] Epirex:
is right, just that I wanted to build for my cm11 but I can also use the .zip in the OP

Thank you for help :)
[Galaxy S Advance I9070 Original Android Developmen] Pieee85:
That was what i wanted know basically. A little guideline for experiments :)

Thank you for still supporting our device. :good:
[Galaxy S Advance I9070 Original Android Developmen] imit:
[MENTION=3329816]mkaluza[/MENTION]

Would you like to add PegasusQ governor your kernel? In my opiniom when i was using that kernel in past KK roms, it had the most fluid GUI. Any other governor sometimes gives me strange fps drops but overall system seems fast. But gui seems to "noot keep up" with system.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Stay tuned - more goodies are comming ;) With the current 5.3 release it should be fairly easy to use lvm, f2fs and anything the kernel can handle

It is still in the process of testing/foolproofing because it's now easy to get hurt and disable the phone (esp if you overwrite init.rc with bull****) Then you need to flash the kernel that doesn't do overlays (like mk 4.2.2), fix it and reflash 5.*, so it's not too convinient, but I haven't figured out a 'rescue mode' yet. One option is to make init.rc in recovery not updateable.

You have been warned

If someone wants to try f2fs support (WARNING - if you don't understand something, don't do it, you'll probably have problems from not booting to bootloop):

1. copy your current /fstab.samsungjanice somewhere like /data/local/tmp (WARNING - check first that it's correct, that it really contains the right entries and if not ask someone (not me) with f2fs for help). If you're not sure, don't do it - ask for help. That is the case for CoCafe's kernel - /data is mounted from a script there, so it'll be absent from fstab.

2. go to recovery and flash mk 5.3 and DON'T REBOOT

3. connect with adb/root

4. copy previously saved fstab to /efs/common/overlay/

5. copy /system/lib/modules/f2fs.ko to /efs/common/overlay/modules/

6. for safety check permissions on both files (644 is fine, 666 also).

7. reboot, profit... :)

enjoy... (or cry it somethig went wrong ;P)

Other roms

It's now been tested by [MENTION=4982868]hastalafiesta[/MENTION] that you can boot this kernel on CM10.1-2013 (whatever that is...). In addition to normal kernel .zip you need a ramdisk image. Go to ramdisks folder and get it. READ THE README!!! Also if you want to make one for your rom, also read the readme - it's easy and _should_ work

Success stories are welcome ;)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
If I find a source that patches cleanly and compiles as a module then I can add it. I'll try to take it from either CoCore or Chrono kernels. Will let you know.
[Galaxy S Advance I9070 Original Android Developmen] pizzadox11:
but as a developer what do you think?

its should work? worth to try?
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
I always try :) As a matter of fact [MENTION=4277888]qbastrzem[/MENTION] has P version and says that it works (the kernel), but I don't think nfc works. I'll try to add it at some point though

btw you could get a smaller footer...
[Galaxy S Advance I9070 Original Android Developmen] pizzadox11:
cool i will

and about the nfc i can forget about it even the roms not suppot the p version :(((

EDIT: working cool as a motha fukka on the p version and on carbonrom
[Galaxy S Advance I9070 Original Android Developmen] qbastrzem:
I have P version. but I have installed cm11 non p version with no NFC support. But i think there is relase cm11 team canjica with NFC.
[Galaxy S Advance I9070 Original Android Developmen] gadiyari:
Deepest sleep level

I use MK Kernel r4.2.2. How can i check the deepest sleep level? The terminal command "cat /d/cpuidle/stats" does not supply this information.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
if you did ls /d/cpuidle you'd see deepest_state file... seek, and you will find ;)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
[MENTION=5695278]ChronoMonochrome[/MENTION] [MENTION=5840412]ace2nutzer[/MENTION] I've been thinking - our devices are quite similar. It should be possible to build cross-device kernel and only swap ramdisks for different phones and roms. Any differences in hardware would be solved either by including all necessary drivers in kernel or building them as modules if possible and loading appropriate ones either via init shell script or init.rc script.

The same thing should be possible with mali module - I have a branch with upgraded module (only one minor patch level, but it was a rather quick and dirty patch) that compiles and works (though I think it uses more batt, but it's not tuned in any way). Compiling mali driver as module and loading it on boot will enable testing of different versions without the need to flash entire kernel.

Just some random thoughs... :) I will try to do it in the near future :)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Hey guys ;) accidentally i did a small idle battery life test - just didn't use my phone for most of the day and here are the results ;) it uses around 0.3% of battery power hour (Wi-Fi and mobile data off). This gives about two weeks of standby ;) it's more than any of my dumbphones ever had ;)

So if anyone ever tells you that smartphones have short battery life, show them this and send them to the dumbphone hell :P

There are also two screenshots from my "normal" use.
[Galaxy S Advance I9070 Original Android Developmen] bitmad:
My phone feels that screen on time impossible to be achieve. My sccreen ot time is around 2h, and I am using r5 release.
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
That impossible to achieve if you use 3G/wifi etc. The second "consumer" is UI, I remember tests which I did in the past - when just watching video(and almost not use UI), the longest SOT what I get was 6,5 hours. So it make sense to use as lightest UI as it possible - maybe install Nova launcher/Apex instead of standard ones(trebuchet etc), and tune GPU freq limits to reduce use of higher GPU freqs, when it's not needed.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
3g is the biggest standby time killer... wifi isn't so bad. I solved both problems (when I used them) with an app (llama, but any tasker-like app is fine) that connects only from time to time to check the email and news and disconnects. I never needed to be constantly online...

As for the rest, it probably depends. I use Zeam launcher for a few years now and I'm happy with it ;) Vanir's ui is relatively lightweight (and dark - this is important for AMOLED screens). Screen brightness curve and autobrightness settings are also important to get a long SOT. As for standby - find and kill (seek&destroy;) any apps that wake up the phone - with screen off it draws around 80mA from the battery, so that gives around 20h. So sleep matters ;) Of course using a good cpu governor can only help :)))
[Galaxy S Advance I9070 Original Android Developmen] bitmad:
Everything is on the minimum except CPU freq.- 1050Mhz; governor and scheduler don't make such a difference on the battery drain(my opinion); screen brightness is lower possible, no 3G, no synchronisations; nova launcher in use; and I an using China made battery(1700mAh- not real) for 4-5 months, and it is calibrated. I am playing games for 20-30 min, and the battery percentage is reducedby 30% at least.
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
Some time ago I came to the conclusion that energy consumption in heavy games can not be reduced. Maximum performance requires constant work of CPU, GPU and DDR at the maximum frequency. You request something impossible, I think. In this case, there is nothing that would allow to save energy.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Only UV... but 2h SOT is a bit low... but probably it's the battery - you get what you pay for...
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
[MENTION=4832589]cocafe[/MENTION] [MENTION=5695278]ChronoMonochrome[/MENTION] [MENTION=5840412]ace2nutzer[/MENTION] [MENTION=4982868]hastalafiesta[/MENTION] and everybody using this kernel.

Guys, do you use swap or zram? Because I intend to remove it from release version. IMO our device has enough ram (esp with 4.4) to work just fine without swap, so keeping all that code in kernel/mm paths is pointless (not that after removing it it'll run noticeably faster, because that code is probably highly optimized, but the less code the better, especially in critical places).

The other thing is that current configuration is somewhat incomplete, because according to this document

https://source.android.com/devices/tech/low-ram.html

memory cgroup and mem resource accounting should be enabled for kk and they aren't, so android's memory/swap management isn't working optimally - probably doesn't work at all and instead relies on linux swapping only, which is less that optimal for android...

The problem with enabling those options is that they introduce memory overhead - depending on which version we use (and that's what I'm trying to find out now) it is from 20 (worst case) to 4 bytes per every 4k (page) of memory, which gives between 3840k and 768k of memory used. Of course this cost allows for more efficient management(in fact any management at all) of potentially unlimited amount of swap, but it's only justified when it brings performance improvements.

So the question is - does swap help you in anything? I'm asking about cases where you can actually see/feel the difference when turning swap on or off.
[Galaxy S Advance I9070 Original Android Developmen] pictorul20:
In my case, no, it even makes the phone a lil` bit laggy when i-m playing heavy games.
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
From my own experience I can say that those 630 MB of RAM never were enough for me. I did multitasking tests with and without zram, I run two "big" apps (like firefox and ppsspp) + few relatively small apps. If you accidentally ran too many "small" apps(in my case ~10-12 apps + some background processes), one(or both) of "big" apps is very likely getting killed. Enabling zram helps with that. For now I use zram with lz4 compressor, which was backported to LK 3.0 by [MENTION=3332811]faux123[/MENTION] . Not so sure, but lz4 seems better than default one.
[Galaxy S Advance I9070 Original Android Developmen] errorsys:
Battery life

It is maybe a noob question but how/where to change mali options from post #1 ?
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Yes - it is a noob question and unfortunately the answer is simple - if you can't find them, you shouldn't touch them anyway. It's for your own safety, believe me. You can destabilize the phone in a very subtle way using them incorrectly (did that). What's more, they are not necessary to get a decent battery life.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Do you use it with memcg and resource counters enabled?

The question is more about real life usage than tests - you can always create a test that stresses a certain part of the system. But in a day to day usage i didn't notice anything annoying with swap off (and nobody ever complained about it here either, and it's not enabled by default almost from the beginning)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
That's almost the longest time ever (I once had 122 hours, but it was on gb and happened only once)