[DEV][KERNEL][CM] btrfs [3G/DS/LTE][EXPERIMENTAL] - Galaxy S 4 Mini Original Android Development

What?
btrfs in our kernel source is broken. Here is a patch and a test build.
Disclaimer
This is aimed at developers and enthusiasts keen to experiment with btrfs. The main purpose is sharing the fix in hope it'll be useful to some. The builds might not get maintained.
builds are plain cm-11.0 kernels w/ btrfs support added.
It does not convert your partitions to btrfs. In order to use btrfs you have to manually set up your partitions, ramdisk etc.
Currently there is no Recovery available with btrfs support
Our S4 Mini kernel is quite aged (v3.4) and btrfs was still marked experimental.
Use at your own risk!​
Where?
Pick a copy from the attachment
Why?
Some say it's the better file system. Fact is it's a next generation file system featuring copy-on-write, transparent compression, subvolumes, raid, snapshots.. to name a few. Here is a read on arstechnica: http://arstechnica.com/information-...t-and-atomic-cows-inside-next-gen-filesystems.
Transparent compression might be particular useful to speed up lame flash memory and gain some extra space. Let's write a bunch of zeros onto the internal eMMC:
a) standard fs
Code:
$ busybox dd if=/dev/zero of=/data/ext4/zero.img bs=100M count=1 conv=fsync
1+0 records in
1+0 records out
104857600 bytes (100.0MB) copied, 11.337250 seconds, [COLOR="DarkOrange"][b]8.8MB/s[/b]
[/COLOR]
b) btrfs with compress=lzo
Code:
$ busybox dd if=/dev/zero of=/data/btrfs/zero.img bs=100M count=1 conv=fsync
1+0 records in
1+0 records out
104857600 bytes (100.0MB) copied, 1.170487 seconds, [COLOR="DarkOrange"][b]85.4MB/s[/b]
[/COLOR]
Only ~3MB required for 100MB of zeros:
Code:
$ busybox df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p24 512 [COLOR="DarkOrange"][b]3[/b][/COLOR] 505 1% /data/btrfs
Obviously this is the extreme end of the performance gain, but you get the idea. Needless to say there won't be much gain with files already compressed like most archives or multimedia files.
Another boost could be achieved by setting up a btrfs raid between internal eMMC & external sdcard.
What else?
Partitions have to be formatted with mkfs.btrfs -O ^extref or they won't mount
Code?
src: https://github.com/CyanogenMod/android_kernel_samsung_msm8930-common
patches: see attachment
Feel free to use patches to make btrfs available in your Kernels, ROMs and Recoverys
Credit?
@arco68 for his kernel & device repos
@impactor for the idea
---

Well, I'll be damned. It is quite possibly the first mobile phone kernel on XDA with BTRFS support
Excellent you frontier man, you!
An immediate suggestions.
Perhaps you could switch your base from generic CM kernel to F4K's kernel. It has lots of valuable extra features in it and - more importantly - it has built in fstab.build script which makes it easier to add/edit btrfs mount options. Speaking of which - it would also be useful to explain how to add/edit those mount options and what options to use. I have no time nor patience for codding, but I could cover that part.
PS
WTF is the i9195-lte kernel?

Please for 9195 too and lollipop ?, thanks for the awesome work

impactor said:
Perhaps you could switch your base from generic CM kernel to F4K's kernel. It has lots of valuable extra features in it and - more importantly - it has built in fstab.build script which makes it easier to add/edit btrfs mount options. Speaking of which - it would also be useful to explain how to add/edit those mount options and what options to use. I have no time nor patience for codding, but I could cover that part.
Click to expand...
Click to collapse
For the moment it's unlikely to happen. The kernel is only one part of the story. To make it noob friendly it'd also require a Recovery with btrfs support, ideally shipping btrfs-tools too.

aguaz said:
For the moment it's unlikely to happen. The kernel is only one part of the story. To make it noob friendly it'd also require a Recovery with btrfs support, ideally shipping btrfs-tools too.
Click to expand...
Click to collapse
This is correct, but how does it affect switching to f4k's kernel?

impactor said:
This is correct, but how does it affect switching to f4k's kernel?
Click to expand...
Click to collapse
I have no idea how f4k patches / builds his kernel and ramdisk. It's not worth the effort for just another test version.

aguaz said:
I have no idea how f4k patches / builds his kernel and ramdisk. It's not worth the effort for just another test version.
Click to expand...
Click to collapse
You can find his sources here: https://github.com/F4k/f4ktion_kernel
Is it not as easy as switching from one source to another?

impactor said:
Is it not as easy as switching from one source to another?
Click to expand...
Click to collapse
edit:
Not quite.
I gave it a go but ran into build errors. Probably caused by using different toolchains. I'm not very patient to look further into it atm, sorry.
impactor said:
WTF is the i9195-lte kernel?
Click to expand...
Click to collapse
Aronuser said:
Please for 9195 too
Click to expand...
Click to collapse
Added i9190/i9195 versions

Related

Google Android Development

