yashsingh1/xdaforums huggingface dataset:
[Samsung Epic 4G Touch] interloper:
If thats all that came out of the unpack, then the unpack script didn't work right. I get those same files from time to time. Set this one up:https://github.com/xiaolu/galaxys2_kernel_repack

and try again. Once you have the unpack/repack working and you know you're building clean and proper we'll move on to the recovery. I'll be on IRC later, or gtalk...
[Samsung Epic 4G Touch] SweetwaterBurns:
Are you using source for the us cellular version or the epic? (as far as I know, they're identical except for the wimax support on the epic) but if you're using the epic source(I see NA_SPR in the dmesg), try copying the firmware from an epic rom to /system/etc/wifi/bcm4330_aps.bin and see if that helps things, there might be slight driver differences that require a different firmware. Also, seeing a dmesg/logcat from a succesful wifi AP run on a working kernel might help narrow things down a bit.

I've been kind of stuck in limbo on this project until I get a working phone. All the replacements I get have serious issues and I'm hoping they'll just give me credit for a new one this time around...
[Samsung Epic 4G Touch] dtm_stretch:
Just wanted to revive this thread before source, eventually, drops. Hopefully everyone's mind can get in the right place and we start burning on a variety of kernels. Here is another guide I just found it breaks down how to add patches and governors, plus it does it pretty well.

http://xdaforums.com/showthread.php?t=1748297

Anyone can build a kernel.
[Samsung Epic 4G Touch] SweetwaterBurns:
Hopefully it'll drop soon. I was debating going back to el29 just to keep from being bored...
[Samsung Epic 4G Touch] SweetwaterBurns:
Well, ICS source is up. I'm downloading now and will push to the git repo as soon as possible. My graphics card in my desktop crapped out so I'm using a much slower laptop. Hopefully by the end of the day I'll have everything pushed including chris41g's CWM5 for ICS and other recovery options.
[Samsung Epic 4G Touch] agat63:
I have the source and have compiled kernel as well.

Everything works.

I don't know how to push it to github.

If you can help me with that I would push it.

Since emmc bug can be disabled from source (with help from Chris41g I have disabled it already) there is no need for CWM5.

If you used CWM5 recovery all flashable zip files should be modified to work with it.

You can use previous recovery and still be safe.
[Samsung Epic 4G Touch] SweetwaterBurns:
Awesome. Github has a pretty good help section. The basics of how to send a pull request are here.

I have to go back to work in a bit, but if you submit a request, I'll merge it as soon as I can.
[Samsung Epic 4G Touch] agat63:
I'll try.

I have my recovery included in my initramfs.

Kernel is working fine. Have over 200 downloads and no complaints yet. :D
[Samsung Epic 4G Touch] agat63:
ICS source with disabled emmc bug has been pushed to github.

https://github.com/agat63

You can find a separate repo with initrafms as well.

Initramfs comes with my recovery tREC_v0.2.1.

If you want to use a different recovery you would have to use different initramfs or just replace recovery binary with one you want to use.

If you replace binary make sure that recovery.rc, recovery.fstab, res, images etc is replaced as well.

Happy kernel building to all of us.
[Samsung Epic 4G Touch] SweetwaterBurns:
Hey do you mind if I put mirror of your recovery in my xda-base repo to try to keep it as a one stop shop thing?
[Samsung Epic 4G Touch] agat63:
Be my guest.

compiled recovery is in initramfs.

Use as you want. it's not mine it belongs to community.
[Samsung Epic 4G Touch] sleshepic:
bout to give this a go, Source is taking Forever to download. Thanks Agat for posting on your Git the modified Recovery. I'm crossing my fingers
[Samsung Epic 4G Touch] rujelus22:
Great response. :good:
[Samsung Epic 4G Touch] dtm_stretch:
Someone posted a dropbox mirror of the source somewhere, let me see if I can find it.

** Bam got it http://xdaforums.com/showpost.php?p=28633806&postcount=70 Thank HTLS for the mirror.
[Samsung Epic 4G Touch] agat63:
It's the only response.

So many people helped me on my way making it that even tho it has my name on it I don't think of it as mine.
[Samsung Epic 4G Touch] sleshepic:
Getting some errors when I try to build what i extracted from the source kernel tar. Says it cannot open/access .config. did a test build with included stock kernel and built fine. Any suggestions? Do i have to

$ make menuconfig

$ make

?

Tried that and still got error

Thx for any help.
[Samsung Epic 4G Touch] agat63:
I followed the instructions in txt file and it worked.

make u1_na_spr_defconfig

make

Try it.
[Samsung Epic 4G Touch] SweetwaterBurns:
I've uploaded the Samsung source(NOT agat's patched source, I'll try to integrate his changes in the next few days if someone doesn't beat me to it) to the xda-base github in the op. I have a pretty busy schedule for a bit and have been working on this through a ssh connection on my phone, so the kernel script doesn't default to the new source, no ics initramfs, and whatever else is going to change/break with this.

