yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Android Development] Mike60:
My new installed i9100 :o

i9100 NO Root ! Why ?

DG-310

Tomorrow i will test i9082.

I don't need better mobiles. I am happy with this ;)
[Galaxy S II Android Development] the.divergent:
This should be in CM13 theard/or any else connected with your rom. You are reporting in wrong theard. And without enough details. Let's assume that you've installed newest build of CM13, you have to enable root by going settings->about phone->click on build number 8 times->back to the settings->developer options->root->change from disabled to apps and adb.

If you have installed custom root, like SuperSU by flashing .zip, do the complete wiping and reinstall ROM, this time without flashing SuperSu.zip and do the steps above. Cheers
[Galaxy S II Android Development] atuser:
@ Lanchon

Does this kernel support 2 way call recording?
[Galaxy S II Android Development] falke69:
I use two Samsung Galaxy S II i9100. One is on CM12.1 (20160203) with lanchons trim kernel and the other one on CM13 (20160314).

First of all: Trimming works on both.

But on CM12.1 it takes much longer time (about 90 seconds) to trim same amount of space. With CM13 trimming is done in about 10 seconds.

On both phones about 1.2 GB were trimmed. Data partition is formatted with vfat. system and cache are formatted with ext4.

What can be the difference between both phones ? Hardware of memory seems to be the same.
[Galaxy S II Android Development] cherryb8844:
I think cm13 is more fast then 12.1 :confused:
[Galaxy S II Android Development] Lanchon:
you probably have completely different eMMC modules. you can check it out.
[Galaxy S II Android Development] the.gangster:
[MENTION=4141005]Lanchon[/MENTION]

I've just seen a new kernel for the i9100 on CM13 on your linked download page:

kernel-Lanchon-20160314-cm-13.0-i9100.zip

After Trim and IsoRec-Support has already been merged to CM13 nightlies, could you please leave a comment here on the differences to your new kernel?

Or is it just to have the kernel as a separate download? At least I don't remember having read anything on that build.

Thx!
[Galaxy S II Android Development] Lanchon:
i777 user wanted new CM 13.0 kernel (and i did a crossflash too). so no reason not to build one for i9100, it's automated anyway and only takes 2 minutes here. sometimes i flash them to get stock kernel back or to do a first flash of a new device. there is no difference, but as soon as i finish REPIT i might go for a new isorec version.
[Galaxy S II Android Development] falke69:
Yes you are right. I checked this with "eMMC check" APP from Google play store.

One phone has eMMC modules from 8/2011 and the other from 6/2012 and they are different.

I think that is the reason. Thank you.
[Galaxy S II Android Development] Thomas_Mmm:
Very nice project, I just have a question. I dont have to install a TRIM Kernel when I am using CM13 because there is TRIM already included. Am I right?
[Galaxy S II Android Development] Lanchon:
trim is committed into cm 12.1 & 13 trees. recent cm 13 builds have it built in so you don't need my kernel anymore.

unfortunately there are no official cm 12.1 builds with trim because it was committed after the latest official build was made, so you need my kernel for cm 12.1.
[Galaxy S II Android Development] Thomas_Mmm:
Thank you for your fast answer, Lanchon. In combination with TRIM Cyanogenmod 13 seems to be a very fast and fluid ROM for our I9100. Really nice job:good:
[Galaxy S II Android Development] Mavrikmeercat:
4412 Kernel update

