yashsingh1/xdaforums huggingface dataset:
[Galaxy S 4 i9505 Android Development] broodplank1337:
Up-to-Date Bare Repositories for TW/AOSP 4.2.2 Kernel​

samsung-kernel-jfltexx​

Short Info:

I've made this repository to have a central place for everyone to fork their kernel base from. The advantage of this repo is that it is always up-to-date (as in the latest linux kernel version). Imagine the difference from starting at a 3.4.0 kernel base and 3.4.52 kernel base, there are thousands of new patches in that patch range. :good:

Repository Url:

https://github.com/broodplank/samsung-kernel-jfltexx

Repository Info:

Name: samsung-kernel-jfltexx

Description: Bare repositories for jfltexx (i9505)

Branches: tw-4.2.2 and aosp-4.2.2 (aosp 4.3 coming when 4.3 kernel sources are released)

tw-4.2.2 = Stock i9505 TouchWiz Kernel from Samsung sources patched until latest linux kernel version

aosp-4.2.2 = i9505g Google Edition Kernel (for AOSP 4.2.2 Google Edition and TouchWiz 4.2.2) (for i9505)

Getting the sources:

If you want to compile the kernel directly without much changes it's advised to clone it:

git clone [url]https://github.com/broodplank/samsung-kernel-jfltexx[/url] -b branchname

If you want to make your own kernel it's advised to fork the kernel:

Usage Info:

Initializing first config:

make VARIANT_DEFCONFIG=jf_eur_defconfig jf_defconfig

Configuration:

Easiest variant (QT based GUI, needs libqt4-dev libqt4-core and libqt4-gui)

make xconfig

Default variant:

make menuconfig

Other less popular variants:

