Got kexec-mod, kexec-tools working, atags in progress - Should Also Work With DroidX - Droid 2 Android Development

I realize people gave up slightly on the whole kexec thing over radio worries, but I now have the module compiling and inserting without error into the Droid2/DroidX gingerbread kernel. Next comes cross compiling the kexec-tools for userspace, to allow us to attempt inserting a different kernel.
To build, you'll need a compiled DroidX kernel from source, as well as the android NDK.
To build, make sure you have downloaded the DroidX GB kernel source and compiled it. There are guides everywhere on how to build Android kernels. Just make sure you use the proper cross compiler.
http://sourceforge.n....l.tgz/download
When you build, make sure to use
Code:
make mapphone_defconfig
Once the kernel is built, clone my repo and edit envsetup.sh to reflect the correct paths to your kernel source directory and the android NDK.
https://github.com/i...kexec-mod-d2-dx
Then, source it:
Code:
source envsetup.sh
Then, just run
Code:
make
and cross your fingers. You should then have a fresh kexec_load.ko file!
To see if it loads, you'll need to copy it to your sdcard, and then on the phone, using a console, do the following:
Code:
su (click allow)
insmod /sdcard/path/to/kexec_load.ko
If you don't get any errors, it inserted! Now, of course, to actually use it, we'd need the kexec-tools built, which I haven't gotten ready yet...but they're coming! To remove the module (no reason to leave it in memory for now):
Code:
rmmod kexec_load
Happy hacking, and help is always appreciated!

This looks great! If you need any help just ask