My main goal is to first get the op cleaned up, start working on a how to, and pretty much anything that needs done that doesn't involve code. If anyone has any enhancements/fixes (governors, oc/uv, etc.) they'd like to add, please feel free to submit a pull request and I'll approve it if it seems clean.
[Samsung Epic 4G Touch] sleshepic:
Making some progress, but getting errors still after $ make.

Let's me build but kernel doesn't boot.
[Samsung Epic 4G Touch] agat63:
If you using xda-base there is a nice build.sh file written for it.

I guess you didn't define the export path for toolchain. Thus those errors.

XDA-base comes with stock kernel source in it.

Try this.

File structure is xda-base/kernels/stock/ here is the source.

Rename stock to something else and than rename agat-ff18 folder into stock.

Open terminal. cd to that stock folder and run defconfig from there.

Than

cd ../..

You will be in xda-base folder.

run this command in terminal:

./build.sh

This should run fine and build your kernel.

Don't forget to put initramfs folder you downloaded/synced into xda-base/initramfs folder and rename it to initramfsroot.

Build script will find toolchain that is in xda-base folder as well.

Pretty much recreate xda-base folder with new source to run build.sh script or modify build.sh script to work with agat-ff18 folder instead of stock.

Hope this make sense.
[Samsung Epic 4G Touch] sleshepic:
It does, gonna go at it again after work. I had copied your initramfs and new source to the appropriate spots and typed

./build.sh agat_ff18_slesh agat

Or

./build.sh [name of kernel source] [name of your recovery I placed in intramfs Folder]

But I will try by just replacing the already existing files in xda base later. Also not sure if i downloaded/installed the toolchain correctly, was hard finding the one mentioned in the source kernel readme. Thanks for the help.
[Samsung Epic 4G Touch] agat63:
xda-base comes with it's own toolchain and path to it is in build.sh.

If you put all file to the appropriate places you won't be needing other toolchain.
[Samsung Epic 4G Touch] dtm_stretch:
I have a kernel building right now that has yet to error out, I am using the same method as you. More specifically here are my steps:

1. Create local copies of Agat's git and xda-base

2. copy agat's source over to the xda-base/kernel folder, move the intitramfs folder out of agat's and into xda-base/initramfs. I also made sure to delete the intramfs folder out of agat's source so there aren't any conflicts

3. I notice you are using the xda-base build script, are you specifying the new defconfig? For example the command I ran was " ./build.sh FF18_Agat initramfs u1_na_spr 2009q3-68" with u1_na_spr being the new defconfig if you don't do that then the build script defaults to xda-dev_defconfig which would cause some errors, if it even built.

Edit: My kernel successfully built without errors, I am testing it now.

Edit #2: Kernel does not boot or boot into recovery. Back to the drawing board.

Agat's kernel is 7.96mb and mine was 8.3mb
[Samsung Epic 4G Touch] sleshepic:
I haven't been back to try it, but I had the same issue with you as well. I compiled one fine with no errors I could see, and it wouldn't boot and no recovery. Gonna try again in a bit
[Samsung Epic 4G Touch] agat63:
My first kernel was over 8 mb as well.

