yashsingh1/xdaforums huggingface dataset:
[Samsung Epic 4G Touch] agat63:
Including recovery into zImage worked with one hick up.

I lost WiFi again.

Anyone wanna give it a shot here is link to tutorial and scripts.

http://rootzwiki.com/topic/8296-gui...rkmod-recovery-into-samsunginitramfs-devices/

Now gotta find a way to make wifi work with it.

Here is my logcat when trying to enable WiFi:

D/WifiService( 2691): setWifiEnabled: true

D/WifiService( 2691): ****************setWifiEnabled(), allowWifi***************

*true

E/WifiSettingButton( 2793): onReceive()-S:2

I/WifiHW ( 2691): [WIFI] Load Driver

E/WifiHW ( 2691): Cannot open "/data/.cid.info": No such file or directory

I/WifiHW ( 2691): [WiFi.c] insmod() Start!!

I/WifiHW ( 2691): [WiFi.c] start init_module() Start!!

E/WifiHW ( 2691): return of insmod (args:firmware_path=/system/etc/wifi/bcm4330

_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt) : ret = -1, Exec format erro

r

E/WifiService( 2691): Failed to load Wi-Fi driver.

V/WifiSettings( 3368): resetRetryDialogVariable

E/WifiSettingButton( 2793): onReceive()-S:4
[Samsung Epic 4G Touch] dtm_stretch:
So we are having the same failures with extracted initramfs and with the files koush posted. I am really suprised the files koush posted broke the wifi considering the only thing he posted were the recovery files and a wrapper. I was actually in the process of using just the recovery files from chris41g's kernel and pairing them with the stock initramfs but I am not going to waste my time because I am pretty sure it will give me the recovery but break the wifi again.

The error is in the bcm4330 module containing the wifi drivers. I am not at my comp now but just curious is you vibration and bluetooth working?

Kinda wishing some people with some more experience would chime in, I have done a lot of googling but no luck.
[Samsung Epic 4G Touch] agat63:
I'm back to Calkulin's kernel didn't thing of checking vibration and bluetooth.

Will flash my kernel back and try it.

Will report back shortly.

Edit: No vibration. No haptic feedback.

However bluetooth works.
[Samsung Epic 4G Touch] marty331:
Success!

Great tutorial.

Now I have a question, how do you determine the defconfig for different phones? I know I can go download the kernel for another samsung device I have but I don't know which defconfig to use.

Thanks!
[Samsung Epic 4G Touch] chris41g:
wifi is breaking, obviously because of the wifi drivers, something is wrong with the defconfig probably out of the box, i dont remember... it isnt copying and compiling the new drivers into the initramfs..

you are more than welcome to look at my defconfig at https://github.com/chris41g/LoStKernel/blob/master/Kernel/arch/arm/configs/LoStKernel_defconfig
[Samsung Epic 4G Touch] agat63:
It works outa box.

With source and initramfs provided in OP WiFi works just fine.

But as soon as we trying to do some changes to initramfs or use a different one wifi is gone.

I'll try to run diff tonight and may be will be able to find something.
[Samsung Epic 4G Touch] shanenielsen1234:
If you download the source for the other phone, when you unzip it there well be a text document telling you what the defconfig is.
[Samsung Epic 4G Touch] chris41g:
its because you are using wifi modules in the ops initramfs (i assume), but when you build your own they are not working correctly..

check the file sizes of your dhd.ko
[Samsung Epic 4G Touch] agat63:
Once you downloaded your kernel source and extracted it to location you want it to be open terminal and cd to that location.

eg. source is D710 in your home folder and there is 2 folders in it. Kernel and initramfs.

CD to D710/Kernel folder and type

$make xconfig and hit enter.

You will get to UI where you can manually set most of .config file configuration.

---------- Post added at 09:14 AM ---------- Previous post was at 08:47 AM ----------

That's the plan for tonight.

I'm at work right now but will run diff on initramfs files when I get home.

And I'll try to compare 2 .config files as well.
[Samsung Epic 4G Touch] marty331:
Wow, that was hard! LOL Thanks I appreciate the help.

Now I have to yell at myself.....READ!
[Samsung Epic 4G Touch] dtm_stretch:
Files size of dhd.ko is 363.1kb

I compared your defconfig to c1_rev05_na_spr_defconfig and it looks like the path to the initramfs was blank here:

CONFIG_INITRAMFS_SOURCE="/home/derek/Desktop/initramfs/" (obviously i added my path)

other than that they looked almost identical minus a few changes in your but those didn't seem related to our issues.