Sorry wrong thread..
[Galaxy S II Android Development] sgeto:
Omfg this Kernel is amazing. Seriously. It literally tripled my phone's performance and resolved issues I almost forget about or gotten used to. Thank you very much guys. Very impressive work.
[Galaxy S II Android Development] sniburn:
flashed this on AICP and got bootlooped.:(
[Galaxy S II Android Development] fireburner-de:
A little more information would help.

Which ROM, which Build?

(If you run CM13, there is no need to flash TRIM kernel, as TRIM is included since end of February. So TRIM kernel might be incompatible to new CM13 nightlies.)
[Galaxy S II Android Development] Lanchon:
UPDATE: KERNELS CAN TRIM FAT PARTITIONS

contrary to what has been said in this thread and elsewhere, the S2 TRIM kernels could always trim FAT partitions. the problem is that the FAT file system implementation does not support batch trimming (ie: fstrim), but the fact that the DISCARD mount option has always been supported on FAT has eluded us all. the mainline commit that introduced the option is here, and the corresponding code in CM's repo is here.

this means that it would probably be a good idea to add DISCARD to the default mount options of the internal sdcard in CM. deleting files from internal storage would probably become slower, but the expectation would be that overall performance should increase. the performance issues related to queue flushing that plague non-queued TRIM commands should not be a big problem in this case, since the sdcard is used mostly for media (few big files without multitasking access).​
[Galaxy S II Android Development] the.gangster:
[MENTION=4141005]Lanchon[/MENTION]

if you like to compile such kernel for us with experimental support for FAT mounted with discard option, feel free to do so.

I am pretty sure, I am not the only one who would test it. (At least here I haven't found a kernel-Lanchon-FATDISCARD-20160418-cm-13.0-i9100.zip, yet.

:)
[Galaxy S II Android Development] Lanchon:
well... no! i don't want to keep on building kernels! :) so i guess we better not find out how desirable it is lol

i've got very little time, and i feel like we need a new isorec implementation sooner or later, and other things are important too. the current isorec thing is very crappy. i've got many kernels dev asking for a solution to their stuff and i dont have a one-size-fits-all answer. and i should! well, we'll see what the community comes up with.
[Galaxy S II Android Development] Lanchon:
its not a question of whether i can publish the patch, the kernel is GPLv2, i *MUST*. the patch has been published all along in the downloads section of this project.

BUT... the patch for CM11 i9100 kernel is *extremely trivial*, because other fixes form other sources were already applied to that particular source tree. if you apply my patch on a different kernel, and that kernel does not include the other fixes, YOU WILL HARDBRICK DEVICES BEYOND REPAIR. with certainty.

after 6 months of talking and finding terrible friction to solve this, i decided to push this forward myself, even if i dont own any of the affected devices. the main thread of the project (linked form post #1 of this thread) discusses the many reasons why i think this should be safe, the state of several kernels, and what needs to be done to a kernel to "safely" mod it. this project aims to be a central repo for all this info and a place to start actual testing, so that eventually, when safety data from testing congeals, these changes can trickle into "real' kernel projects and CM itself. even a single device brick can lead to this project failing, and i ask people not to blindly apply my CM11 i9100 kernel patch to other kernels because that brick will really occur then. if you'd like to patch a kernel, please make sure you read the main thead on its entirety; it gives a clear recipe on how to do it safely.

better yet, if you are able to successfully build a CM-11 kernel for the i9100, help me do it! i used themuppets repo for blobs but there's obviously something wrong. ill ask for help pulling the blobs from a working i9100 in a message below.

how often? it depends on how much free space you trimmed, how much data you write to the complete eMMC per day, and your write amplification factor. (trimmed free space) / ( (written data per day) * (write amplification) ) = number of days the trim will last. write amplification is probably between 2 and 8 for a mostly filled eMMC. note that "filled" space percentage is 100 * ( (total emmc size) - (trimmed free space) ) / (total emmc size), so the FAT32 partition counts as used space even if it is mostly free (because it cant be trimmed). write amplification is close to 1 for a mostly empty eMMC.
[Galaxy S II Android Development] Lanchon:
in what context ext4 doesnt work on cm11? the /system and /data partitions are ext4.

thanks for the ART info!
[Galaxy S II Android Development] Lanchon:
so are you suggesting the kernel refuses to load modules because of a kernel version mismatch because mine has the "-dirty" suffix?

but then, all other kernel modules in /system should refuse to load, right? there are many modules in /system/lib/modules, can you confirm either way?

if this is the problem, should i disable version check on load or remove the dirty thing? removing dirty would make the kernel usable for cm11 m9 only. who adds dirty anyway?
[Galaxy S II Android Development] empulse92:
it wont mount it, you cant acces storage, camera fc's etc :)

i've experienced the same with exFat when the rom does not support it
[Galaxy S II Android Development] Lanchon:
as /sdcard0 you mean i guess. well many, many people say it works in the nighly thread.

you might be formatting the partition the wrong way. maybe you are mounting the partition on a PC via USB mass storage and formatting it from there. maybe you are formatting it like you would a harddisk: create a partition table, then a single partition in it, and format that in ext4. a guesstimate is that that wouldn't work; you need to create the file system right there, without the wrapping partition table.
[Galaxy S II Android Development] empulse92:
formattet it trough cwm just like exFat, which is working flawless :laugh:
[Galaxy S II Android Development] Lanchon:
i read somewhere ext4 formatting from CWM doesnt work well. try formatting through USB mass storage from linux (you can boot a live pendrive; btw linux mint 64 with cinnamon rocks!)
[Galaxy S II Android Development] mparus:
Any other kernel modules also don't load, lsmod nothing shows.

Your kernel build/config - is set CONFIG_MODVERSIONS?
[Galaxy S II Android Development] Lanchon:
i can confirm my kernel modules have

vermagic=3.0.64-CM-g89e6992-dirty SMP preempt mod_unload ARMv7 p2v8

this seems to be the problem, ill look into how to solve it
[Galaxy S II Android Development] empulse92:
loading virtualbox and the img :silly:... 5min

alright setting up this may take a while
[Galaxy S II Android Development] Lanchon:
there might be a partition table there after all! for compatibility with windows and macos. just take a look at whats there and only reformat the existing FAT32 partition. use "gparted" to format and look around, "disks" to look around.
[Galaxy S II Android Development] Lanchon:
sorry never saw your message. i might be, i dont know, i was using CM's defaults at the time of the build. i'm looking into it now.
[Galaxy S II Android Development] mparus:
Your kernel modules have string -dirty?

Modules is in the cm build or in the kernel trim package?

Modules in your cm build have this string?

My configuration: official CM11 M9 without modules with string "dirty" and your kernel trim package with string "dirty".
[Galaxy S II Android Development] Lanchon:
kernel modules in /system are in the rom, not the kernel. they dont have -dirty. my kernel has -dirty in the version, don't know who put it there.

i just recreated my build, and the kernel .config file has this line:

# CONFIG_MODVERSIONS is not set

so it is NOT set. i have 3 ways forward:

-disable the check, using the established methods (dont know how)

-disable the check editing the kernel code (i know how to do this)

-remove the -dirty in my kernel (dont know how, but this would only work with CM11 M9 EXACTLY)

please comment if you will. i will continue as soon as i have some time, probably tonight.
[Galaxy S II Android Development] Zile995:
Same chip?
[Galaxy S II Android Development] mparus:
You can try disable the check editing the kernel code? I dont have any other idea.
[Galaxy S II Android Development] Lanchon:
done, uploaded, can you try it?
[Galaxy S II Android Development] mparus:
Ok, I try.

Thanks - wifi working, on/off ok, another test tomorrow ;)

WiFi, trim, ART working ;)
[Galaxy S II Android Development] Lanchon:
same chip, type and fwrev are the important fields.
[Galaxy S II Android Development] Lanchon:
UPDATE: wifi and other issues fixed, finally! grab the new kernel from the download link in post #1.