(GTK based, doesn't need any special packages)

make gconfig

(Ncurses based, needs libncurses5, libncurses5-dev and libncursesw5)\

make nconfig

Building Kernel:

export ARCH=arm
export CROSS_COMPILE=/path/to/toolchain/bin/arm-eabi-
make -jx (where x is the amount of cpu cores + 1)

Toolchains:

Toolchains that are suited for building the sources are:

Building boot.img:

./build_bootimg

(Choose the rom type you will be using and it will be created in build/output)

Flashing boot.img and modules:

./flash_bootimg

(This is a process that pushes boot.img to your phone and then to the kernel partition, after that you can choose whether to push modules or not, and finally you can choose to wipe dalvik-cache or not and it will reboot.

Updating Info:

If you have forked the repository do this to fetch the updates from this repository:

First add it to the remote:

git remote add bare [url]https://github.com/broodplank/samsung-kernel-jfltexx[/url]
git fetch bare

Then search for the commit(s) that you want to merge

For 1 commit:

git cherry-pick [commit hash here, this is the last part of a commits url]

(for example: https://github.com/broodplank/samsung-kernel-jfltexx/commit/612bbea08b67f16dd5628cb8cd8406973f8fe821 would be: 612bbea08b67f16dd5628cb8cd8406973f8fe821)

For a range of commits:

git cherry-pick [commit a hash]^..[commit b hash]

Where commit a is the oldest commit and commit b the newest.

for example:

git cherry-pick 0bff3bdba64c58ea6100d72763f2be3acc9659db^..612bbea08b67f16dd5628cb8cd8406973f8fe821

This would patch the sources from 3.4.40 to 3.4.52
[Galaxy S 4 i9505 Android Development] broodplank1337:
Latest Repository Changes:

3-08-2013

- Switched to real samsung 4.3 sources

29-07-2013

- Updated aosp-4.2.2 and tw-4.2.2 to 3.4.55

25-07-2013

- NEW BRANCH: AOSP-4.3

- NEW BRANCH: TW-4.3

- Added MSM8960 Headers from Google!

23-07-2013

- Update to 3.4.54

14-07-2013

- Update to 3.4.53

- Merge sensor fix from faux123

13-07-2013

- Updated defconfigs for proper building

09-07-2013

- Update to 3.4.52

- Sensor fix by ausdim

- Large update to readme

06-07-2013

- Add samsung sources

- Patch to latest version 3.4.51

- add boot.img creator

05-07-2013

- Initial commit, make repository
[Galaxy S 4 i9505 Android Development] m0tter:
Thanks, I just forked it.

I'm a noob at this but am learning fast. I've modified and compiled the 3.0.31 kernel for the 9210T but I'd like to now try 3.4. Appears none of the celox changes for board_msm8x60.c source came across from 3.0 to 3.4 so I think I've got my work cut out for me.

m0tter
[Galaxy S 4 i9505 Android Development] harise100:
This guide is not working for me. :(

If I follow your guide the resulting kernel boots, but I have no sound and no 3G (PIN pad doesn't show up).

I'm on MF8 stock ROM. Yours, Ausdims or my own (based on Samsung Update 2 sources) work fine.

This is what I did:

$ git clone https://github.com/broodplank/samsung-kernel-jfltexx -b tw-4.2.2

$ make VARIANT_DEFCONFIG=jf_eur_defconfig jf_defconfig

$ export ARCH=arm

$ export CROSS_COMPILE=/path/to/toolchain/bin/arm-eabi-

$ make xconfig (no changes!)

$ make -j3

$ ./build_bootimg && ./flash_bootimg (selected 1 for TW)

What am I doing wrong?
[Galaxy S 4 i9505 Android Development] ausdim:
InitRamfs??

Permisions of initramfs?
[Galaxy S 4 i9505 Android Development] harise100:
Don't know. :confused:

I used the script to build the boot.img. If I do the same with my sources, it works.

In both cases, I haven't touched those files.
[Galaxy S 4 i9505 Android Development] ausdim:
Im not on pc to check that and help you but your problem about radio (pin) sounds initramfs problem.

Unpack an stock boot.img and use that ramfs.

Thanks
[Galaxy S 4 i9505 Android Development] harise100:
Thank you for trying to help me... but it still doesn't work. Same result. :(
[Galaxy S 4 i9505 Android Development] broodplank1337:
Tonight Ill do a little research on this and tell you the solution.
[Galaxy S 4 i9505 Android Development] harise100:
I remember when I started to make my first kernel, I had similar problems with the Samsung sources.

Wanam gave me his jf_defconfig file and it worked. He said that the config file by Samsung is crap. But I forgot to ask for details.

If I use my config file on your sources, it results in a bootloop, whereas they work fine with Samsung update 2 sources.

Does that make sense?
[Galaxy S 4 i9505 Android Development] .c0dy:
Still figuring out, why i cant even successfully compile the sources. With ktoonse sources it works.

But i'm still a beginner. Will see about that xP

Gesendet von meinem GT-I9505 mit Tapatalk 2
[Galaxy S 4 i9505 Android Development] harise100:
What is your problem?
[Galaxy S 4 i9505 Android Development] .c0dy:
I hate it -.- xD

Now it worked. And I do not know why... As I am pretty new to this, as already said, - could this be the problem? :

I think I made this:

instead of:

So I used xconfig before setting ARCH and CROSS_COMPILE.

Could that be the problem?

Atm i can not paste the error. The first one had something to do with a buffersize. Could "fix" that by setting "CONFIG_FRAME_WARN=1024" higher. Because it said it was 1032.

Second error was something like "‘ret’ may be used uninitialized in this function [-Wuninitialized]".

---------- Post added at 08:08 PM ---------- Previous post was at 07:32 PM ----------

Will add a new post for this, if it's okay.

And i hope it's okay to ask in here :)

So, first, as wrote in my previous post the compiling worked.

Now, i did the following:

1. Changed in the config: "kernel compression mode -> LZO

2. Removed "Optimize for size"

3. And changed the flag in the makefile to O3.

kernel/workqueue.c: In function 'freeze_workqueues_begin':

kernel/workqueue.c:483:11: warning: array subscript is above array bounds [-Warray-bounds]

error, forbidden warning: workqueue.c:483

make[1]: *** [kernel/workqueue.o] Error 1

make[1]: *** Waiting for unfinished jobs....

While writing this I reset "Optimize for size" and restart compiling. Now it does seem to work.

So i guess there is a problem with the flag. Where is the right place of the flag?
[Galaxy S 4 i9505 Android Development] harise100:
If you want to use O2 or O3, it requires some modification of config and make files.

The build boot.img script worked for me right away.
[Galaxy S 4 i9505 Android Development] .c0dy:
Ah okay, thanks. Will see if I can find a few more infos about that :)
[Galaxy S 4 i9505 Android Development] harise100:
Did you find anything?

I do have a working build environment and I can compile and install a kernel that is better than stock kernel. :)

Only these sources don't work. How is that possible? :confused:
[Galaxy S 4 i9505 Android Development] broodplank1337:
check out this commit: https://github.com/broodplank/andro...mmit/69b6e56fb4151f547368fc77d5ad682fbf99ea7b
[Galaxy S 4 i9505 Android Development] harise100:
I'll give it a try when I get home.
[Galaxy S 4 i9505 Android Development] broodplank1337:
It will work if you have the right toolchain, I use this one:

http://www.mediafire.com/download/i...linaro_4.7.4-2013.07-build_2013_07_12.tar.bz2

It's an optimized Linaro toolchain ;) (http://xdaforums.com/showthread.php?t=2098133)
[Galaxy S 4 i9505 Android Development] .c0dy:
Thanks :) Will try that.

I already compiled a kernel, but it just booted until the samsung logo.. after that instant reboot... :/
[Galaxy S 4 i9505 Android Development] broodplank1337:
Yes it must be because of the crappy defconfig, I updated the defconfigs :) Now it should work.

https://github.com/broodplank/samsu...8bfa1519fe4f22541fb8b92a2b7a6181d307be2.patch
[Galaxy S 4 i9505 Android Development] broodplank1337:
Ok just tested the building of the kernel (aosp-4.2.2 branch) with arm-eabi-4.6 toolchain, at (new) jf_defconfig

Resulting in:

http://xdaforums.com/attachment.php?attachmentid=2112407&stc=1&d=1373683602

Please note that compiling only fully works at "Optimize for size" flags, when using -o2 or -o3 you need to call the linaro patches.
[Galaxy S 4 i9505 Android Development] .c0dy:
For my understanding, with the mentioned commit "https://github.com/broodplank/android-kernel-samsung-jfltexx/commit/69b6e56fb4151f547368fc77d5ad682fbf99ea7b" these changes should be used by default.

You mean that with the "linaro patches", right? Or do I have to set that manually?

EDIT: Ok, nvm. just saw it is another repo.

Do i apply these by using git remote add and then cherry-pick that commit?
[Galaxy S 4 i9505 Android Development] broodplank1337:
the commits should only be used if you are building o2/o3 on an linaro toolchain, if you're building -OS on arm-eabi-4.6 then it shouldn't be used.

If you just cherry-pick that commit in your kernel source you will be able to build with linaro (o2/o3)

and yes to merge the commit:

git remote add bare https://github.com/broodplank/android-kernel-samsung-jfltexx

git fetch bare

git cherry-pick 69b6e56fb4151f547368fc77d5ad682fbf99ea7b

so you just add the remote as a reference for commit hashes. and then cherry-pick them, once you do a "push -u origin jb-4.2" they will be uploaded at your branch.

Let me know if you don't succeed, or when you succeed. either way :silly::good:
[Galaxy S 4 i9505 Android Development] .c0dy:
Atm I'm compiling. Will report how it goes.

I compiled it before and it worked. Better said, it booted fine and atm i'm using it :) Great! Thanks.

Now I have added some schedulers.

Will see about that xP
[Galaxy S 4 i9505 Android Development] broodplank1337:
Good job :D I like to hear that.

Adding schedulers is pretty easy luckily, they either succeed to compile or fail to compile, of course you hope that they succeed (I have never experienced a scheduler not behaving as it should while using it)

Anyways, enjoy running your own compiled kernel :cool:
[Galaxy S 4 i9505 Android Development] .c0dy:
That was not a long adventure :D

After adding them and recompiling, stuck hat Samsung-Logo. Will try to recompile. If that doesnt work.. I'll post again ;D :good:

EDIT: Oh and thanks for everything :)