**Edit: Yeah didn't work. Wifi and vibration are broke.
[Samsung Epic 4G Touch] agat63:
Did run meld diff on initramfs files.

All files that I was able to view are identical in both kernels including .config files. With stock initramfs and with Kosh's.

I guess the modules are built incorrectly.
[Samsung Epic 4G Touch] chris41g:
delete the modules from the initramfs.. if they were built with an older source they wont work.. sounds like the new ones arent getting copied..
[Samsung Epic 4G Touch] agat63:
I did copy module files in window (drag and drop) and not in terminal command.

So I'm pretty sure files got replaced since I've been asked to confirm replacement for every module file.

But what you saying make sence and I'll try to clear modules folder before building next kernel and see what will happen.
[Samsung Epic 4G Touch] chris41g:
weird things happen when building modules... sometimes i have to do it twice to make a a good module.. and i have a script that does everything...

distclean

make defconfig

make modules

copy modules

strip modules

make zImage

make tar

make update zip

upload to ftp

update github

make clean

sometimes i need to run that twice to get my modules right... but my script doesnt overwrite modules, it deletes and copies..
[Samsung Epic 4G Touch] agat63:
So far I did notice that too.

From same source+initramfs combo I had a working kernel and not working kernel as well. It looks like it does what it wants and wheneve it feel like to make a working kernel it will do it.

I ditched my VM and made my laptop a dual boot so I would have a clean Ubuntu inviroment but still results are hit and miss.

I appreciate all your help and hopefully we will figure a way to make this work.
[Samsung Epic 4G Touch] Entropy512:
I'd strongly recommend adding some documentation on using git - any kernel developer should be using git to maintain their kernels. It makes bringing in upstream patches MUCH easier, and also publishing source is a lot easier.

Doing "git push origin" to a public repository like github or gitorious (I prefer github, gitorious seems buggy to me) take a LOT less time and bandwidth than pushing an entire new tarball for a given kernel release.

A few git tips:

Try to keep changes to "one feature, one commit". In addition to making the lives of other developers who want to apply your feature to another device easier, it will make your OWN life easier if you start working on another device.

Keep defconfig changes separate from the kernel commit that adds the feature being enabled/disabled/configured using the defconfig change. Otherwise the defconfig change will make the commit unlikely to apply cleanly to another source tree

To get a properly formatted git-am commitable patch, append .patch to the URL of a github page - example: https://github.com/Entropy512/linux_kernel_sgh-i777/commit/fc9eb85807302583259e27013ed184a43107bb67 becomes https://github.com/Entropy512/linux...c9eb85807302583259e27013ed184a43107bb67.patch

Patches made as described above can be committed using "git am filename.patch" - this preserves attribution to the original author of the commit. It's not required (Edit: Actually, on further thought, some of the legal rules relating to copyrights may require that authorship be preserved - better safe than sorry!) but a nice thing to do and makes other kernel maintainers more likely to cooperate with you. They may even start coming to your kernel thread and posting useful patches.

DO NOT rebase commits you've already pushed to a public repo, this practice is considered mortal git-sin, even Torvalds has written rants against this practice - Worst case this means more than one commit for a given feature. (e.g. initial feature commit, cleanup/bugfix commit). If you do this, ideally reference the commit you're fixing up.

When reverting something, make a comment why you're doing the revert - Otherwise someone will wonder what was wrong with the feature you reverted

In general, try to be descriptive with your changes in the commit description - what you're changing and why - I suggest doing some research and looking at how commits are made on the mainline Linux kernel.

One which I should be doing, but have been lazy about:

When you do a release, you can tag that branch/revision so it is easily identifiable as the branch for this release. I admit I haven't done this nearly as often as I should.
[Samsung Epic 4G Touch] chris41g:
I agree with everything said above about git... I don't always adhere to good git practices.. but i try lol
[Samsung Epic 4G Touch] shanenielsen1234:
I well try the tips out thanks!
[Samsung Epic 4G Touch] shanenielsen1234:
I know what you mean! LOL I think it's a conspiracy! ;)
[Samsung Epic 4G Touch] agat63:
Well.

I guess I'm doing something wrong or my PC just doesn't like me any more.

I did clean my Ubuntu from everything and started from scratch.

Downloaded arm-2009q3 toolchain from link in OP.

Downloaded Kernel Source and Initramfs from links in OP.

Did clean the /initramfs/lib/modules folder.

Run the build procedure.

Flashed zImage and no WiFi.

Cleand my PC again. Downloaded full source from github provided by Chris41g (his source and initrfmfs). Followed the guide in his source and edited config files accordingly. Compiled kernel, flashed it and still no WiFi.