TIME TO MOVE ON
i wil be on xperia section
i am happy that i could help this section
Best Regards, Happy Cookling and Programing!
Hy all
I started this tread because the interest to android is growing
I invite all people with linux knowledge or C programing skills to join
If you know some hardware programing is better
We need
- developpers
- testers
i will not post an guide how to setup the compiler and set variables
if you dont know this stuff please stick to Google Android thread and dont post here stupid questions as IT IS READY / WHEN WILL IT BE READY
WE DO THIS IN OUR SPARE TIME AND WE HAVE FAMILY AND LIFE
So shell we invite the penguin to our phones?
WIKI Page
(Thanks Bikor_gj)
http://wiki.xda-developers.com/index.php?pagename=Niki_Android
GIT Trees
Vogue
http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-vogue
MSM
http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-msm-2.6.25
Reserved For Messages
Build Instructions for the ones that want to help
- Create working dir:
Code:
mkdir ~/android-kernel
- Go to the dir:
Code:
cd ~/android-kernel
- Clone the Linuxtogo GIT:
Code:
git clone git://git.linuxtogo.org/home/groups/mobile-linux/kernel.git
- Go into newly created dir:
Code:
cd ~/android-kernel/kernel
- Create a new branch, call it htc-msm and link it to the official htc-msm development branch:
Code:
- Descend into the "main" android dir:
Code:
cd ~/android-kernel
- Get toolchain:
Code:
wget http://www.codesourcery.com/gnu_too...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
- maybe you need to rename the just downloaded file (because after .tar.bz2 wget has added ?lite=arm). (HINT FOR LINUX-NEWBIES: USE TAB TO COMPLETE KNOWN FILENAMES!! - In this case type: mv arm(TAB) arm(TAB) -> backspace till 'bz2' is the last word)
Code:
mv arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2\?lite\=arm arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
- unpack the toolchain:
Code:
tar -xjf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
- ascend again into the 'kernel' directory:
Code:
cd ~/android-kernel/kernel
- make the kernel:
Code:
git checkout -b htc-vogue origin/htc-vogue
You also have to use
Code:
make vogue_defconfig ARCH=arm
- export path so the newly downloaded toolchain will be used instead of your default compiler (which would compile for your computer instead of your phone):
Code:
export PATH=~/android-kernel/arm-2008q1/bin:$PATH
- make the zImage-file:
Code:
make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Now the zImage file is created inside the directory kernel/arch/arm/boot.
When uploading this to your phone, remember that you only have to replace the zImage after each kernel build - the Linux environment on top of the kernel can just stay the same, so initrd (which is the ramdisk filesystem) can stay the same.
BR
Reserved For Kernel Status
Kernel status
no more power button //thanks biktor_gj
nike mtype added
audio working
call working
data working
sms unknown //due to keyboard and ts
keyboard screwed // somethings not right needs investigation
OnSreenKeyboard working
Touch screwed // SOLVED
when this kernel probelms will be solved i will release the new kernel
I have knowledge of both C and linux so I vollunteer
hi,
i can be a tester... also i have some little linux knowledge...
I have limited knowledge of both c and linux, so I possibly could help.
It seems useful however to setup an SVN or something, so even 'non-registered' developers can write patches and submit them for review. You can set up such an SVN for free at assembla.com, together with a wiki, TRAC and more. They even say you can ask for more storage space and stuff if your project is an open-source project.
If you have such an SVN developers like me can help without making any false promises of some sort.
I hope you know what I mean, it sounded better in my head
i know linux and i can do beta tester. i'm studying engineering too.
i also know linux and a bit of C...i can do testing too.
as you already know, I'm in too for development...
i will try the new kernel asap...
I tried this kernel and indeed, the keypad works on mine!
(touched the TS though, just because you said I wasn't allowed ) It froze, so reboot...
awesome! keys work all good! numbers work and also dpad and enter works!
(by the way: how will you make it possible to enter text? android is coded to enter numbers...
the_fish said:
awesome! keys work all good! numbers work and also dpad and enter works!
(by the way: how will you make it possible to enter text? android is coded to enter numbers...
Click to expand...
Click to collapse
I believe by the end of this year or somewhere in the beginning of 2009 Google is making a system for creating software input methods, which would theoretically allow us to write an application that would reroute direct hardware input. I think. We'll have to see what the future will (or the talented developers here) bring.
man, awesome!!! good job, jerpelea. keys work great!!
graey said:
I believe by the end of this year or somewhere in the beginning of 2009 Google is making a system for creating software input methods, which would theoretically allow us to write an application that would reroute direct hardware input. I think. We'll have to see what the future will (or the talented developers here) bring.
Click to expand...
Click to collapse
ok... the onscreen keyboard would be ok for the time we have to wait
Jerpelea: Why do you want Ubuntu as dev os? I'm using OpenSuSE and am able to build the kernel.
I am thinking (since 2 weeks) to try Ubuntu again (used to use it), but may take while before I get to it...
Boylen said:
Jerpelea: Why do you want Ubuntu as dev os? I'm using OpenSuSE and am able to build the kernel.
I am thinking (since 2 weeks) to try Ubuntu again (used to use it), but may take while before I get to it...
Click to expand...
Click to collapse
I think he is just saying that because it's easier for people to use??
works fine for me on vanilla debian
new kernel works fine screen still too responsive keys work calls work
it works! but after few minutes my nike is auto-turned off :O
garsim said:
it works! but after few minutes my nike is auto-turned off :O
Click to expand...
Click to collapse
i guess we have turn the auto turn off in wm to unlimited or run it on usb plug...

[TUT] Building your own Xperia Play Kernel

Since We have such a fantastic tutorial on how to build your own CM9, I thought I'd add one for building a kernel.
Edit: updated kernel sources for jellybean
First off:
You NEED Linux. DO NOT TRY THIS ON WINDOWS, IT WON'T WORK.
Sources: https://github.com/CyanogenMod/semc-kernel-msm7x30
https://github.com/DarkforestGroup/sony-kernel-msm7x30-ics
https://github.com/DooMLoRD/Xperia-2011-Kernel-2.6.32.9
http://forum.xda-developers.com/showthread.php?t=1556971
http://forum.xda-developers.com/showthread.php?t=1477845
http://developer.sonymobile.com/wp/2011/05/06/how-to-build-a-linux-kernel/
DooMLoRD, KeiranFTW & Atarii.
Prepping:
1) Grab the toolchain I have here (Android NDK R5b), it's the only one I've been able to use that doesn't throw errors when compiling (stock based kernels): http://db.tt/hE3TmJJi Doom has provided a better toolchain https://github.com/DooMLoRD/android_prebuilt_toolchains[/QUOTE] you can get it using
Code:
git clone https://github.com/DooMLoRD/android_prebuilt_toolchains.git -b master <optional_folder_name_you_choose>
(thanks Doom!!)
Building a kernel from fxp sources
1) Terminal for any commands, file explorer for finding stuff & gedit for changes.
2) open up terminal, mkdir <name_you_want> (no spaces)
3) cd <name_you_want>
4) git clone https://github.com/freexperia/semc-kernel-msm-7x30-ics -b ics <optional_name_you_want_the_folder_to_be> (no spaces)
5) cd <optional_name_you_want_the_folder_to_be>/semc-kernel-msm-7x30-ics (if you didn't rename it)
6) (If this is after the first time, and lets say a week has past do this step, otherwise ignore) git pull (automatically updates any files)
7) First important step: Find the defconfig that fxp uses. They are located in arch/arm/config. fxp_zeus_defconfig is the name of theirs
8) copy fxp_zeus_defconfig & rename to <what_you_want_it_named>_zeus_defconfig (for example, mine will be pax_zeus_defconfig)
9) open up your defconfig & put it into another workspace, we'll mess with it later
10) Hop onto DooMLoRD's github, his we'll use for references.
11) Adding governors: https://github.com/DooMLoRD/Xperia-...mmit/bec19001ded34077d7776639834a1229b69e5f87
A1) Well, as I look into this, fxp has a ton of governors not used... (located in <name_of_kernel_folder>/drivers/cpufreq/
A2) Check the Kconfig file to see that they're all in there (they must just not be in the defconfig file)
A3) Edit the deconfig file you created in lines 467-474 removing "#" from any you want to add (and add in any you might've added by adding the line CONFIG_CPU_FREQ_GOV_<NAME_OF_GOVERNOR>=y
A4) If you want to add more governors, check out the Commits from DooMLoRD's build to add in when needed (anytime you see a "+" that means line added, "-" means line deleted)
12) Adding IO Schedulers: https://github.com/DooMLoRD/Xperia-...mmit/0ae625f7561c559d4933284f489733bf5eb66e96
B1) Navigate to <name_of_kernel>/block folder
B2) Once again, FXP has a ton of IO Schedulers added, but not used in Play kernel:
B3) Open up Kconfig.ioshced to make sure they're in there (and add any you want)
B4) Edit the defconfig file you created (lines 121-137) & fix it to your liking (same as above)
B5) If you want to add more, see Doom's commits to add 'em
13) Turning off ALS
C1) Navigate to <name_of_kernel>/arch/arm/mach-msm
C2) Open up board-semc_zeus.c
C3) Search for .als_connected (it on line 1349)
C4) Change the variable from 1 to 0
14) Overclocking
D1) open up arch/arm/mach-msm/acpuclock-7x30.c
D2) Lines 96 - 144 contain the PLL2 table, which is used to set clock speeds, note FXP can go all the way up to 2ghz, they just stop it short.
Continued in post 2 because all of this in one post 20% more awesome than XDA can handle
Pax
Cont'd from post 1
15) Building the Kernel
E1) Save your defconfig file, you'll need it now.
E2) naviage to <name_of_kernel> folder (in terminal)
E3) Type in "ARCH=arm CROSS_COMPILE=<path_to_cross_compiler_i'll_use_min e_for_example>/home/paxchristos/Android_Source/doom_ndk/arm-eabi-4.4.3//bin/arm-eabi- make <what_you_put_here>_zeus_defconfig
E4) Type in "ARCH=arm CROSS_COMPILE=<path_to_cross_compiler_from_above>/arm-eabi- make
E5) Sit back and relax (assuming it doesn't throw any errors, if it does, post here & I'll try to help you through them)
16) Getting the ramdisk
F1) Download a working copy of FXP's kernel (either through my zips or fxp zips)
F2) Goto here: http://forum.xda-developers.com/showthread.php?t=1477845, download the xperiaboottools.zip that's attached.
F3) Now what I did (you don't have to) is chmod 755 mkbootimg & split_bootimg.pl & (sudo) cp to /bin for easy calling.
F4) Navagiate in terminal to where you downloaded fxp kernel
F5) mkdir <working_folder>
F6) cp <fxp_kernel> <working_folder>
F7) cd <working folder>
F8) split_bootimg.pl <fxp_kernel>
F9) mkdir ramdisk
F10) cd ramdisk
F11) gzip -dc ../<fxp_kernel>.img-ramdisk.gz | cpio -i
F12) Now you have the ramdisk, let's futz with it.
F13) First (easiest step) is to goto default.prop & change ro.secure=1 to ro.secure=0
F14) That's mainly what we want to do with it, if you want to change the boot image, go here: http://forum.xda-developers.com/showthread.php?t=1494076 for how to do it manually, or here: http://forum.xda-developers.com/showthread.php?t=1513146 for the automatic way.
F15) now that we're done with the ramdisk, we'll go back to terminal
F16) find . | cpio -o -H newc | gzip > ../ramdisk.img
F17) cd ../
17) Putting the ramdisk & kernel together
G1) By now (hopefully) the kernel is done compiling. (time for terminal, you should still be in folder you were above)
G2) cp ~/<folder_you_put_the_kernel_source_in>/arch/arm/boot/zImage ./
G3) mkbootimg --base 0x00200000 --kernel zImage --ramdisk ramdisk.img -o <what_you_want_to_name_your_kernel>.img
18) Flashing it for testing.
H1) Keep your copy of FXP's kernel around, just in case any issues happen
H2) fastboot boot <your_kernel>.img
H3) If it boots & works, SUCCESS!! you modified your own custom kernel!
H4) If it doesn't boot (at all, just a vibrate & blank screen for 10-20 seconds) there's a problem with the ramdisk, sometimes it's bad, sometimes is needs filler, overall, it's just a pain in the butt to figure out.
H5) If it boots & bootloops the splash screen, well, that's an issue with the ramdisk again, that possibly, your ramdisk does not match you rom. Recovery, reflash rom & try again.
Courtesy of Atarii reminding me
19) Adding your wifi modules (they get built when you build the kernel) into the ramdisk
I1) Let's pretend that you haven't gotten through step F16, we're gonna add the wifi modules in.
I2) The wifi modules are located in <name_of_kernel_source_folder>/drivers/net/wireless/
I3) Copy bcm4329.ko to ~/ramdisk/working/modules/
I4) Add in the following lines to init.semc.rc
Code:
#load bcm4329 module
insmod /modules/bcm4329.ko
I5) Now your modules will autoload on boot!
Pax
Excellent guide
It may be because I'm both skeptical of us R800x users ever getting a real ICS, and the fact that going back to gingerbread sounds really tempting, but do you know / could you list the differences for compiling a gingerbread kernel for, say, CM7?
Kieran just told me to go to Sony's site. Thanks!
Sent from my R800x using XDA
Now I've read over this but I'd like to know exactly what a new Linux kernal can do for us? Does it allow us to do more stuff with any custom rom we create?
lightningdude said:
It may be because I'm both skeptical of us R800x users ever getting a real ICS, and the fact that going back to gingerbread sounds really tempting, but do you know / could you list the differences for compiling a gingerbread kernel for, say, CM7?
Click to expand...
Click to collapse
Do this in place of #4 (in the guide)
4) git clone https://github.com/freexperia/semc-kernel-msm7x30 -b master <optional_name_you_want_the_folder_to_be>
& You'll get their sources for GB instead of ics
Alternatively, if you wanna do it from SEMC kernel sources,
Download them from: http://developer.sonymobile.com/cws/devworld/technology/opensource un-tar/bzip them & work from kernel/
Phryxus said:
Now I've read over this but I'd like to know exactly what a new Linux kernal can do for us? Does it allow us to do more stuff with any custom rom we create?
Click to expand...
Click to collapse
Here's a better explanation than I can do
bassmadrigal said:
/cut/
The kernel is kinda like the nervous system of the body. It directly interacts with the hardware (which is how it is able to adjust CPU speed) and it is what allows the ROM to function.
The ROM is the rest of the body. Every other aspect of the phone. In fact, most ROMs include custom kernels. Various ROMs give you various features/enhancements/bugfixes. You will probably notice the biggest change in your phone if you load a custom ROM. Most people load the custom kernels to help with battery life as a lot of them allow you to lower the phones minimum processing speed from 245Mhz to 128MHz.
The ROM can change so many different aspects of how the phone works. There is CyanogenMod which is based off of stock Android with a lot of tweaks, bugfixes, and new features added. There is also MIUI, which is similar to the iOS style (not the same, but much closer than stock Android), and then there are a ton others out there.
Click to expand...
Click to collapse
This is an awesome guide, definitely recommend to all, if you're interested in getting into kernel development.
The only thing maybe worth mentioning is where to copy the compiled wifi drivers and modules (governors etc) from, after the kernel has compiled
I'm having a problem at the "Building the Kernel" step. I ran the command, albeit slightly different than you wrote, and got this error:
"make: *** No rule to make target `mjolnir_zeus_defconfig'. Stop."
Do I not have my NDK installed properly, or what?
Edit: Nevermind, was hit by a confusion spell. It's cured, and all is well. At least, for now.
btw, in the future you will want to clone: https://github.com/CyanogenMod/semc-kernel-msm7x30.git
ics branch
But FXP haven't updated kernel in a while, so you could use my CM9 kernel sources if you like: https://github.com/DarkforestGroup/sony-kernel-msm7x30-ics
master branch
Difference is, mine is made from pure Sony PLAY beta sources, while FXP use arc beta sources
I have successfully compiled a kernel for CM7. Thanks, pax, for this tut, and all other developers for their contributions!
Sent from my R800x using XDA
the NDK toolchain isnt good...
i have test them and they throw un-necessary errors...
best use gcc-4.4.3 toolchain from CM repo... it works with almost all device kernels i develop for...
u can also try gcc-4.6.2 toolchain (linaro)...
a working copy of both can be found at my git repo:
https://github.com/DooMLoRD/android_prebuilt_toolchains
DooMLoRD said:
the NDK toolchain isnt good...
i have test them and they throw un-necessary errors...
best use gcc-4.4.3 toolchain from CM repo... it works with almost all device kernels i develop for...
u can also try gcc-4.6.2 toolchain (linaro)...
a working copy of both can be found at my git repo:
https://github.com/DooMLoRD/android_prebuilt_toolchains
Click to expand...
Click to collapse
+1 to that, I use your arm-eabi-4.4.3 prebuilt
lightningdude said:
I have successfully compiled a kernel for CM7. Thanks, pax, for this tut, and all other developers for their contributions!
Sent from my R800x using XDA
Click to expand...
Click to collapse
Apparently I was a little premature in my findings. Having a hell of a time with the fxp sources for CM7. For some reason, I just can't get my cpu frequencies to come down from Max. DooMLoRD, what am I missing?
Sent from my R800x using XDA
It's been a while since I gave an update here, but my ics kernel is doing fine. I just gave up on gingerbread. My new question: How would I go about changing recovery and such? I prefer DooMLoRD's recovery over Keiran's, but since I'm using Keiran's sources, I don't know what to do to get a different recovery.
Sent from my R800x using XDA
lightningdude said:
It's been a while since I gave an update here, but my ics kernel is doing fine. I just gave up on gingerbread. My new question: How would I go about changing recovery and such? I prefer DooMLoRD's recovery over Keiran's, but since I'm using Keiran's sources, I don't know what to do to get a different recovery.
Sent from my R800x using XDA
Click to expand...
Click to collapse
Try replacing the recovery executable in /sbin/ with DooMLoRDs
Sent from my Xperia Play using Tapatalk 2
KeiranFTW said:
Try replacing the recovery executable in /sbin/ with DooMLoRDs
Sent from my Xperia Play using Tapatalk 2
Click to expand...
Click to collapse
I'm at work right now, but I'll try when I get home. I plan on doing some digging for the sake of learning, but that's going to wait for the weekend.
Sent from my R800x using XDA
Edit: Thanks Keiran, that worked. Like I said, I'll be poking around some more this weekend, just to see what I can mess with. Too bad I never got this far on my older phones...
looks good! so gonna try this tomorrow to build a cifs.ko module from latest Se source
watching a movies on phone, here I come
Hi great tutorial, but I'm having a problem with the wifi I have tried taking my bcm4329.ko from drivers/net/wireless and flashing it via CWM also tried moving it to system/lib/modules manually on my phone but still can't get it to work. Any idea how to fix this, its the only thing keeping me from using my own kernel
Sent from my Xperia Play using xda premium