Really appreciate your support :) So I bought you some beer :D

7KS1924338744584R
[Galaxy S 4 i9505 Android Development] broodplank1337:
Please first check your ".config" inside the kernel source (edit it with a text editor for example: "gedit .config"), there should be around 3700+ lines. if its drastically less then that, then you have the wrong config.

If your stuck at the samsung logo it's in most cases a wrong "init" file in the ramdisk, what you can try: download my kernel or ausdims, and decompile the boot.img in "dsixda android kitchen", then replace the zImage of the extracted boot.img with the one you compiled, and recompile it back.

Ill guide you through the whole process as I experienced it from bottom (non working samsung sources) to fully o3 optimized build last week. so thats still fresh in my memory hehe.

And you're welcome, I like to help people that are new to developing :)

And thank you very much for the "credit"! I must admit I do not know exactly how to use this code :o:o I guess its bitcoins or so :p? Lol I feel really noob for not knowing this :angel:. Anyways thanks for your gesture, really appreciate that. :laugh: (can you pls tell me or pm how it works :o?)
[Galaxy S 4 i9505 Android Development] .c0dy:
Config got 3807 lines. It compiled fine before. I think i got the error.. Atm i'm recompiling again.

The code is just the transactioncode. You should see that on you paypal-account :)
[Galaxy S 4 i9505 Android Development] broodplank1337:
Ok that seems to be ok. Please paste your error log if there is any.