Would like to know if you guys were able to compile a fully working kernel and if yes what steps did you take.

Thanks in advance.
[Samsung Epic 4G Touch] A random package:
Worked!

Beautiful full tutorial, thanks so much! Everything worked first time....just beautiful. Now to research mods and everything. Again thanks for the help getting started.:D
[Samsung Epic 4G Touch] interloper:
Tool Chain Issues

I sure wish I had noticed this thread this morning at 3AM ;-)

For those having toolchain problems, as I did, I fixed it by making an edit to the makefile. This edit will depend on where you put the tools. The README provided by Samsung says to put the toolchain in opt/toolchains/arm-2009q3/... and the makefile I had calls for a tool not available in the toolchain THEY told me to get. So, I found FriendlyARM and extracted it to the location. At this point the MAKEFILE still doesn't correspond to the tools in FriendlyARM :

export KBUILD_BUILDHOST := $(SUBARCH)
ARCH	?= arm
CROSS_COMPILE	?= /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-
CROSS_COMPILE	?= $(CONFIG_CROSS_COMPILE:"%"=%)

That tool is not in the included package, so you have to open the MAKEFILE and edit it to say:

export KBUILD_BUILDHOST := $(SUBARCH)
ARCH	?= arm
CROSS_COMPILE	?= /opt/toolchains/arm-2009q3/bin/arm-none-eabi-
CROSS_COMPILE	?= $(CONFIG_CROSS_COMPILE:"%"=%)

Save the MAKEFILE and close it. Now, you have the tools you need and the makefile knows where they are and the proper ones to chose. I compiled my first kernel using this method last night. Thanks to shanenielsen1234 for a great and necessary guide. Thanks to Chris41g for backing him up with some good thread support and pointing us all to some excellent code to do things ourselves. This is what open source is all about!
[Samsung Epic 4G Touch] agat63:
Is there anything wrong to have toolchain on my desktop and have a path to it

/home/agat63/Desktop/arm-2009q3/bin/arm-none-eabi-

That's where I have it and kernles compile without any error messages.

There are some warning throught the compile process but I had them all the time.
[Samsung Epic 4G Touch] interloper:
As long as your makefile points to the toolchain that part should be good. Make sure the initramfs directory is referenced properly in the final make command.

make -j# CONFIG_INITRAMFS_SOURCE=/path/to/initramfs/directory

Android Developers says you can use 2x your core count in place of #. I just finished a kernel made with my experiences last night and the additional initramfs sources in the OP. Thank again to the OP and Chris41g!

Screenshot of kernel

join irc.fossnet.info #E4GT for quicker responses.
[Samsung Epic 4G Touch] agat63:
The path should be correct. Kernel boots and works.

The only thing is not working is WiFi.

Something breaks it in the process and that's what I can't figure out.
[Samsung Epic 4G Touch] interloper:
If you join the IRC channel I refer to in my thread, I can help you faster. Otherwise, I suggest

cd ~/project/working/directory
make mrproper
make c1_rev05_na_spr_defconfig
make modules
(cherry-pick modules to initramfs directory)
make -j# CONFIG_INITRAMFS_SOURCE=/path/to/initramfs/directory

This worked perfectly for me. The only difference is you are using a VM and I am not. That could cause the tools to do something different, I can't say for sure.
[Samsung Epic 4G Touch] agat63:
I'll join IRC chat tonight.

I'm at work right now and I can't chat from corporate PC.

Thanks for your offer.

I defenetly wanna figure out what am I doing wrong.
[Samsung Epic 4G Touch] interloper:
Cool, there'e usually someone to help. I also forgot to mention that the $PATH should be updated to include the toolchain. Not sure if the instructions are the same for a VM but I did:

sudo gedit ~/.bashrc
scroll to file end and add a new line that says:
export path PATH=~home/desktop/arm-2009q3/bin/:"${PATH}" (or whatever your directory names are)
save and close file/close terminal/open new terminal
. $PATH
echo $PATH

This should verify the tools in the path. Verify good downloads with md5 checks also.
[Samsung Epic 4G Touch] agat63:
And I forgot to mention that after having this problem so presistant I ditch the VM and made my PC a dual boot.

I'm compiling kernel not in VM but on an Ubuntu running 11.10

Just some additional info that might help to figure out where is the problem.
[Samsung Epic 4G Touch] interloper:
3rd try