[DEV][TOOL][F2FS/EXT4] Agnostic-kernel - Partition-agnostic kernel flasher [13/11/14]

Agnostic-kernel - filesystem independent kernel flasher
WARNING!
Please, make a backup or be prepared to roll back to a working state somehow. You are using this tool on your own responsibility. You have been warned!
If anything goes wrong, flashing another kernel that was working for you before should return your device to a working state.
Repository on GitHub
This is a recovery tool primarily made for kernel/ROM developers, but anyone is welcome to use it, provided he knows what to do. It was made to enable kernel developers to have a single .zip with the kernel which will work on all partition layouts like All-F2FS, Data-F2FS and All-EXT4 (the standard layout).
It takes a boot.img, unpacks it during the installation, finds out what partition layout is used on the device, changes the fstab in the ramdisk accordingly, repacks the boot.img and flashes it.
Instructions for kernel/ROM developers/flashaholics who wish to incorporate this tool:
Make sure your kernel is compiled with F2FS drivers.
Download agnostic-kernel-template.zip
Replace the boot.img-placeholder in the .zip with your boot.img.
OPTIONAL: change the fstab in fstab/ folder to specify any mount options you wish to use. Make sure you include a line for each partition and filesystem combination you want to use.
OPTIONAL: change the updater-script to print any additional messages or make modifications to the kernel after flashing.
Instructions for users who wish to try this tool:
Choose one of the prepacked kernels you wish to install and download it.
Install it via recovery.
Instructions for people who wish to port it to other devices:
Change the asserts in updater-script to check for your device name.
Change the fstab in the fstab/ folder. Make sure you include a line for each partition and filesystem combination you want to use.
Change the FSTAB variable in tools/repack-and-flash.sh to contain the name of your fstab file.
Change the BOOT_PARTITION variable to contain the path to your /boot partition device.
Currently supported partition layouts:
/system on EXT4 or F2FS
/cache on EXT4 or F2FS
/data on EXT4 or F2FS
Filesystem changes are supported only on these partitions because the Nexus 7 doesn't have any other EXT4 partitions by default.
If you want to add support for some other device specific layout (F2FS formatted SD card comes to mind, for example), feel free to do so or contact me, but it may require some changes to your recovery too.
Tested on:
Kernels
3.2.5-XPerience by @TeamMex
LegoKernel / SlimKernel by @legolas93
franco.Kernel by @franciscofranco and modified by @HTCDreamOn
linux-tegra-nv-3.1-grouper by @HTCDreamOn
M-Kernel by @Metallice
Recoveries
CWM Recovery 6.0.4.3 by ClockworkMod
TWRP by @legolas93[/MENTION]
MultiROM recovery by @@Tasssadar
ROMs
ROM shouldn't matter, I tested on various 4.4 / 5.0 ROMs and even without a ROM and it always worked.
Downloads
Pre-packed kernels:
Kernel from SlimROM by @legolas93
3.2.5-XPerience-19 by @TeamMex
Empty template for devs:
agnostic-kernel-template.zip​You can download other kernels using agnostic-kernel in their respective threads.
Credits:
Android Image Kitchen - @osm0sis - this wouldn't be possible without him
F2FS Recovery - @legolas93
Kernels on which I tested - @TeamMex & @legolas93 & @franciscofranco & @HTCDreamOn & @Metallice
Recovery magic - @Chainfire & @_that
Answers to a lot of my problems - forum.xda-developers.com community
Some nice ideas - @Metallice
Partition layout checking, scripting - @frantisek.nesveda
If you wish to incorporate or modify this tool, please, mention me somewhere, thanks
Changelog:
13th November 2014
This is a highly recommended update for all developers using agnostic-kernel.
Now completely ROM independent
Updated Android Kitchen to version 1.6 - thanks, @osm0sis!
Fixed an issue with Android Kitchen binaries using /system/bin/linker which was not always available.
First I did an ugly hack to solve the issue...
and then I found out that the updated Android Kitchen binaries are statically linked now and the ugly hack was not needed anymore.
Changes to the way fstab is generated - now it uses only one file and deletes unneeded lines from it - inspired by @Metallice
Added more error-checking
Some other small fixes and improvements
Tested on a lot of recoveries and partition layouts.
13th May 2014
Fixed an issue with the zip which could arise when /system was not mounted before the install.
Tested on a lot of recoveries and partition layouts.
12th May 2014
Initial release.
Add settings to enable/disable f2fs forcing mode so we can switch on …
…the fly. Force will force all wipe/format calls to use f2fs or ext4 depending on the selection. Also added code to ensure settings are re-written back to internal sd after a super wipe. Also removed fstab code to determine the mode since we now have a setting for it
http://goo.gl/NTamfl
Add code to analyze the fstab to determine whether we are in f2fs mod…
…e or ext4 mode
http://goo.gl/MJXQpE
aosp said:
Add settings to enable/disable f2fs forcing mode so we can switch on …
…the fly. Force will force all wipe/format calls to use f2fs or ext4 depending on the selection. Also added code to ensure settings are re-written back to internal sd after a super wipe. Also removed fstab code to determine the mode since we now have a setting for it
http://goo.gl/NTamfl
Add code to analyze the fstab to determine whether we are in f2fs mod…
…e or ext4 mode
http://goo.gl/MJXQpE
Click to expand...
Click to collapse
If I'm not mistaken, this is a code in a custom recovery that enables the user to select if he wants to format his partitions as F2FS or EXT4, similar to what the MultiROM recovery does after yesterday's update?
If so, I don't see the connection that your code has with my tool... My tool is a template for a recovery zip, in which kernel devs can place their boot.img, and when the user installs that zip with the boot.img, the script in that zip will check for which partitions does the user have formatted as F2FS and modify the fstab in the boot.img accordingly.
Updated all the zips with a bugfix. The Android Image Kitchen would not start on CWM when /system was not mounted, because it tried to use sh in /system/bin instead of /sbin.
Also, I tested the zips on more partition layouts and recoveries, and verified that it works right both on CWM and TWRP and on ALL-F2FS, Data-F2FS and ALL-EXT4.
awesome work
How do we convert if we only have a zimage and no boot.img
Sent from my Nexus 7 using Tapatalk
chaostrodamis said:
How do we convert if we only have a zimage and no boot.img
Click to expand...
Click to collapse
The changes are all done to the ramdisk, so you can't do them without one, at least not with this method.
But, if you look how @sgt. meow does it in his Oxydo kernel, perhaps that is the way you could use. He unpacks the ramdisk from the currently installed kernel and then packs it with his zImage to a boot.img which he then flashes. This requires that the user first flashes another kernel with f2fs working, and then flashes your kernel.
Perhaps it would be easier if you packed your kernel with some ramdisk and then used it.
An updated version of agnostic-kernel is available in the OP. See post #2 for changelog.
Both the template zip and the two prepacked kernels are updated.
This is a highly reccomended update for all kernel developers, as it fixes compatibility issues with some ROMs (AOSP Lollipop, for example).
I've also published sources to my working folder on GitHub, if anyone is interested. There's nothing really important there, though.
Thanks for the post in my thread. I've been trying to figure out how to edit the line in the file and kept running into roadblocks. I'll definitely take a peek. The other thing I am planning to do is pull the boot image from the phone instead of having it in the zip file.
RoryB said:
Thanks for the post in my thread. I've been trying to figure out how to edit the line in the file and kept running into roadblocks. I'll definitely take a peek. The other thing I am planning to do is pull the boot image from the phone instead of having it in the zip file.
Click to expand...
Click to collapse
You're welcome. And you could perhaps try pulling the boot.img with dd, something like this:
Code:
dd if=$BOOT_PARTITION of=/tmp/agnostic-kernel/boot.img