And haha lol I was thinking way to complicated :silly::silly. I just noticed your donation on paypal idd. Thank you very much :laugh:
[Galaxy S 4 i9505 Android Development] .c0dy:
Now i do not even get a zImage O__O
[Galaxy S 4 i9505 Android Development] broodplank1337:
You should do this then:

First please tell me what toolchain you're using. if you're using linaro then ill send you an optimized toolchain a long with the patches.. btw you have to make sure you are compiling on OPTIMIZE_FOR_SIZE (-os) and not OPTIMIZE_DEFAULT (-o2), they also break the compiling.

Now to refresh the kernel do this: close the current terminal window.

reopen it at the kernel source, and first type "make mrproper" this completely deletes all generated files by kernel.

then in terminal window set the variables, or use build scripts (i prefer it this way, so you are sure it doesn't pick up the cross_compile from makefile.

anyways, here is the build_clean script:

#!/bin/bash
clear
echo " "
echo "Setting Variables"
echo " "
export ARCH=arm
export CROSS_COMPILE=/home/broodplank/linaros4/bin/arm-unknown-linux-gnueabi-

echo " "
echo "Make clean..."
echo " "
make clean

echo " "
echo "Make kernel..."
echo " "
make -j8

echo " "
echo "Done!"
echo " "

a long with ./xconfig

#!/bin/bash

echo " "
echo "Setting Variables"
export ARCH=arm

echo " "
echo "Checking for .config"
if [ -e .config ]; then
echo " "
echo ".config found, launching xconfig"
make xconfig
else
echo " "
echo ".config not found, making defconfig"
make VARIANT_DEFCONFIG=jf_eur_defconfig jf_defconfig
make xconfig
fi;

if you use those scripts all the time it's really easy to build a kernel.

When my kernel is done for compiling i simply enter:

make mrproper && ./xconfig && ./build_clean && ./build_bootimg && ./flash_bootimg

and then its from source to boot.img + modules on my phone.

And pls post the log of the compiling (it will mostly just end at some "built-in" file. this is because you're compiling with multiple jobs so it continues after breaking.) If you don't use the -j parameter you will get to see your errors instantly, always run a "make" after getting an error, so you see where the error is
[Galaxy S 4 i9505 Android Development] .c0dy:
Thanks :) I use all of the scripts that are provided :)

After entering "make" now i see the failure.. There seems to be some error with the "row"-scheduler.

And I'm using your recommended toolchain.

Where do i find the logs?

The error is the following:

make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
CC block/row-iosched.o
block/row-iosched.c: In function ‘row_add_request’:
block/row-iosched.c:344:22: error: ‘REQ_URGENT’ undeclared (first use in this function)
block/row-iosched.c:344:22: note: each undeclared identifier is reported only once for each function it appears in
block/row-iosched.c:368:31: error: ‘PG_readahead’ undeclared (first use in this function)
block/row-iosched.c: In function ‘row_reinsert_req’:
block/row-iosched.c:431:22: error: ‘REQ_URGENT’ undeclared (first use in this function)
block/row-iosched.c: In function ‘row_completed_req’:
block/row-iosched.c:460:23: error: ‘REQ_URGENT’ undeclared (first use in this function)
block/row-iosched.c: In function ‘row_remove_request’:
block/row-iosched.c:513:3: error: ‘REQ_URGENT’ undeclared (first use in this function)
block/row-iosched.c: In function ‘row_dispatch_insert’:
block/row-iosched.c:532:22: error: ‘REQ_URGENT’ undeclared (first use in this function)
block/row-iosched.c: In function ‘row_merged_requests’:
block/row-iosched.c:867:20: error: ‘REQ_URGENT’ undeclared (first use in this function)
block/row-iosched.c: At top level:
block/row-iosched.c:1063:3: error: unknown field ‘elevator_reinsert_req_fn’ specified in initializer
block/row-iosched.c:1063:3: warning: initialization from incompatible pointer type [enabled by default]
error, forbidden warning: row-iosched.c:1063
make[1]: *** [block/row-iosched.o] Error 1
make: *** [block] Error 2
[Galaxy S 4 i9505 Android Development] broodplank1337:
I faced the same error, the ROW scheduler isn't supported as it is, it needs to be patched in order to work, I recommend you to use SIO if you want to add a scheduler. (many schedulers and governors don't work on the i9505g sources, all need patches)

If you just open ./xconfig and uncheck ROW and recompile it dirty it will continue until the end (if not facing more errors)
[Galaxy S 4 i9505 Android Development] .c0dy:
Okay, thanks :)

Good to know, that it's not my fault :D

Will try again now :)

---------- Post added at 02:18 AM ---------- Previous post was at 01:37 AM ----------