thanks to the invaluable help from [MENTION=1784357]mparus[/MENTION]

EDIT: github sources updated.
[Galaxy S II Android Development] Незнакомец 777:
Добрый день уважаемые пользователи форума у меня есть просьба к вам помочь мне собрать ядро для kali nehunter для Samsung galaxy s2 если конечно же тема обсуждения ещё не закрыт, я уже много раз прошивал разные прошивки но не получается не работает Kali nehunter... пожалуйста помогите мне с этим вопросом заранее спасибо!

Mod Edit: English Translation Below

Good afternoon, dear forum users, I have a request for you to help me build a kernel for kali nehunter for Samsung galaxy s2, unless of course the topic of discussion is not closed yet, I have flashed different firmware many times but it doesn’t work Kali nehunter does not work ... please help Thank you in advance for this question!
[Galaxy S II Android Development] mparus:
how to

http://xdaforums.com/android/general/guide-format-ext4-internal-memory-data-t2852815

Hm, I must create ext4 on the whole internal memory, not on the partition? (/dev/sdx, not /dev/sdx1)

root@GT-I9100:/ # mount

/dev/block/vold/259:3 /mnt/media_rw/sdcard0 ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1,data=ordered 0 0

/dev/block/vold/179:9 /mnt/media_rw/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

root@GT-I9100:/ # fstrim -v /mnt/media_rw/sdcard0/