Second has modified/optimized initramfs.

I'll try to push new initramf to github when I get home.

As for kernel I don't know why it's not booting if it compiles without errors.

Can you pull logcat when trying to boot?

May be logcat will tell us more.
[Samsung Epic 4G Touch] sleshepic:
tried a few things and havent gotten too far. Ended up trying what you mentioned, Agat, and just replaced/renamed the new folders with old(renaming the ff18 stock kernel folder for "stock" etc). that way I would not have to specify toolchain etc. Seemed to compile fine but once again does not boot.

- I replaced the kernel folder and followed the Readme.txt from Kernel source up until the $ make command,

- replaced the initramfs folder with yours from github,

- compiled $ ./build.sh

previously had tried to use the script by creating new folder names. seemed to compile but not boot either. created the path /opt/toolchains/arm-eabi-4.4.3, placed the toolchain in there, set it in my path, and tried. and also placed it in the xda-base toolchains folder and ran the command ./build.sh [kernel name] [recovery] [deconfig] [arm-eabi-4.4.3] with my respective folders and was a no go. not sure what to try next since simply swapping the folder didnt work.
[Samsung Epic 4G Touch] dtm_stretch:
No joy on a logcat, adb doesn't even recognize. I am trying another build with TWRP initramfs to see if that is the issue or if it is the source. Anyone every on irc these days?
[Samsung Epic 4G Touch] agat63:
I'm usually on IRC after work.

#ICS-DEV-E4GT channel.

Hit me up and we will try to go over the process step by step.

If it works for me I don't see why I shouldn't work for every one.
[Samsung Epic 4G Touch] dtm_stretch:
Alright, so the TWRP initramfs will boot into recovery but the rom won't boot. I think I might need to clean up some files from previous builds though, because that built a lot faster than I think my pc is capable.
[Samsung Epic 4G Touch] sleshepic:
only thing I'm getting on compile is occasionally a "warning " " defined but not used", dont know if that's considered an error during build. or there;s also a mismatch mentioned at end of build. just tried again only swapping source with "stock" folder. so strange
[Samsung Epic 4G Touch] agat63:
Did you do make clean between builds?
[Samsung Epic 4G Touch] dtm_stretch:
Yeah this is exactly how my terminal looks, I am trying it the manual build way instead of using a script now. I also didn't try make clean between builds, this might be effecting us Slesh because as you can tell from your terminal, the modules already exist so it won't recreate them.

Also, is it normal that after "make modules" there are only 3 .ko files made, (dhd.ko, cyasswitch.ko, and scsi_wait_scan.ko) what happened to j4fs.ko and vibrator.ko? Is this why our kernel sizes are larger than on GB?

Edit: No luck on the manual build; however I did realize that I didn't close Agat's initramfs from github instead I was using the initramfs that are on his ICS Kernel git. I am now trying it again with the right initramfs.

Edit 2: No luck with the github initramfs from agat. I am downloading source now to see if I can even get a stock kernel built.

Edit 3: No luck with FF18 source and Agat's initramfs. Probably done for the night but I might try stock initramfs + stock kernel to see if I can build something that boots.
[Samsung Epic 4G Touch] sleshepic:
Yeah I just made a completely stock kernel, following directions from source readme, created a tar and flashed in Odin. Gives me boot loops. Not sure what's up, did "make clean" in between. I placed he arm-eabi toolchain also in /opt/toolchains/ for my toolchain path, that's what it looks like it calls for in the readme
[Samsung Epic 4G Touch] agat63:
I'm on IRC #ics-dev-e4gt channel

You wanna meet there to try go over it step by step?
[Samsung Epic 4G Touch] agat63:
Pushed updated source to github.

It includes smartass2 governor now.

Also pushed modified/optimized initramfs to github.

New initramfs will support rom updater app and I think I've got rid of apps2sd issue as well.

My github is:

github/agat63

If using initramfs use E4GT_ICS_initramfs_optimized repo.

Good luck all.