Great :) It's booting fine and all other schedulers seem to work:

fiops

sio

vr

zen and fifo.

Thanks a ton again :)
[Galaxy S 4 i9505 Android Development] broodplank1337:
:D great work! Feels good, running your own compiled kernel isn't it :D?

And thanks for mentioning the schedulers that do work, I didn't figure that out yet

No problem, btw, I'm curious, what kind of flags are you using? -Os, O2 or O3 :o?
[Galaxy S 4 i9505 Android Development] .c0dy:
On the one hand it feels good to run the first own compiled kernel hehe

On the other not, because im not using yours atm :D

Hehe. Will add the changes to the repo when i'm back at the pc in a few hours. So you can save some time, and just pick that :)

Btw: If I do not "remember" every changed file or in case I'd be to lazy to add every single file with "git add", is it possible to let git "decide" what files are edited and push these?

I've read about "git add ." and "git add -A" wich seem to be almost the same. Does that work?

Atm I'm running it with O3.
[Galaxy S 4 i9505 Android Development] broodplank1337:
Hehe, ok well what source are you using right now then :P?

Thanks for sharing your work on github, Ill merge the schedulers you added :D

Yes, if the .gitignore file is set-up properly you are able to always use "git add ." to just add the modified files. you should check "git status" once in a while, it shows the files that are modified and untracked. very handy ;P

.gitignore:

#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# Normal rules
#
.*
*.o
*.o.*
*.a
*.s
*.ko
*.so
*.so.dbg
*.mod.c
*.i
*.lst
*.symtypes
*.order
modules.builtin
*.elf
*.bin
*.gz
*.bz2
*.lzma
*.xz
*.lzo
*.patch
*.gcno

#
# Top-level generic files
#
/tags
/TAGS
/linux
/vmlinux
/vmlinuz
/System.map
/Module.markers
/Module.symvers

#
# Debian directory (make deb-pkg)
#
/debian/

#
# git files that we don't want to ignore even it they are dot-files
#
!.gitignore
!.mailmap

#
# Generated include files
#
include/config
include/linux/version.h
include/generated
arch/*/include/generated

# stgit generated dirs
patches-*

# quilt's files
patches
series

# cscope files
cscope.*
ncscope.*

# gnu global files
GPATH
GRTAGS
GSYMS
GTAGS

*.orig
*~
\#*#

# generated caf
arch/arm/mach-msm/smd_rpc_sym.c

# compressed boot files
arch/arm/boot/compressed/ashldi3.S
arch/arm/boot/compressed/lib1funcs.S
arch/arm/boot/compressed/piggy.gzip
arch/arm/boot/compressed/piggy.xzkern
arch/arm/boot/compressed/vmlinux

# ignore initramfs
initramfs
/*.sh

for example:

Still the most fail-safe way is to add the modified files one by one:

git add block/Makefile

git add block/Kconfig

and then push em.

git add -A adds all files, tracked and untracked, usually not a good option

The difference between "git add ." and "git add -A" is that git -A adds all files recursively, while "git add ." only adds the new and modified files

And nice you're running O3 :) Really awesome to start with a O3 build lol
[Galaxy S 4 i9505 Android Development] harise100:
It works with the new jf_defconfig! :)

But I'm not any wiser how I can fix this myself the next time.

To add ROW IO Scheduler you have to modify some files... see attachement
[Galaxy S 4 i9505 Android Development] broodplank1337:
Thanks, going to try it out now :good:

edit: confirmed working :) Thanks a lot

edit2: applied new patch 3.4.53
[Galaxy S 4 i9505 Android Development] .c0dy:
So i kinda broke the local sources haha :P Dunno how exactly.

So i recloned from your latest updated repo.

If i try to cherry-pick the linaro-patch i get the following error:

git cherry-pick 69b6e56fb4151f547368fc77d5ad682fbf99ea7b
error: could not apply 69b6e56... Switch to Linaro, credits to Albinoman887 and ktoonsez
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

So I can't even pick these patches. And I do not know what's the point now O_O
[Galaxy S 4 i9505 Android Development] broodplank1337:
sometimes that error can be very annoying, I always do this:

1. "git status", look what is conflicting, if it's a lot and you don't feel like fixing it try "git reset" and then cherry pick again

2. if that doesn't work remove all files except the ".git folder"and do a checkout "git checkout aosp-4.2.2 ." and a cherry pick behind it

3. If it still doesn't work you need to rm -Rf the whole folder and redownload all sources including the remotes. (sounds like a lot of work but actually only takes about 3 min). and then cherry pick it, it has to work, it has no choice lol :silly:

hope this helps :P