I made a third kernel and it has the broken wifi. Followed the same method I described for the first two. I'm with chris41g in thinking that it might take a few attemps to get it all right. Also, if anyone can help me add smartass to this, we'd have us an awesome new kernel. Once I get that I'll make it work with #LOUDER from supercurio. Of course tethering is also busted...
[Samsung Epic 4G Touch] dtm_stretch:
Are you using the EL29 source or EK02? Has anyone built a kernel with the new source yet?

Source downloads are SOOOO slow.
[Samsung Epic 4G Touch] interloper:
EL29 source. Making mods now. The first kernel was perfect, subsequent kernels had broken WIFI. I'm still working on some ideas for a modded init.d kernel.
[Samsung Epic 4G Touch] interloper:
I have made 10 or more kernels now and all of the, except the first, have broken wifi. I have tried different sources, pure vanilla builds...you name it. I am making progress with cpufreq governors though, if I can only get the wifi fixed. If anyone is working on this and wants to chat join irc.fossnet.info #E4GT and we can share ideas.
[Samsung Epic 4G Touch] dtm_stretch:
Is this the config that is being edited? What directory? I am on irc if you are available.
[Samsung Epic 4G Touch] interloper:
I'm mobile right now. Sorry. I am on a date with my hot wife. Ill check on when I get home.
[Samsung Epic 4G Touch] dtm_stretch:
Hey hey no problemo, enjoy your date. I did all the fixes you posted except the $Path and it still broke the wifi.

What is the deal with the fossnet irc?
[Samsung Epic 4G Touch] interloper:
I printed the .config file and can tell you exactly what you need to do to fix it once I'm home.
[Samsung Epic 4G Touch] interloper:
Not sure what you mean by your question about fossnet. I ca see you were there, but quit. It's a kinda quiet channel...Anyway, to fix the wifi issue the .config file in the top level directory needs to be edited. This is what I did:

run : make c1_rev05_na_spr_defconfig (This will create the .config file you will be editing)

Navigate to the .config file and open it with a text editor. Line 3 says :Linux kernel version. Add your info there is you want to have some version control over this kernel configuration. Now, scroll down until you see:

# SCSI Transports (This is a section heading)

Scroll down to the bottom of the list and you will see:

# CONFIG_NET_ETHERNET is not set

# CONFIG_NETDEV_1000 is not set

# CONFIG_NETDEV_10000 is not set

# CONFIG_WLAN is not set

CONFIG_BROADCOM_WIFI=m

# CONFIG_HOSTAP is not set

You want to make it to be:

# CONFIG_NET_ETHERNET is not set

# CONFIG_NETDEV_1000 is not set

# CONFIG_NETDEV_10000 is not set

CONFIG_WLAN=y

CONFIG_BROADCOM_WIFI=y

# CONFIG_HOSTAP is not set

Save/close.

Next, open the makefile in that directory and on the 4th line you will see:

EXTRAVERSION = blah blah blah

Put your kernel information there as well and it will be seen in the system properties once you get the kernel installed on you phone.

save/close.

Now, in the same terminal as before run : make modules

Finish the process as described in the OP. I should note i reverted to the tools that include the arm-none-linux-gnueabi gcc binarys.

Cheers.
[Samsung Epic 4G Touch] dtm_stretch:
Thanks for the update I'll give it a try in a bit. About fossnet, I was just having trouble with connecting to the web interface. Thanks again.

Which toolchain did you download? I've tried three now and they don't include the gcc binarys. Should I be going to older versions or did you have to create them?

**Edit:

So even with editing the .config it still broke the wifi/vibration. I am going to assume the issue is now the tool chain.
[Samsung Epic 4G Touch] interloper:
Might be, or something in the code that's not quite right. I made another good kernel, then had one fail again. I'm changing stuff like a mad scientist, laughter included, so I am reverting to a vanilla build on occasion to check my settings and tools. As I find out more I will update the thread also.
[Samsung Epic 4G Touch] dtm_stretch:
Which toolchain gave you the working kernel?
[Samsung Epic 4G Touch] interloper:
Both. Which is why that can't be the defining variable in the failure. I now have three working kernels, some kernels I made may have worked but I did not test them because I knew they didn't have features I'm trying to build in.
[Samsung Epic 4G Touch] MikeC84:
So after gong through the android "setting up a build environment" everything works now only problem is the WiFi doesn't work...
[Samsung Epic 4G Touch] interloper:
MikeC84, did you actually get a zImage after getting those errors?
[Samsung Epic 4G Touch] MikeC84:
That was the problem I was having before I fixed it. Now I am getting a zImage but WiFi is not working...
[Samsung Epic 4G Touch] MikeC84:
Just noticed my haptic feedback doesn't work either...
[Samsung Epic 4G Touch] dtm_stretch:
Yeah, I had both those issues. I have only had one successful build and that was pure stock. If you jump on irc they can probably help you double check your steps. There might be issues with the samsung source code.
[Samsung Epic 4G Touch] MikeC84:
I think the first one I did was stock and wifi and haptic didn't work then I used steady hawkin's so I could get his recovery.