Hope this will help some of you guys.
[Samsung Epic 4G Touch] jamexman:
Overclocking support and voltage will be added?
[Samsung Epic 4G Touch] agat63:
As soon as I figure out how to.
[Samsung Epic 4G Touch] dtm_stretch:
I just tried a build completely mimicking the file structure and build script from xda-base with the new stuff you pushed today but it errored out trying to add the smartass governor, I am trying again though.

Edit: Nope, errored out again

make[2]: *** No rule to make target `drivers/cpufreq/cpufreq_smartass2.o', needed by `drivers/cpufreq/built-in.o'. Stop.
make[1]: *** [drivers/cpufreq] Error 2
make: *** [drivers] Error 2

I just checked out your source on Git and it looks like you are missing cpufreq_smartass2.c in drivers/cpufreq seeing if I can add the file and build now.
[Samsung Epic 4G Touch] agat63:
Did you clone/sync my repo?
[Samsung Epic 4G Touch] dtm_stretch:
Yup, I am building again now. I dropped in the cpufreq_smartass2.c into the clone to see if it will work but it isn't in your github source.
[Samsung Epic 4G Touch] agat63:
Wow.

I pushed my source after I build and test with smartass.

I suppose to be there.

I'll check and push again if it's not there.
[Samsung Epic 4G Touch] dtm_stretch:
Either way the file I dropped in didn't work. These are the errors I am getting now.

drivers/cpufreq/cpufreq_smartass2.c: In function 'cpufreq_smartass_init':
drivers/cpufreq/cpufreq_smartass2.c:839: error: implicit declaration of function 'create_rt_workqueue' [-Wimplicit-function-declaration]
cc1: warnings being treated as errors
drivers/cpufreq/cpufreq_smartass2.c:839: error: assignment makes pointer from integer without a cast
make[2]: *** [drivers/cpufreq/cpufreq_smartass2.o] Error 1
make[1]: *** [drivers/cpufreq] Error 2
make: *** [drivers] Error 2

I am thinking about just going with stock source and seeing if I can eliminate the emmc bug and move from there.
[Samsung Epic 4G Touch] agat63:
I had same error.

Once git synced there should be smartass.c file.

with that file it's compiling fine.

I'm working on pushing it right now.

Total noob in github. Gimmi time.
[Samsung Epic 4G Touch] sleshepic:
hey dtm, you get a stock version to work? what you do different? I just even downgraded my distro to try to get it to boot. builds fine, just doesnt boot. im stumped
[Samsung Epic 4G Touch] agat63:
We both are on IRC channel.

Join us there.

---------- Post added at 06:02 PM ---------- Previous post was at 05:57 PM ----------

my github has been updated one more time.

first time I didn't push all the files.

Total noob on github.

Sorry for that.
[Samsung Epic 4G Touch] dtm_stretch:
Hey Agat, no luck on building with your new stuff and mimicking the xda-base file structure. My next built is going to be your kernel/initramfs but built the manual method.
[Samsung Epic 4G Touch] sleshepic:
Yeah I tried every which way yesterday, and none booted. When I did the stock way I tried $ make CONFIG_DEBUG_SECTION_MISMATCH=y for some info. But didn't know how to troubleshoot with it. Gonna go at it again after work.

If we do it without xda-base, do we need to do something with the modules that are created separately?
[Samsung Epic 4G Touch] sleshepic:
does the make file automatically direct the toolchain? Or will setting the toolchain path override that? Cus I think its looking for it in /opt/toolchains/
[Samsung Epic 4G Touch] rujelus22:
I thought the

export CROSS_COMPILE=/media/Android/Kernel-Base/xda-base/toolchain/prebuilt/arm-eabi-4.4.3/bin/arm-eabi-

Sets that
[Samsung Epic 4G Touch] sleshepic:
it does, but if you look at the Make file it looks like it may reset it to /opt/toolchains/ ? I may be wrong, at work and can't check.
[Samsung Epic 4G Touch] rujelus22:
I do not see that any where in the makefile
[Samsung Epic 4G Touch] sleshepic:
OK nvmd, sorry. Was working on it so long yesterday, got me all twisted lol.
[Samsung Epic 4G Touch] rujelus22:
I put the toolchain there also just to test, it is running CONFIG_DEBUG_SECTION_MISMATCH=y again