[APP] (Share) simple2ext_mod for CyanogenMod 11

Found here on XDA,its from the great dev @psyke83
Current release: 3.0.3b [07/08/2014]
Hey folks,
I'm releasing my own modification of @OlegKrikun's simple2ext, focused specifically on providing CM11.0 support and addressing some concerns with filesystem corruption that occurred in previous versions.
3.0.3b (07/08/2014):
Enhancement: support for moving application libraries
Enhancement: when re-assigning the dalvik-cache, copy the existing data instead of clobbering. Saves an unnecessary dexopt pass.
Bug fix: make sure that the boot script doesn't execute fully if /sd-ext is already mounted. Will prevent issues when upgrading S2E.
Rewrite boot script with more generic function to reduce complexity. The script will now ensure that the /sd-ext folder permissions always match the permissions of the corresponding source folders.
3.0.3a (06/08/2014):
Implemented support for CM11.0
Removed filesystem tuning (tune2fs) in mount script, as it can cause filesystem corruption
Removed prebuilt e2fsck binary - always use the system binary for maximum compatibility
Removed "mount as ext4" option - the script now mounts /sd-ext as ext4 by default. This is the most stable configuration for CyanogenMod, and avoids user confusion.
Minor enhancement - when the app needs to install the mount script, it will also execute the script. This avoids the need to reboot your phone after initial installation of S2E; the app will be immediately functional.
Caveats:
Only tested on CyanogenMod 11. May not work on older revisions, as I removed some compatibility code.
Threadlink: http://forum.xda-developers.com/android/apps-games/app-simple2extmod-cyanogenmod-11-t2840295
that's funny, 'cause we don't have cm11 yet... And i don't think we r going to have cm11 in near or far future either....
You are funny,why should i share it when we not have cm11?Please dont post things without any knowledge.
GREETZ FROM TEAM-OPTIMA!!!
mms047 said:
that's funny, 'cause we don't have cm11 yet... And i don't think we r going to have cm11 in near or far future either....
Click to expand...
Click to collapse
man you serious -_- ? http://forum.xda-developers.com/showthread.php?t=2766229 its been there for 3 months and its also stable now and people still don't know about it
fix link
fixed,sorry