Thanks! I probably could actually use some. I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there.
I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there, though I do have an atags module working, except it doesn't do anything without atags in the procfs (http://lists.infradead.org/pipermail/kexec/2011-January/004795.html).
kexec-tools:
https://github.com/i...xec-tools-dx-d2
To build, see the README.
Then, copy the binaries from /build/sbin/* to your device, and the move them to the /system/bin directory, and chmod them 770 to make them executable.
mod-atags:
https://github.com/i...mod-atags-d2-dx
Now, if I/we can just get atags and procfs stuff taken care of, we'll be able to go to the next step. I already have atags compiling as a module, but it won't stay inserted because we have no atags in the procfs. Note I can't just trace through code like this and know what everything is doing, but I know enough to hack at it and be dangerous

I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?

calebcoverdale said:
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
Click to expand...
Click to collapse
No idea. I haven't even gotten the kernel to change yet, so I haven't gotten to mess with radio yet. The method itself should/would work though, but radio will require reverse engineering...perhaps find a similar phone with an open bootloader and disassemble and attempt to clone it's modules.

The latest change I made may or may not work, it was an attempt to remove atags from the kexec module based on an old patch I found, which added the functionality. This at leaset made kexec -l zImage work, but when I run kexec -e, the kexec binary complains about atags not being there...hrmmmph.
I may have to revert it (and will if we can get atags somehow) ...but if we can get the kexec bin to ignore /proc/atags or just find a way to rip them out of the running kernel, we'll be in business.
The commit: https://github.com/ilikenwf/kexec-mod-d2-dx/commit/12dffe0ea286be0fe9ab0303a5a35ed92be4ee2c
I'm also looking into 2ndboot.

I like where this is going! Keep working!
Sent from my DROID2 using xda premium

Okies, so, I emailed aliasxerog (original kexec-mod writer), and I hope he'll get back to me. Even though his twitter says he's a "former android developer," maybe he'll be willing to give me some hints so I can pick up where he left off.
I also got the froyo version of the module building properly based on his module, yet again, (all after SBF'ing my phone back down to motoblur froyo - yech!) but neither currently work... (note there's a gingerbread and a froyo branch on my repo): https://github.com/i...kexec-mod-d2-dx
The froyo one throws the following error, which stops me dead in the water:
Code:
Could not find a free area of memory of 3007dc bytes...
The gingerbread one loads the kernel into memory but won't execute it due to our not having atags.

We've moved our git repos to an organization for easier collaboration:
https://github.com/organizations/D2-DX-Customboot

links are imcomplete.
use URL lable pls.

Cross compiler version ?
hello,
Sorry but I am not able to use the sourceforge link that you provided to download kernel source .. Also please share what cross compiler version is to be used....
Thanks in advance.

Related

[Q] archos gen8_gpl_froyo kernel build

Just for fun and because I can, I started to work on recompiling the kernel for my Archos 10.1 (gen8) device.
I'm working with the Archos provided gen8_gpl_froyo source tarball.
Apart from some small stuff I could work out, like unterminated double quoted strings in config.in files, patches that don't apply to sources because the sources contain symlinks where files are expected, and of course the rounds of what-do-I-need-on-my-host (automake, texinfo, ...) - I got both a working kernel compile, and all the rest of the build.
I proceeded to menuconfig in some stuff I'd like to have in the kernel, as modules, like netfilter conntracking / NAT support, advanced (policy) routing, namespaces, nfsd. Also went smoothly.
I can successfully start that kernel on an existing Uruk 0.7 install, by untarring my self built modules over what Uruk comes with in /lib/modules/2.6.29-omap1/kernel, depmod that, and use the Uruk's /root/initramfs.cpio.gz together with my self built zImage for flashing through the recovery menu.
The system then boots up fine, I can verify it is running the kernel, I can load the netfilter conntracking / NAT modules, and even install an state ESTABLISHED rule which does what it should.
HOWEVER - and that's why I open this thread, there is constant chatter, coming from the kernel, being written to logcat. This uses quite a bit of CPU, probably for the logging work, so I rapidly reverted to the Uruk's own kernel.
What I would like to know, is whether somebody else has seen the following kernel messages in a similar scenario, and knows what I did wrong / how I can work around that?
Code:
03-06 15:33:56.816 I/cat ( 1020): <6>tmdlHdmiTxHdcpCheck 4245
03-06 15:33:56.816 I/cat ( 1020): <3>Bad input instance value returned in hdcp_check line 729
03-06 15:33:56.847 I/cat ( 1020): <6>tmdlHdmiTxHdcpCheck 4245
03-06 15:33:56.847 I/cat ( 1020): <3>Bad input instance value returned in hdcp_check line 729
03-06 15:33:56.878 I/cat ( 1020): <6>tmdlHdmiTxHdcpCheck 4245
03-06 15:33:56.878 I/cat ( 1020): <3>Bad input instance value returned in hdcp_check line 729
It is a constant repetition of these two lines, I just showed three instances so you can get a feel for the frequency from the timestamps.
The function names / messages are nowhere to be found in the archos released source code, nor in the modules compiled from there.
They reside in two module files that lie directly in /lib/modules/, named hdmicec.ko and hdmitx.ko
The hdmitx.ko module is loaded when I boot into my kernel. Loading hdmicec.ko by hand does not improve the situation. Also, under the normal Uruk 0.7 kernel, only the hdmitx.ko is loaded.
Update 7.3.: the situation stays the same after I modified my .config to be, except for the diverse modules I additionally selected, identical to the kernel /proc/config.gz found on Uruk 0.7. There seem to be several things missing that are in Uruk 0.7, i.e. the interactive CPU governor, and filesystem caches.
I also compared the loaded modules after boot, and apart from module size, it is the same list with Uruk 0.7 and my kernel.
Trying again to use my kernel, I also noticed that the tablet freezes as soon as I try to start WLAN. Still pings (on the g_ether USB connection I use), but the GUI is frozen and ssh connections, too.
It seems to me that the gen8_froyo_gpl source released by Archos is somewhat lacking...
Where can I find the Uruk 0.7 kernel tree, or some other kernel that is Known Good?
Latest kernel source you can find here:
http://sauron.pourix.com/UrukDroid/
conntrack/nat brakes compatibility with tiwlan kernel driver - witch is not part of kernel (but can be recompiled).
Anyway - entire wifi stock is a mess .. sadly
$aur0n said:
Latest kernel source you can find here:
http sauron.pourix.com /UrukDroid/
Click to expand...
Click to collapse
Thanks! What is the build system are you using?
I'm not exactly confident that the one I built from the Archos GPL package, is good.
But it seems to work! I successfully compiled your kernel, with your .config, and run that now. Wifi is working so far, my g_ether usb network connection works, too, and no funny hdmi messages are showing.
Now I'm going to build in some of the stuff I wanted of the networking stuff, and see what breaks wifi exactly. I would _love_ to have conntrack / NAT available.
Update built again with various networking stuff enabled, advanced routing and namespaces among them, but consciously NOT with conntracking. Guess what - tiwlan_drv.ko does not load! When triggered through the UI that results in an apparent complete hang, but when trying insmod from a shell it is benign. All in all that's good - the wlan problems probably don't have anything to do with conntracking, and I have a half way easy test case to start "bisecting" which build option makes it fail. Now if I only had more time today...
Anyway, thanks again Sauron for providing such a good basis for playing!
$aur0n said:
conntrack/nat brakes compatibility with tiwlan kernel driver - witch is not part of kernel (but can be recompiled).
Click to expand...
Click to collapse
After some compile / flash / test cycles I'm pretty convinced that anything which changes the layout / size of struct net_device or struct sk_buff, breaks that binary tiwlan_drv.ko thing - which is probably to be expected...
Some googling around, did not find me any source code to that tiwlan_drv.ko, only loads of people copying it around between various systems in binary form (argh...)
Do you have source for that module available, so I could try and recompile it when the struct layout changes?
Here's a list of config defines that should probably be left alone, gleaned from looking at the struct definitions:
Code:
options that change sk_buff:
CONFIG_XFRM=y
CONFIG_NF_CONNTRACK=n
CONFIG_BRIDGE_NETFILTER=n (switches on when enabling bridge driver,
but can be switched off separately - bridge
itself builds and module loads)
CONFIG_NET_SCHED=n (so no tc / traffic shaping / queueing)
CONFIG_NET_CLS_ACT=n
CONFIG_IPV6_NDISC_NODETYPE=n?
CONFIG_MAC80211=n
CONFIG_NET_DMA=n?
CONFIG_NETWORK_SECMARK=n
options that change net_device:
CONFIG_WIRELESS_EXT=y
CONFIG_NET_DSA=n
CONFIG_NETPOLL=n (switched on / needed by netconsole... sigh)
CONFIG_NET_NS=n (would love to have that, lxc could work well then...)
CONFIG_DCB=n
CONFIG_COMPAT_NET_DEV_OPS=y
You can try with this source
http://processors.wiki.ti.com/index.php/OMAP35x_Wireless_Connectivity_Release_Notes_beta_3_release
I haven't checked it - so I cant guarantee it will work. But If you could make it work - this would give us NAT on Uruk - so....
$aur0n said:
I haven't checked it - so I cant guarantee it will work. But If you could make it work - this would give us NAT on Uruk - so....
Click to expand...
Click to collapse
Thank you! I looked into the stuff a bit, it is certainly the right code set. It's a pretty huge pack overall, packing a kernel and userlevel stuff, even a copy of the iptables source , but I already located the driver itself...
I'll see that I extract the driver only parts into your kernel tree, somewhere under staging, and get it to build and maybe even work from there.
Will need some time to do that, and I'm rather busy with other work this week - next week maybe.
tiwlan_drv rebuild - no success so far
Hi $auron,
was able to take some time yesterday and today to work on the tiwlan_drv source code you pointed out. Unfortunately I did not get it to run.
I successfully built a module, inside your kernel tree, by incrementally dumping .c and .h files from the TI code drop into a subdir of drivers/staging/ and finding out which -DEFINES it needs to build, and some small code mangling was also neccessary.
However, the resulting module fails to properly load, first with some GPIO allocation message which I could get around (not present in the .ko file from Archos), and then in a request_irq call during initialization. Looking at that second failure point I notice that the more hardware / board oriented parts of the code look not at all like what objdump can tell me about the Archos binary...
Given my nonexistent ARM assembler skills, I cannot go forward at that point with ease, so I'm trying to chicken out by asking some Archos people for the source... No idea whether that will work...
UPDATE: no reply from Archos so far...
I try to sidestep the issue by moving the problematic elements of skbuff and net_device from the middle of the struct, to the end.
Hi!
I see that the topic is quite old - but anyway: are there any news? I am trying to build gen8 kernel with conntrack/nat support but with no luck - the kernel doesn't load, it reboots the device.
Did anybody find the way to compile with that options?
Golomidov said:
Hi!
I see that the topic is quite old - but anyway: are there any news? I am trying to build gen8 kernel with conntrack/nat support but with no luck - the kernel doesn't load, it reboots the device.
Did anybody find the way to compile with that options?
Click to expand...
Click to collapse
In Uruk 1.6 kernel has compiled in conntrack/nat.
$aur0n said:
In Uruk 1.6 kernel has compiled in conntrack/nat.
Click to expand...
Click to collapse
Yes, but there are other options that are missing in your kernel - targets owner and multiport - and because of that orbot transparent proxy doesn't work
Could you please tell how did you achieve that? I mean how did you compile UD kernel with conntrack/nat support?
(btw, I have changed init and installation scripts in UD for it to work with latest archos devices - a35dm for exmple)
EDIT: did you take/recompile tiwlan_drv.ko? would standard kernel work if I just copy tiwlan_drv.ko from UD?
---------- Post added at 03:06 PM ---------- Previous post was at 02:48 PM ----------
Golomidov said:
EDIT: did you take/recompile tiwlan_drv.ko? would standard kernel work if I just copy tiwlan_drv.ko from UD?
Click to expand...
Click to collapse
Nope, it didn't work
$aur0n said:
In Uruk 1.6 kernel has compiled in conntrack/nat.
Click to expand...
Click to collapse
$aur0n, could you please share the knowledge how did you manage to compile kernel with tiwlan driver and conntrack features?
Community will appreciate it! Thanks!
Golomidov said:
$aur0n, could you please share the knowledge how did you manage to compile kernel with tiwlan driver and conntrack features?
Community will appreciate it! Thanks!
Click to expand...
Click to collapse
It's all all written somewhere in developers thread of uruk droid.
$aur0n said:
It's all all written somewhere in developers thread of uruk droid.
Click to expand...
Click to collapse
Confirmed! tiwlan has been compiled and tested with nat/conntrack and targets owners and multiport.
Since openaos is down pasting here instruction:
Code:
How to build the WLAN source provided by archos
Kernel module released at http://gitorious.org/archos/archos-gpl-gen8/trees/master/hardware/ti/wlan/wl1271
Download the above mentioned sources.
cd .../hardware/ti/wlan/wl1271/platforms/os/linux
Now setup your environment by editing wl_env.bash or do it manually on the commandline in my case it was:
export CROSS_COMPILE=/usr/src/gen8/buildroot/build_arm/staging_dir/usr/bin/arm-linux-
export ARCH=arm
export HOST_PLATFORM=zoom2
export KERNEL_DIR=/usr/src/gen8/buildroot/linux/
Then type make and wait a few minutes and you are done. The tiwlan_drv.ko will appear in .../hardware/ti/wlan/wl1271/platforms/os/linux This gives you only the module. I am still looking at how the tiwlan_loader needs to be compiled.
More info can also be found http://omappedia.com/index.php?title=Wilink_Linux&redirect=no
If you use wl_env.bash then don't forget to
# source wl_env.bash
after editing and before make
thanks everybody!

[Q] Source Code Base to build ROMs for SGS4G

Hello All,
I am new to the android platform. So please forgive if this is too trivial a question.
1. How do I obtain source code for a specific platform and a specific phone?
Is it segregated that way?
2. How do I build ROM and package it to deploy on the phone?
Please provide pointers to these and I am willing to go through the documents/literature. Please help.
Thanks in advance!!
Two answers first question go in general section second start here http://forum.xda-developers.com/showthread.php?t=1117554 very good read hope this helps
sent from gingerbread 2.3.3 sgs4g ROOTED
rose2jam said:
Two answers first question go in general section second start here http://forum.xda-developers.com/showthread.php?t=1117554 very good read hope this helps
sent from gingerbread 2.3.3 sgs4g ROOTED
Click to expand...
Click to collapse
Thanks for the quick response! I have been going over that thread quite extensively but I can't seem to locate threads for
1. How to get the source code for the instrument( SGS4G) ?
2. How to build a complete ROM which is flashable? Basically, How to package it for deployment, like the other developers do on this forum.
androcton said:
Thanks for the quick response! I have been going over that thread quite extensively but I can't seem to locate threads for
1. How to get the source code for the instrument( SGS4G) ?
2. How to build a complete ROM which is flashable? Basically, How to package it for deployment, like the other developers do on this forum.
Click to expand...
Click to collapse
You didn't post in the right section, this needs to go in the general section.
You'll need to download the phone's source:
https://opensource.samsung.com/reception/reception_main.do?method=reception_search&searchValue=t959v
You should grab both files there. You'll need to build this on Linux or anything that has G++ for ARM.
FBis251 said:
You didn't post in the right section, this needs to go in the general section.
You'll need to download the phone's source:
https://opensource.samsung.com/reception/reception_main.do?method=reception_search&searchValue=t959v
You should grab both files there. You'll need to build this on Linux or anything that has G++ for ARM.
Click to expand...
Click to collapse
Thank you so much! I am already onto it!
Moved to proper forum.
androcton said:
Thank you so much! I am already onto it!
Click to expand...
Click to collapse
Did you ever get it working? I also found Dr. Honk's public git here:
https://github.com/drhonk/android_device_samsung_sgs4g
You can see the source for the Bali kernel here:
https://github.com/drhonk/Bali-V4G
Tell me how it goes.
FBis251,
Thanks for the resources! Currently I am still trying to get my dev-env setup properly, somehow have some installation/setup issues with the GNU/LINUX ARM toolchain. Meanwhile, I could build the kernel from the android base from source.android.com.
I have the system.img and other files in the out directory. The build went through but with lot of warnings. Here is the buildlog. Please let me know if something is amiss. Thanks!
Assuming the build went fine, I am not quite sure how to load that onto the device. I am trying to run an emulator though....will get back on that.
androcton said:
FBis251,
Thanks for the resources! Currently I am still trying to get my dev-env setup properly, somehow have some installation/setup issues with the GNU/LINUX ARM toolchain. Meanwhile, I could build the kernel from the android base from source.android.com.
I have the system.img and other files in the out directory. The build went through but with lot of warnings. Here is the buildlog. Please let me know if something is amiss. Thanks!
Assuming the build went fine, I am not quite sure how to load that onto the device. I am trying to run an emulator though....will get back on that.
Click to expand...
Click to collapse
Have you tried looking at:
http://source.android.com/source/building.html
Apparently you can just flash the image you just made... Try to see if you can open the .img as a .tar...?
I'm having trouble compling the bali kernel... I'll try again tomorrow.
FBis251 said:
Have you tried looking at:
http://source.android.com/source/building.html
Apparently you can just flash the image you just made... Try to see if you can open the .img as a .tar...?
I'm having trouble compling the bali kernel... I'll try again tomorrow.
Click to expand...
Click to collapse
Hi FBis251,
Can you please tell me how did you go about setting up the dev-env(the cross compiling toolchains). Are you using linux( which flavor, I am using Ubuntu 11.04 Natty Narwhal). I have some problems setting up the toolchains...as mentioned in the below link
https://opensource.samsung.com/recep...rchValue=t959v
Any ideas??
The readme from the opensource site says:
Code:
HOW TO BUILD KERNEL
1. Visit http://www.codesourcery.com/, download and install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI.
2. Extract kernel source and move into the top directory.
3. Execute 'make vibrantplus_rev00_defconfig'.
4. Execute 'make' or 'make -j<n>' where '<n>' is the number of multiple jobs to be invoked simultaneously.
I just googled thw 2009q3-68 version since I couldn't find it on the site after signing up and came across this:
http://www.codesourcery.com/sgpp/lite/arm/portal/release1033
I actually haven't gotten the kernel to compile without errors yet, and I haven't tried building the platform source until later today. You'll have to modify the makefile, look for the variable called CrossCompile and set it to the main /bin folder from the CodeSourcery toolchain.
Should be something like
Code:
CROSS_COMPILE ?= /home/user/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-
I'll give you more details later, I'm still learning as I go too.
Also, something I came across to speed things up when you do the make, apparently if you have a quadcore processor, you can use make -j 8 (or just multiply however many cores you have by 2) and the compile should run as fast as possible.
Keep me posted.
FBis251 said:
The readme from the opensource site says:
Code:
HOW TO BUILD KERNEL
1. Visit http://www.codesourcery.com/, download and install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI.
2. Extract kernel source and move into the top directory.
3. Execute 'make vibrantplus_rev00_defconfig'.
4. Execute 'make' or 'make -j<n>' where '<n>' is the number of multiple jobs to be invoked simultaneously.
I just googled thw 2009q3-68 version since I couldn't find it on the site after signing up and came across this:
http://www.codesourcery.com/sgpp/lite/arm/portal/release1033
I actually haven't gotten the kernel to compile without errors yet, and I haven't tried building the platform source until later today. You'll have to modify the makefile, look for the variable called CrossCompile and set it to the main /bin folder from the CodeSourcery toolchain.
Should be something like
Code:
CROSS_COMPILE ?= /home/user/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-
I'll give you more details later, I'm still learning as I go too.
Also, something I came across to speed things up when you do the make, apparently if you have a quadcore processor, you can use make -j 8 (or just multiply however many cores you have by 2) and the compile should run as fast as possible.
Keep me posted.
Click to expand...
Click to collapse
I followed the procedure mentioned in that readme file, but with additional info from other site,,
I extracted the source code from samsung open source, and then used the toolchain from the android base and it looked like it built(lot of warnings), but i cant find zImage anywhere?Wondering what ever happened during the build,,,
command used: make -j4 ARCH=arm CROSS_COMPILE=/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- zImage
Build abruptly end, no build logs anything, see file for build output.
Is there anything that I am missing?, Please help!
And, Don't you think the build log is unusually small for a kernel build?? :O
androcton said:
I followed the procedure mentioned in that readme file, but with additional info from other site,,
I extracted the source code from samsung open source, and then used the toolchain from the android base and it looked like it built(lot of warnings), but i cant find zImage anywhere?Wondering what ever happened during the build,,,
command used: make -j4 ARCH=arm CROSS_COMPILE=/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- zImage
Build abruptly end, no build logs anything, see file for build output.
Is there anything that I am missing?, Please help!
And, Don't you think the build log is unusually small for a kernel build?? :O
Click to expand...
Click to collapse
Folks on the forum, any ideas, the open source code from samsung sure looks like it has built all the '.o's but abruptly stop without even a warning as to what is wrong? Please help. Thanks in advance!
androcton said:
Folks on the forum, any ideas, the open source code from samsung sure looks like it has built all the '.o's but abruptly stop without even a warning as to what is wrong? Please help. Thanks in advance!
Click to expand...
Click to collapse
Okay, I got the kernel to compile after getting rid of the
1. "error: 'SEGMENT_SIZE' undeclared" problem, I had to turn on the Make V=1 ( verbose mode) explicitly to get to this point.
2. Next the compilation stopped saying "make[3]: *** No rule to make target `net/ipv4/netfilter/ipt_ecn.o', needed by `net/ipv4/netfilter/built-in.o'."
I had to remove the netfilter support from the kernel. I REALLY did not know how to solve this problem. Now that I have built the zImage( really small compared to the zImage that gets posted around in the forum) I am now concentrating on how get netfilter back into the kernel, for it is an important module for anything to do with TCP/IP security n filtering.
Finally,
3. How do I package this to the phone as a complete bootable ROM? Please help! Thanks in advance!
I found this thread, it might be useful. I can't try it until later though.
http://forum.xda-developers.com/showthread.php?t=704561

[Q] Kernel source compiling for Xoom.

Hi I looked for sometime for answers but could not find anything relevant.
Looking to get the ftdi VCP drivers to install on Xoom. Which means I either have to compile a kernel or add them as a module. I can not for the life of me find the correct source tree.
I downloaded kernel 2.6.36.3 from google which matches my kernel version.
My kernel version on the tablet is 2.6.36.3-gb899258 .
When I cross compile the module and try to do an insmod its complaining about the magic version is different which leads me to believe that I have the wrong kernel.
Where can I get the right stock kernel?
If i can not find it there is another option to download the config.gz from the device and recompile another version of the kernel with native support for the ftdi drivers.. How do i just install just the kernel on the device? Is it a uImage bzImage and how do I just flash that?
cd
Thanks
edit:
scrap that ...
sorry, not really helpful in your case
I'm assuming you got your source from here? This is the link from the Android website:
git clone https://android.googlesource.com/kernel/tegra.git
If you decide to go the route of compiling another kernel source, the easiest way (and a good way to keep snapshots of various configs) would be to use Koush's AnyKernel to flash the kernel. I don't know anything about what you're trying to do but I hope that helps some.
Yep the code comes from there.....
I finally got it to work , I downloaded the stock kernel from google then when I make the modules I had to modify the Makefile to get it to match the kernel versions.
It seems to work for now...
Thanks for your help

[Q] Can't seem to build a custom kernel

I am trying to compile a custom kernel,
I succeed to build one but I can't boot him, when I load the kernel I go in to boot loop
I haven't made any real changes to this kernel I really just downloaded the source and compile it
The version match its a GB kernel 2.6.35.7 I disabled the lag fix, still it goes to boot loop.
any ideas?
What source code did you try to use to build this kernel? Links would be awesome.
Well I tried this two
Code:
github.com/Krylon360/SGS4G_Kernel_GB
opensource.samsung.com/index.jsp (SGH-T959V-TMB_GB_Opensource.zip)
I did
make clean && make mrproper
make vibrantplus_rev00_defconfig
make -j8
and then I loaded the kernel via heimdall
Building the stock kernel
I have run in to a similar problem. One issue I had to get past is the stock rom source does not have have the initramfs included. It is needed so the kernel can boot into a file system before it can start loading loadable modules and mount the rom filesystem.
I have been able to get an initramfs by extracting it from the original rom, The issue I have is it is loading all modules, but the rom devices will not mount as the /dev directory is empty and the mount needs them to mount the file systems.
This may be off topic for this forum. If you want to PM me, I'm willing to let you know what I have found out.
Tom
You should keep discussing it here since it does pertain to the phone and it'll be useful for future reference
Sent from my SGH-T959V using XDA App
Agree with FB.
I have ran into the same problem. I was unable to find a way to get it beyond boot loop so I scratched the project. I am definitely curious on how to get this working.
FBis251 said:
You should keep discussing it here since it does pertain to the phone and it'll be useful for future reference
Sent from my SGH-T959V using XDA App
Click to expand...
Click to collapse
DISCLAIMER
I am NOT a kernel developer, just a programmer that has done linux programming before, and is trying to understand and build the kernel.
I will share what I have found out through my attempts to build the stock rom as delivered from Samsung.
I have searched XDA and Googled the web in search of the answers I need with some success as well as dead ends. I am not looking to have the answers handed to me on a silver plate, but a few hints or links to point me in the right direction is helpful.
To start:
Recommended Hardware needed:
Search the XDA for AdamOutler threads on building the serial interface via the USB. Highly recommended reading as it helps to see what the kernel is doing when it is in the bootloop. All the important parts was purchased from his recommended supplier(s). Thanks AdamOutler for the information!
What I know about the samsung kernel source as delivered:
1) if you follow the readme in the kernel, it will build cleanly. However, it will NOT run, it will bootloop!!
2) If you intend to only build the stock kernel, I recommend making sure you are starting with a stock build installed on the phone. I suggest the same release version you are trying to build.
3) After you build the kernel and load it ( the zImage file is loaded via Heimdall ) the first problem I ran into was the initramfs. It is not included in the source and must be created from scratch or obtained from another kernel.
4) Once the initramfs is being built and included in the kernel, the next problem is the driver modules that are included, have to have the same version as the kernel. You will need to figure out the version by the kernel debug messages on the serial/usb interface mentioned above. Once the versions match, the kernel will load them.
This is where I am stopped... once the drivers are loaded, the init scripts mount the file systems. This does not happen with my kernel. I am still investigating this. I think it has to do with the /dev files for the mount points not being created/missing. I have not found the piece of info yet points me to the solution. Most of the links I have found pertain to linux on an x86/64 platform. I have found little on embedded linux and how it works.
That is all I have in a nutshell. Feel free to comment and ask questions. Remember to search! Use different forms of your search terms, use different working. I like to use the 'yippy.com' search engine as it places the results in categories.
Good luck!
Tom
logan123 said:
Well I tried this two
Code:
github.com/Krylon360/SGS4G_Kernel_GB
opensource.samsung.com/index.jsp (SGH-T959V-TMB_GB_Opensource.zip)
I did
make clean && make mrproper
make vibrantplus_rev00_defconfig
make -j8
and then I loaded the kernel via heimdall
Click to expand...
Click to collapse
Krylon's tree is stock, no changes.
It has all the problems I fixed in my tree.
I have a lot of uncommitted changes, but you can find my work at: https://github.com/bhundven/
Regardless of me being on xda or not, I am still working on sgs4g.
bhundven said:
Krylon's tree is stock, no changes.
It has all the problems I fixed in my tree.
I have a lot of uncommitted changes, but you can find my work at: https://github.com/bhundven/
Regardless of me being on xda or not, I am still working on sgs4g.
Click to expand...
Click to collapse
Aww hell bhundven! Refreshing to see you stop by!
Thank you everyone
mccabet, You actually saved me some time because those were my next two step
I was looking for the initramfs and I didn't find it...
Could you please share your?
I do not have my initramfs file available to me at work. So here is the info I used to get my copy. You will need an original rom release ( I used the heimdall one-click from bhundven ) to extract the zImage file from.
Here is the link to info on how extract your own initramfs from a kernel image (zImage):
http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
I used the improved script mentioned at the bottom of the page from:
https://github.com/mistadman/Extract-Kernel-Initramfs
After getting your initramfs, you will need to modify your vibrantplus_rev00_defconfig file and change the following parameter to point to your initramfs you extracted:
CONFIG_INITRAMFS_SOURCE="/path/to/initramfs"
Hope that helps.
Tom
Ok it seems like I was able to boot the kernel, no more boot loops thank to the initramfs but
The system isn't loading, it get stuck on the "Galaxy S 4G" page.
and when I load recovery it gives me lots of error so as
E:Can't mount /cache/recovery/log
E:failed to mount /cache (No such file or directory)
it goes on and on but its all the same...
logan123 said:
Ok it seems like I was able to boot the kernel, no more boot loops thank to the initramfs but
The system isn't loading, it get stuck on the "Galaxy S 4G" page.
and when I load recovery it gives me lots of error so as
E:Can't mount /cache/recovery/log
E:failed to mount /cache (No such file or directory)
it goes on and on but its all the same...
Click to expand...
Click to collapse
I may be off-base, but do you know if /cache and the other file systems were the Samsung rfs filesystem or the ext4 filesystem? Standard recovery can't mount ext4 & if your kernel doesn't support it, then it won't be able to mount them, either.
I thought so too so I removed the lag-fix and return to rfs
but this is neither because apparently there are no stl devices :\
I pulled out the recovery log
Code:
http://pastebin.com/hDCNbdne
Code:
failed to mount '/dev/block/stl11' '/cache'(rfs) -> No such device
Now I feel like an idiot because I can't seem to find what is it in the kernel config
moreover I tired to pull a config from a working kernel and I basically got the same errors
Any ideas?
Well the solution is simple, apparently version magic didn't load the kernel modules
for rfs_fat and fsr_stl...(you get the point)
now I can't to find way to compile them it seems as if someone removed them from the kernel tree and I can't load them either
I tired several modules from different kernel well all result in failure.
so any ideas?
logan123 said:
Well the solution is simple, apparently version magic didn't load the kernel modules
for rfs_fat and fsr_stl...(you get the point)
now I can't to find way to compile them it seems as if someone removed them from the kernel tree and I can't load them either
I tired several modules from different kernel well all result in failure.
so any ideas?
Click to expand...
Click to collapse
I wish had some, man. I've never compiled a kernel for Android. At least, not yet. However the moduel code should be somewhere in the kernel tree. I believe Android is a layer on top of the Linux kernel so the source may be there.
I'm still reading about and learning the platform side of Android. Hopefully one of the devs around can provide some solid guidance.
Ok no offence but this kernel is worthless
even if I load the modules into the kernel I get a errors because of the unknown symbols
bahh any ideas anyone?
stephen_w said:
I wish had some, man. I've never compiled a kernel for Android. At least, not yet. However the moduel code should be somewhere in the kernel tree. I believe Android is a layer on top of the Linux kernel so the source may be there.
I'm still reading about and learning the platform side of Android. Hopefully one of the devs around can provide some solid guidance.
Click to expand...
Click to collapse
That is as far as I have gotten. The drivers for the RFS ( drivers/tfsr ) are not loading and therefore the /dev mount points do not exist. The default build config flags ( CONFIG_RFS_FSR=m and CONFIG_RFS_FSR_STL=m ) are to build the module as a loadable module. I have tried to build the module with no success. Still investigating when I have the time. I was even thinking of looking at the Epic 4G MTD build and trying that. The problem there is if I can not solve this problem, I probably solve it by trying the MTD conversion. ( Except to brick it.)
if one of you kernel devs gets a bootable MTD kernel hit me up... I got a rom that needs some mtd loving
RaverX3X said:
if one of you kernel devs gets a bootable MTD kernel hit me up... I got a rom that needs some mtd loving
Click to expand...
Click to collapse
I do not claim to be a kernel developer. I am trying to understand and build the base kernel. If you can help me get past this, that would be great! I need to take baby steps before I can start walking. Once I get the build to work and boot completely, I'm game to go further, but have to get to a working base before we can continue. I understand the more experienced developers don't want to be bothered. I understand they have other jobs, and families. So do I. They became as great as they are, through hard work, experience and asking the right people the right questions. Asking the right question also applies to Google. The query only returns the matches to your query. Change a few words, get different results.
I'm not looking for someone to hold my hand, I want to learn by doing, not having it done for me. Just point be to the bread crumb trail, and I will follow.
Right now, I am at a stand still until I figure out why it is not loading the tfsr module. If that is even the problem.
If I make any progress, I'll post it here for all. If I am wrong, please correct me so we all don't go down the wrong path.
Thank you for listening.
Tom

[Q] Help needed porting CM11

Since development for the Sidekick 4G has stopped I decided to try and port the CM11 M10 snapshot from the Galaxy S 4G using this guide. I used the Galaxy S 4G as port ROM since most of the specs are the same as the SK4G. The base ROM I used is ayoteddy"s KJ2 Deodexed & rooted ROM. I followed the guide and flashed the ROM I made but the phone didn't boot. It stays stuck at the tmobile startup screen and then bootloops. I took a logcat and see a lot of errors but idk how to correct them. I tried uploading the ROMs I used and the one I created but it only let me upload the logcat.
Hey,
Its awesome to see some more effort in this phone but when porting a ROM one of the main prerequisites is the base being the same android version.
So to port cm11 over you would need a kitkat kernel and ROM for the sk4g already.
What would be real helpful is to get the gingerbread kernel fully functional then any GB ROM could be ported fairly easily.
Or start with a kitkat kernel but both require a bit of work. If you want to take it on a can link a bunch of guides that may help
Thanks for that info. I don't have experience coding but I would like to be able to learn how to cook and port roms so I would really appreciate some guides. As I understand it, since there is no KitKat ROM available for the sk4g I would first need to make my own KitKat kernel and ROM before I would be able to port cm11? And how long do you think it would take to learn everything needed to be able to port and cook roms?
Hey,
On mobile right now so can't post a bunch of links but xda is filled with them
The best place to start would be http://www.xda-university.com
And be sure to check out the forum links as well!
For a quick set of links see the seventh post in this thread
http://forum.xda-developers.com/showthread.php?t=2348266
For a different device but those are all great places to start learning to develop for android
Keep me posted on your progress!
Took me a while to find some useful guides since I was searching with the term "port" and not "build/compile from source" since that is essentially what I'm doing. I used wiki.cyanogenmod.org/w/Doc:_porting_intro and wiki.cyanogenmod.org/w/Build_for_galaxysmtd (can't post links yet). I forked the galaxys4g repo and modified the files to be suited for the sidekick4g. Now I'm onto the building step, a couple of things already broke and I managed to fix them, but I ran into this error and haven't been able to fix it.
brunch sidekick4"ebtables is disabled on this build"
find: `src': No such file or directory
build/core/base_rules.mk:134: *** system/extras/ext4_utils: MODULE.TARGET.EXECUTABLES.setup_fs already defined by device/samsung/sidekick4g. Stop.
I researched the MODULE.TARGET.EXECUTABLES.setup_fs already defined by device/samsung/sidekick4g issue and suggestions were to delete the setup_fs file within device/samsung/sidekick4g folder. However the setup_fs file wasn't in there, I did find a setup_fs.c file and deleted that one. Then I proceeded to try the build again and ran into the same error. Another suggestion was to use grep -R setup_fs *. This command pointed to these files,
Android.mk:LOCAL_SRC_FILES := setup_fs.c
Android.mk:LOCAL_MODULE := setup_fs
Android.mk~:LOCAL_SRC_FILES := setup_fs.c
Android.mk~:LOCAL_MODULE := setup_fs
initramfs/init.herring.rc:service setup_fs /system/bin/setup_fs /dev/block/platform/s3c-sdhci.0/by-name/userdata
sidekick4g.mk: setup_fs
But I don't know what exactly I'm supposed to delete. The device repo is located at github.com/SK4G/android_device_samsung_sidekick4g.git It is a pre-build attempt version before I made suggested changes to the local repo. I tried "git push origin master", the command went through and said everything is up to date but the remote repo still wasn't changed so I haven't been able to update it.
What are you using for the device tree? The relay is a completely different device and none of the drivers would work, did you at least pull blobs and proprietary files from a sk4g?
There is a ton of setup to be done in order to build from source, you can use the cm11 source but need to make a specific device tree for the sidekick to get a working build, not to mention a ton of kernel work will be needed
For the device tree I forked the galaxys4g repo (not the galaxy s relay 4g) and then modified the files to build the sidekick4g specific device tree. When pulling the blobs and proprietary files the guide said " Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly". Not sure if that's relevant to the errors but I was still able to pull the blobs towards the correct ~/android/system/vendor/samsung directory. As far as the kernel I downloaded the stock kernel from the samsung source website and then put it in the kernel/samsung/sidekick4g directory. The guide said that the kernel and kernel modules would be built automatically as long as I made appropritate changes to the BoardConfig.mk and I did so. I have done every step in the guide and now I'm into building but I can't get past the previously mentioned error. Should I delete the whole part of the files mentioned by the grep -R setup_fs * command or just the red part or is there another solution?
Well the blobs that were pulled and the kernel that was used was for froyo, that won't work for kitkat without a weeks worth of modification
Also the s4 is even more different than the relay and would be much harder to use anything from there
What you need at this point is to create your own device tree on github and add this to your local manifest, then the hard part is to adapt the sk4g kernel into something that will work with kitkat, once this steps are complete you can build and then fix the errors that come up, fixing any errors at this point won't help much as the files used are incompatible from the start
I should have been more specific, I used the T-Mobile Galaxy S 4G which is one the first galaxy phones. It has the same hummingbird chipset, architecture, ram/rom size, resolution, and both originally ran froyo. The guide states that the cm buildbots build a compatible kernel for me. I didn't just fork the galaxys4g repo and leave it as is. I went through the files and substituted anything that was galaxys4g device specific to fit the sidekick4g.
No problem, should have read more clearly, yes the galaxy s is very similar minus the keyboard but you can look at the work that was done to get a GB ROM booting here
http://forum.xda-developers.com/showthread.php?t=2323617
This was done on the exhibit, another very similar phone,
Even after the kernel was adapted the keyboard never worked, you check the link to his github to see what was put into it to work
The kernel built by the bot won't adapt it to work between different versions of android so you need to build this manually first then you can use it, but even then there will be a lot to do in order to get the keyboard working
Now I'm beginning to understand what you have been trying to tell me. It was hard to grasp at fist because I never really looked into building a kernel since I usually just use the stock kernel or the cm built in kernel on my devices. Now I shall redirect my efforts into building a kernel
Hi I just wanted to know if you're still building port for the sidekick 4G I still have mine and I would like to use if you have kitkat to work. I miss my sidekick 4G
Sent from my Nexus 6 using XDA Free mobile app

Categories

Resources