Edit: Nope same output
[Samsung Epic 4G Touch] sleshepic:
Also, what Ubuntu you on? Ive tried 11.10 and 12.04. Wasn't sure if that's gonna end up being important, knowing what each of us is running may. Keep reading about how only certain versions are recommended for building
[Samsung Epic 4G Touch] dtm_stretch:
I wonder if we are having issues with the modules. Has anyone tried building without making the modules and just using the ones with agat's source?
[Samsung Epic 4G Touch] rujelus22:
yep, booted but somethings are messed up.
[Samsung Epic 4G Touch] sleshepic:
What'd you do?!
[Samsung Epic 4G Touch] rujelus22:
Starting from scratch right now going to see if I can reproduce that.
[Samsung Epic 4G Touch] SweetwaterBurns:
Any progress?

I've updated github with agat63's initramfs and fixed the build script to use the new stuff by default... Now to just get it booting.
[Samsung Epic 4G Touch] dtm_stretch:
I am guessing by your comment you haven't had any luck either?

Has anyone tried different toolchains or is that irrelevant?
[Samsung Epic 4G Touch] agat63:
Rujelus22 made some progress.

He is running couple of more testes before he gonna post it here.

Fingers crossed for everyone.
[Samsung Epic 4G Touch] rujelus22:
Got it to build and everything seems to be working

made a folder called Kernel

copied the 4.4.3 toolchain in to it under Kernel/toochain/prebuilt

made a folder called Kernel/initramfs

then ran this

$ cd Kernel

$ git clone git://github.com/agat63/E4GT_ICS_kernel.git

$ cd initramfs

$ git clone git://github.com/agat63/E4GT_ICS_initramfs_optimized.git

$ cd ../

$ export CROSS_COMPILE=/media/Android/Kernel/toolchain/prebuilt/arm-eabi-4.4.3/bin/arm-eabi-

$ export ARCH=arm

$ export USE_SEC_FIPS_MODE=true

$ cd E4GT_ICS_kernel

$ make distclean

$ make u1_na_spr_defconfig

$ make modules

$ mkdir initramfs/lib

$ mkdir initramfs/lib/modules

$ cp drivers/staging/westbridge/astoria/switch/cyasswitch.ko initramfs/lib/modules

$ cp drivers/net/wireless/bcmdhd/dhd.ko initramfs/lib/modules

$ cp drivers/scsi/scsi_wait_scan.ko initramfs/lib/modules

$ make -j2 zImage CONFIG_INITRAMFS_SOURCE=/media/Android/Kernel/E4GT_ICS_kernel/initramfs

Hope that helps
[Samsung Epic 4G Touch] dtm_stretch:
Which toolchain is this? 2009q3-68 is 4.4.0.
[Samsung Epic 4G Touch] agat63:
I'm using 2009q3-68

It should work.
[Samsung Epic 4G Touch] sleshepic:
it works! booted right up. i guess my folder structure was a little dif, but worked first try. thx again. Rujelus to the rescue
[Samsung Epic 4G Touch] dtm_stretch:
Really? Mine didn't boot or have a recovery. Guess I'll be trying again. Although, I had to change "$ export CROSS_COMPILE=/media/Android/Kernel/toolchain/prebuilt/arm-eabi-4.4.3/bin/arm-eabi-" to arm-none-eabi because arm-eabi-gcc kept giving me errors after export.
[Samsung Epic 4G Touch] sleshepic:
Hell yeah!

Thx Agat and Rujelus for all the help. Let the kernel building....begin!

---------- Post added at 07:47 PM ---------- Previous post was at 07:37 PM ----------