/mnt/media_rw/sdcard0/: 9457545216 bytes trimmed

you must run from adb command line:

chown media_rw:media_rw /mnt/media_rw/sdcard0
[Galaxy S II Android Development] xhoster:
Flashed your new kernel on the 23-08 nightly, wifi's working, the rest seems to work as well :)

So for now I am set and CM is trimming every night while it's on the charger? (what are the triggers for the automation?)

my setup:

[IMG="eMMC"]http://i.imgur.com/ceg8e31.png[/IMG]
[Galaxy S II Android Development] gpvecchi:
Sorry guys, I can't find any information... Is TRIM safe for me? Thanks!
[Galaxy S II Android Development] xhoster:
Look up the links in the OP. Can't find your chip in any of them (links to the different bugs). So your phone should be fine with the fixed Kernel. But please look for yourself before flashing! Just skipped through the links and tables.
[Galaxy S II Android Development] empulse92:
i cant get it working :eek: both cards are ext4 now and get mounted by android + w7 but i cant write or edit any content (camera still fc's aswell)

doesnt work for me :confused: (command not found)
[Galaxy S II Android Development] mparus:
1. From phone run terminal emulator.

2. su

3. chown .....
[Galaxy S II Android Development] Lanchon:
cool!! thanks for testing :)
[Galaxy S II Android Development] Lanchon:
yes, i assume the CM guys didnt disable the auto trim feature. but confirmation by looking at the logs would be welcome. the triggers are the standard android 4.3 trim triggers.

anyway, trim with lagfix once at least to test. also vold auto trim only trims writeable file systems, so /system will be ignored.
[Galaxy S II Android Development] Lanchon:
check the table linked from the OP. no info means there means no known bugs.
[Galaxy S II Android Development] Lanchon:
once the stock internal sdcard partition (and same for ex sdcard) is exposed via usb mass storage, two things could happen: it could be a raw file system, or it could be a partition table hosting one partition with a file system. determine which is the case and keep it that way.

ext4 file system has A LOT of options: journaling, type of journaling, many extensions that break compatibility with previous ext versions, etc. if you create a new file system, the options could be off somehow. you can find a base set of options in the /data file system.

if the whole process is not trivial, maybe you should create a separate thread for it or continue an existing one? if u do, please link it from here.