Might try and copy recovery file from his and use it on stock to see if I can get rogue recovery.

Any one know why wifi and haptic doesn't work? I used the new source too if it matters..
[Samsung Epic 4G Touch] interloper:
I can't answer for sure yet why most builds fail. I'm trying another source for the bcm4330 driver. Also ill be debugging a broken kernel to see if I can gather more info that way. I don't know code so looking at it won't help me. I will update as soon as I have useful information.
[Samsung Epic 4G Touch] chris41g:
have you tried:

deleting old modules completely

doing a distclean or mrproper

compiling verbose

pastebin your defconfigs..
[Samsung Epic 4G Touch] interloper:
All that and more. Logcat on a failing kernel says insmod error and some directories not existent when trying to init the wifi.I have even used known working modules again to have them fail in the build. Checking md5 shows differences between them. (I have been collecting them all for about 12 attempts) I can post detail after I fix my dish washer...the biold log shows a lot of warnings when building the wifi module in particular; as opposed to very few while building the other modules.
[Samsung Epic 4G Touch] dtm_stretch:
Have you checked out Team Rogue's new kernel? Here is their defconfig:

https://github.com/TDR/Epic4GTouch-Kernel/blob/rogue/arch/arm/configs/rogue_ET_defconfig

First things I noticed was that it was cleaned up compared to stock. Also they did not make the change on scsi transports on line 1071 CONFIG_BROADCOM_WIFI. I haven't done a side by side comparison, unfortunately I am swamped this week and can't test this out or at least really look through it till this weekend. Let me know if this makes an progress.
[Samsung Epic 4G Touch] agat63:
Thanks for defconfig file.

I did run meld diff veiwer and there are lot of differences between c1_rev05 defconfig and rogue defconfig.

Now gotta go thru all those differences and see if I can find where is wifi broke.
[Samsung Epic 4G Touch] interloper:
i clone their git, made their stuff work, like added the intramsfs from this thread, and made a kernel with broken wifi. Although I did make one good kernel today: the critical error is:

I/WifiHW ( 3378): [WIFI] Load Driver

E/WifiHW ( 3378): Cannot open "/data/.cid.info": No such file or directory

I/WifiHW ( 3378): [WiFi.c] insmod() Start!!

I/WifiHW ( 3378): [WiFi.c] start init_module() Start!!

E/WifiHW ( 3378): return of insmod (args:firmware_path=/system/etc/wifi/bcm4330_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt) : ret = -1, Exec format error

E/WifiService( 3378): Failed to load Wi-Fi driver.
[Samsung Epic 4G Touch] agat63:
Here are few differences:

Stock defconfig Rogue defconfig

CONFIG_WESTBRIDGE_DEBUG=Y CONFIG_WESTBRIDGE_DEBUG= s not set

CONFIG_SCSI_PROC_FS=y CONFIG_SCSI_PROC_FS is not set

CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_MULTI_LUN is not set

CONFIG_BT_BNEP is not set CONFIG_BT_BNEP=Y

CONFIG_BT_BNEP_MC_FILTER=y

CONFIG_BT_BNEP_PROTO_FILTER=y

CONFIG_OABI_COMPAT=y CONFIG_OABI_COMPAT is not set

CONFIG_MUDULE_FORCE_LOAD=y CONFIG_MODULE_FORCE_LOAD is not set

Just to name a few. These looked like some of modules are handled differently I thought I'll share with you.

There are many more differences but that's normal since Gogue team build kernel with different specs.

Any ideas or comments?
[Samsung Epic 4G Touch] interloper:
Good job there man, using meld. I also did a diff but did not save the results so I'll have to run it again. Seems to me according to the error that the driver module is ok, but something isn't written right to bind it to the kernel after install. I'll have more time tomorrow to mess with it. Too many irons in the fire and honey mama is waiting for me...thanks!
[Samsung Epic 4G Touch] chris41g:
try using dmesg to see what the exact error is for the module not loading..
[Samsung Epic 4G Touch] interloper:
Will that give me a different result than using ddms or log at? Thanks Chris for helping in this thread!
[Samsung Epic 4G Touch] Entropy512:
dmesg = kernel errors

logcat = Android userland errors