i would say just make sure your changing the paths to whatever your setup is. I had to change most of them just cus I had everything in dif places. it does work though, so you'll get it
[Samsung Epic 4G Touch] dtm_stretch:
Which toolchain are you using?
[Samsung Epic 4G Touch] sleshepic:
arm-eabi-4.4.3
[Samsung Epic 4G Touch] SweetwaterBurns:
It's not quite working for me either... and rujulus' steps are pretty much the steps performed by the build script. The only difference is the FIPS=true bit and I had tried adding that earlier with no success so I'm not sure why nothing is working... Those of you that it has worked for, how are you flashing the kernel? What version of ubuntu are you using? I'm using heimdal on 12.04 and am wondering if that might be the issue although using it to go back to stock works fine.
[Samsung Epic 4G Touch] sleshepic:
im uploading the arm-eabi-4.4.3 to my dropbox now. will send you guys a pm when its done. maybe that'll do it
[Samsung Epic 4G Touch] dtm_stretch:
I am using the same set up. I have been flashing the zimage with heimdall and via agat's recovery.

Thank you very much. I appreciate all the help you guys are giving to help us catch up.
[Samsung Epic 4G Touch] sleshepic:
im using heimdall on 12.04
[Samsung Epic 4G Touch] agat63:
I'm using heimdall on 11.10
[Samsung Epic 4G Touch] sleshepic:
dropbox is giving me hell right now, pretty sure I pulled the toolchain from here though...

https://github.com/DooMLoRD/android_prebuilt_toolchains

edit: if it helps, my zImage was 7.1 Mb
[Samsung Epic 4G Touch] dtm_stretch:
Alright not to be nit picky but you create a folder Kernel/initramfs and cloned to that folder. However, then you cd to E4GT_ICS_kernel and then move the modules to E4GT_ICS_kernel/initramfs. Wouldn't that mean you aren't using the optimized initramfs?

I am still having issues and that last kernel (with the different toolchain) was 10mb. I have tried builds now using the optimized initramfs and the ones included in the E4GT_ICS_Kernel.

Alright, so make modules is NOT creating j4fs.ko. So if you just cp over the created modules onto Agat's source no big deal because he included j4fs.ko my problem was that I cleaned out the modules from his source so I only copied over 3 modules. Question is, why is j4fs.ko not compiling and why did it compile for agat? Also is anyone else seeing this?
[Samsung Epic 4G Touch] SweetwaterBurns:
Now that you mention it, I only have those 3 as well and cleared the prebuilt modules. I kind of gave up for the evening and have to get to bed, but I'll dig into it tomorrow if you guys haven't figured out by then.
[Samsung Epic 4G Touch] dtm_stretch:
I am giving up for the night also. I looked in the samsung drivers folder and there is no j4fs but you can open the make file and see that there is an option to enable the samsung drivers, strangely there is an fm driver in there also. Either way I did a make menuconfig and searched through every possible option to see if I needed to enable the j4fs.ko to build and I couldn't find anything. Hopefully, we can get this figured out. My brain hurts. I'll confirm tomorrow whether I can actually build a working kernel with the modules agat included.
[Samsung Epic 4G Touch] sleshepic:
I did it a few ways with the initramfs folder location til I saw it was easier to just have it in the E4GT_ICS_kernel folder. So I make the modules, copy them in there and point to it upon build. So my final line looks like this(all ours will be did depending on your structure)

$ Make zImage CONFIG_INITRAMFS_SOURCE=/home/Ian/kernel/E4GT_ICS_kernel/initramfs

As long as you build the modules and put them in your initramfs folder and point it there you should be good. Forget about the top part that says kernel/initramfs. Just make it E4GT_ICS_kernel/initramfs - wherever you have that. Then the copy and paste commands make sense further down, being inside the E4GT folder in terminal
[Samsung Epic 4G Touch] sleshepic:
When I "optimize for size" in menuconfig I end up erroring out about 3/4 way through build. Tried it a few times, only dif was optimize. Too bad, isn't that a good feature to be able to have checked?
[Samsung Epic 4G Touch] SweetwaterBurns:
If I remember right, it can free up a bit of memory and the kernel will load marginally faster at boot. Possibly a good addition but not really enough to worry about IMHO.