as always, i dont have a device so i cant be of much help :(
[Galaxy S II Android Development] mparus:
Ext4 on internal memory working when I format it from linux (cwm mount usb) as whole disk - mkfs.ext4 /dev/sdx, not as partition.

Android apps write on ext4 storage - chmod media_rw:media_rw /mnt/media_rw/sdcard0 solve problem.

Trim on /mnt/media_rw/sdcard0 working.

I
[Galaxy S II Android Development] Lanchon:
ok. you obviously did the chmod from android. for reference, only detail is whether you chmod with the partition mounted or just the empty directory.
[Galaxy S II Android Development] mparus:
chmod from android when ext4 partition mounted
[Galaxy S II Android Development] empulse92:
this is what i get when using the partitioning linux :confused:

gpt partition table is correct or should i use another one?

edit> oh i see

edit2 still not working <( do i need to set any flags?
[Galaxy S II Android Development] mparus:
from linux

- create in gparted new gpt msdos partition table

- new partition table without any partition

- create filestytem on device /dev/sdc - confirm yes
[Galaxy S II Android Development] Lanchon:
as mparus informed us, you need to create a RAW file system.

i'm assuming /dev/sdc is the USB mounted device corresponding to your internal sdcard.

so the phone exposes the internal sdcard partition as a USB drive. you can write anything you want to it, but it must be written in a certain way if you want the phone to later understand the partition.

what you did was: create a partition table in the device /dev/sdc. then created an ext4 partition in it called /dev/sdc1. note that the storage of this usb mass storage 'virtual' device is backed by a partition in the phone's emmc. so now you have the emmc's main partition table, and in one of its partitions you have a NESTED partition table, with a further nested ext4 partition. linux probably can't make sense of nested partition tables, and if it did, how would the devices for its partitions be named? and to make sense of a nested partition, the emmc's main partition table should declare a 'nested partition' type for the nested partition. otherwise, why would the kernel try to parse it at all? (it doesnt and you cant access nor change the outer partition table via USB mass storage.)

so its clear that this setup shouldnt work. what you need to do is make a file system RAW on the complete device.

something like: mkfs.ext4 /dev/sdc

you need to unmount and delete all nested partitions first (ie: /dev/sdc1). you may also want to delete the partition table itself and then reboot your PC before making the raw file system, but that is probably unnecessary.
[Galaxy S II Android Development] xhoster:
The lagfix trim worked well from the beginning!

looked the triggers for the auto trimming (and normal android maintenance) up:

- 24hrs or more since the last maintenance window

- 80% or more battery not on charger or 30% or more battery on charger

- the device has to be untouched for over an hour

couldn't find any traces of trimming this morning in the log, but will do another tomorrow, since it could be less than 24hrs since the last maintenance.

About /system: how often should the partition be trimmed manually? I couldn't find any info on how much writing activity is going on in /system (if any!) and therefore couldn't determine how often it should be done by myself.

Thanks for your work :)
[Galaxy S II Android Development] Lanchon:
whenever you flash a new rom or gapps. and only if the amount of free space justifies it. it seems /system is pretty much filled up these days, so trimming will only add very little trimmed free space to the emmc.

i think the preload partition might be unused under CM. and its half a gigabyte. much better if you trim that, especially if you can wipe out all content. of course you do it once and then forget about it forever. doing that is equivalent to increasing the emmc overprovisioning, as data will never be written in that area.
[Galaxy S II Android Development] xhoster:
I shrinked my preload partition to 45mb with one of the PIT files from your OP-links. So will trim that and report back when I got around to see if I can find fstrim in logcat!
[Galaxy S II Android Development] mparus:
yes
[Galaxy S II Android Development] empulse92:
still doesnt mount
[Galaxy S II Android Development] Lanchon:
naaaa, 45mb arent worth the trouble! :)
[Galaxy S II Android Development] empulse92:
thank you very much for this instruction ! :highfive:

but i am getting this in the last step

root@GT-I9100:/ # cd /mnt/media_rw/
root@GT-I9100:/mnt/media_rw # ls -la
drwx------ 5 media_rw media_rw 100 Aug 29 15:33 .
drwxrwxr-x 15 root system 360 Aug 29 15:33 ..
drwx------ 2 media_rw media_rw 40 Aug 29 15:33 sdcard0
drwx------ 2 media_rw media_rw 40 Aug 29 15:33 sdcard1
drwx------ 2 media_rw media_rw 40 Aug 29 15:33 usbdisk0

root@GT-I9100:/mnt/media_rw # chown media_rw:media_rw sdcard1
chown: sdcard1: Read-only file system
1|root@GT-I9100:/mnt/media_rw # chown media_rw:media_rw sdcard0
chown: sdcard0: Read-only file system
[Galaxy S II Android Development] mparus:
Please show the output of command mount.
[Galaxy S II Android Development] Lanchon:
there is some confusion here. the raw file system you need to create in the INTERNAL sdcard. (btw you *can* mount nested partition tables, you need to expose the partition as a loop device and then instruct the kernel to look for partitions within that device. i don't think android does this, but maybe it does. like i said, it's better to preserve the original setup (raw vs partition table) of the internal sdcard.)

the external sdcard is a real device and the phone's kernel will understand a partition table in it for sure. so you don't need to create a raw file system here, its probably safer if you fire up gparted, create a new ms-dos style partition table, and create a partition in it. partition alignment should be 1MB, as per gparted defaults. (the partition table will declare the existence of data in the sdcard to OSes that can't discover an ext4 partition by its header.)

so yes, like that. but only for the internal sdcard.

if the phone doesnt mount the partition, it may require the chown mparus has been talking about (execute from the phone's shell).

to debug mounts logcat doesn't seem very useful since its more of a linux than an android thing. try dmesg instead.
[Galaxy S II Android Development] mparus:
Yes :) but the analogous howto works for the internal and external memory.
[Galaxy S II Android Development] empulse92:
There was no output after the Mount Command, after formatting to vfat before it showed 1line..

But for now i got bigger trouble... Accidentaly wiped my SATA drive :silly:
[Galaxy S II Android Development] mparus:
:(

Mount from android system - last command in my howto