[JB+KK+LP][HACK] RAM "repartition" - up to 691.1 MB of accessible RAM

Hi everybody!
Today I've experimented with kernel a bit and have found a way to increase accessible RAM up to 691.1 MB, at the cost of not working(or not fully working) camera, HW decoding and inablilty boot to recovery. The way is to modify cmdline:
https://github.com/ChronoMonochrome/Chrono_Kernel/commit/17d83a66bcb07a79e4575e0da3b762acd0def203
We use CONFIG_CMDLINE_FORCE=y to ignore cmdline passed by bootloader and use instead new one which contains defconfig.
The default cmdline is(JB bootloader with 624 MB - don't remember its baseband name)
CONFIG_CMDLINE="cachepolicy=writealloc mpcore_wdt.mpcore_margin=359 root=/dev/ram0 rw rootwait crash_reboot=yes crash_dump=no init=init console='null' [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] vmalloc=264M jig_smd=0 lpm_boot=0 checksum_pass=1 checksum_done=1 sec_debug.enable=0 sec_debug.enable_user=0 androidboot.serialno=47907233a768cf60 board_id=12 startup_graphics=1 logo. lcdtype=4 sbl_copy=1"
Click to expand...
Click to collapse
and new one that's in config:
CONFIG_CMDLINE="cachepolicy=writealloc mpcore_wdt.mpcore_margin=359 root=/dev/ram0 rw rootwait crash_reboot=yes crash_dump=no init=init console='null' [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] vmalloc=264M jig_smd=0 lpm_boot=0 checksum_pass=1 checksum_done=1 sec_debug.enable=0 sec_debug.enable_user=0 androidboot.serialno=47907233a768cf60 board_id=12 startup_graphics=1 logo. lcdtype=4 sbl_copy=1"
Click to expand...
Click to collapse
Take a look at "[email protected] [email protected]". 72M means size of HWMEM, "@256M" - its physical address. The same is for "mem" - 55M is size of nearest RAM bank.
Because we forcibly passed this cmdline and bootloader can't add parameter bootmode=2, it disallows to boot into recovery. Maybe later I'll be able to fix it.
Now about other side-effects of reduction of HWMEM - I've tested few sizes of HWMEM, and results as follows:
HWMEM=16M(699M) - camera, audio and hw decoding doesn't work at all
HWMEM=24M(691M) - camera and hw decoding doesn't work at all
HWMEM=48M - video recording and hw decoding doesn't work
HWMEM=64M - video recording still doesn't work, but camera doesn't FC when enabling video mode. May be some cameras will work.
HWMEM=72M - haven't found any bugs yet.
HWMEM=84M - default HWMEM size.
UPD. also uploaded kernel with [email protected] - this decreases available RAM, but maybe for some app or game will be useful this plenty of HWMEM
http://xda.mister-freeze.eu/XDA-files/ChronoMonochrome/kernel/mem_repart/
I've also tried to decrease modem_mem and mem_trace, but unfortunately, it causes bootloop (tested 8MB of modem memory, and 10M of mem_trace, both of these settings separately)
Now few words about how to flash it when recovery is unavailable: extract boot.img to /sdcard and flash kernel via terminal. Script to flashing kernel is attached - if you not familiar with terminal commands I recommend just execute this script to automatize the process. To return to usual kernel, extract boot.img to the same place, flash it, reboot to recovery and flash installable kernel again.
Enjoy :highfive:
@ChronoMonochrome thanks for keeping alive our ace 2 , so far I test HWMEM = 72M , but I have one question , what else do you bring to our phone ? Cheers ^^ :good::good:
Now some users will know why we doesn't see a full 768MB of RAM in phone info.
But @chrono, because of "androidboot.serialno=47907233a768cf60 board_
id=12 lcdtype=4" forced cmdline will bootup every codina devices?
Ave_Hornet said:
but I have one question , what else do you bring to our phone ? Cheers ^^ :good::good:
Click to expand...
Click to collapse
haha maybe LK3.1, but it's f***n buggy, it has problems with earlysuspend - it's unable to play music when screen is off and etc. Furthermore, I'm unable so far merge all changes from chrono kernel (most of them cause bootloop).
PolishVodka said:
Now some users will know why we doesn't see a full 768MB of RAM in phone info.
But @chrono, because of "androidboot.serialno=47907233a768cf60 board_
id=12 lcdtype=4" forced cmdline will bootup every codina devices?
Click to expand...
Click to collapse
Hm, honestly I've some doubts about it - maybe anyone already tested it?
This "androidboot.serialno" probably was generated by bootloader - I haven't tested yet whether other number works or not.
UPD. checked right now - at least androidboot.serialno=ffffffffffffffff works as well as mentioned one. board_
id=12 shouldn't cause problems since it's probably number, specific for codina, but only lcdtype=4 may cause problems on s6d display.
ChronoMonochrome said:
Because we forcibly passed this cmdline and bootloader can't add parameter bootmode=2, it disallows to boot into recovery. Maybe later I'll be able to fix it.
Click to expand...
Click to collapse
Fixed! :fingers-crossed: https://github.com/ChronoMonochrome/Chrono_Kernel/commit/8dbbd48feb1c57db7a335684ff418af01de00d40
This extends bootloader cmdline with new size of HWMEM, instead of passing custom cmdline.
As it turned out, HWMEM should be minimum 68 MB to avoid having any bugs:
http://xda.mister-freeze.eu/XDA-files/ChronoMonochrome/kernel/mem_repart/codina_kernel_hwmem68M.zip
Let me know, if you need a build with even lower size of HWMEM.
As for now, I did not notice any error in HWMEM=64 , but if I think well, that if the will not be any errors ,such modification will be commonplace in Your Kernel?
:silly: Btw. You Are CRAZY @ChronoMonochrome :good: :good:
Edit1. Searches for the network, but nothing works related to the Internet ,Anyone can confirm that ?
Damn it, it was too fast. I've seen some errors in kmsg and camera randomly FCs. I'm afraid that some errors in logs also can evidence about damage FS. I had to restore CWM backup to avoid camera FC, but even on usual kernel with orig HWMEM size I still have errors in kmsg when taking a photo:
Code:
<4>[ 54.664611] CM_NO_MORE_MEMORY domainId: 22, memType 7, wordSize 61440, alignement 15
<4>[ 54.664642] ALLOCATOR Dumping allocator "scratch" [0x00058800:0x00068800]
<4>[ 54.664642] Error: CM_NO_MORE_MEMORY: CM_AllocMpcMemory() failed
<6>[ 55.954864] dma dma0chan22: allocated logical channel (phy 3)
But I should say that I've previously used more unstable HWMEM size as low as mentioned 16 MB - and I've had some crashes which probably caused memory corruption(I do not mean the RAM, as is a non-volatile memory). The problem is that I've used dynamic fsync - now I came to conclusion that we should forget about using it - even simple app FC can cause problems, which persists until you restore full CWM backup. Does anyone have camera FC or errors in kmsg like above?
ChronoMonochrome said:
...... The problem is that I've used dynamic fsync - now I came to conclusion that we should forget about using it - even simple app FC can cause problems, which persists until you restore full CWM backup. Does anyone have camera FC or errors in kmsg like above?
Click to expand...
Click to collapse
Yeah, exactly the same what i had said for some weeks.. it makes no sense.... kernel default is "0" Fsync ON and i've removed NT-APP Permission to make it fail-safe (for this tweak)..
usually it's no problem if we have a fresh cwm backup.. simply format /data and restore only /data .. in 99% of cases the system works normal again..
PolishVodka said:
Now some users will know why we doesn't see a full 768MB of RAM in phone info.
Click to expand...
Click to collapse
Why was clear since beginning, but i remember talk about HOW to change it you-know-where over year ago
Now this topic is extremly interesting.
Vodka, will you make SAME kernel that's used in slimkat with HWMEM=64?
I fell off my chair seeing how this rom with your kernel works, this is totally unreal, man(14760 pts in antutu at 1.1ghz - also - machine works now at 500mhz like at 800mhz before).
Outstanding! Simply outstanding! :good:
Sorry to be without any information in this post. But this news must be celebrated.
EDIT
Using 68M without any issues... Camera/Video are working fine... with incredible RAM of 647 MB :good:
fluffi444 said:
Using 68M without any issues... Camera/Video are working fine... with incredible RAM of 647 MB :good:
Click to expand...
Click to collapse
I could confirm this :good::good:
Edit:
Btw, would this work for any kernel @ChronoMonochrome? Or is it specific to yours?
Why not simply use dynamic memory allocation through CMA for all ION heaps to free up more RAM when not used by surfaceflinger, audio or other subsystems? Afaik legacy memory allocators like PMEM, CMEM, HWMEM were all deprecated when the unified memory manager (ION) was introduced in Android 4.0.
yowanvista said:
Why not simply use dynamic memory allocation through CMA for all ION heaps to free up more RAM when not used by surfaceflinger, audio or other subsystems?
Click to expand...
Click to collapse
Yep, I thought about dynamic memory allocation too. Unfortunately, with one thought it ended up. I do not have much experience in programming to do so. Too many things use HWMEM - if I'm not wrong, mali also use it. It doesn't seem to me a simple.
shaqman89 said:
Btw, would this work for any kernel @ChronoMonochrome? Or is it specific to yours?
Click to expand...
Click to collapse
There are nothing specific to my kernel. As I said, it just adds new parameters "hwmem" and "mem" to the end of cmdline(it's much simplier to don't override old parameters but just do as it done). Therefore, it should work with every kernel.
Should i flash the zip after chronokernel version 2.19 or no?
HI @ChronoMonochrome
Take a look at "[email protected] [email protected]". 72M means size of HWMEM, "@256M" - its physical address. The same is for "mem" - 55M is size of nearest RAM bank.
if i change hwmem from 72 to 70 or 71 and mem from 55 to 60 or 56 its good for ace 2
and how i change this hwmem and mem ?
thanks sorry if my english is bad
I want to test it on my Ace 2. What is most stable value for our phone? And can You tell me how-to-do-it with noob-friendly tut?
str3tch72 said:
I want to test it on my Ace 2. What is most stable value for our phone? And can You tell me how-to-do-it with noob-friendly tut?
Click to expand...
Click to collapse
A user with over 2000 post is not allowed to ask for an "noob-friendly how-to".
If you do so anyway you are just only to lazy to search or to lazy to switch brain to ON.
*just kidding (a bit)* :highfive:
Just flash complete Kernel - HWMEM changes are hardcoded in kernel...
http://xda.mister-freeze.eu/XDA-files/ChronoMonochrome/kernel/mem_repart/
chrono_kernel_R2.21.2_hwmem68.zip is the latest with HWMEM68 which gives you 640 of RAM.
But be warned - Sooner or later some apps starting to FC without any obvious reason.
@ChronoMonochrome
Good job , thnaks.
I remember , when we upgrade Android 2 to 4 , there was two partitions named param and normal , that shoud be replaced in order to increase memory from 500MB to 624 , so what was that?
Here is that thread
sorset said:
@ChronoMonochrome
Good job , thnaks.
I remember , when we upgrade Android 2 to 4 , there was two partitions named param and normal , that shoud be replaced in order to increase memory from 500MB to 624 , so what was that?
Here is that thread
Click to expand...
Click to collapse
624MEM_V2.tar.md5 replaces bootloader, but 624MEM_V1.tar.md5 doesn't... It should be interesting itself, but I haven't any idea how it can work without replacing bootloader and its cmdline.
UPD. Maybe cmdline isn't hardcoded in bootloader, but written somewhere in param.lfs.
fluffi444 said:
......
chrono_kernel_R2.21.2_hwmem68.zip is the latest with HWMEM68 which gives you 640 of RAM.
But be warned - Sooner or later some apps starting to FC without any obvious reason.
Click to expand...
Click to collapse
Right now flashed my Kernel with HWMEM=68 (646MB RAM) .. and now i just want to ask u how long i need to wait till some Apps starts to FC ?? - Of course just approxx. maybe after 1 day of usage ???

Categories

Resources