[Q] Help on Compiling a Custom Kernel for Better Security - Android Software/Hacking General [Developers Only]

Hi everyone,
This is my first time posting but I've hung around the forums for a while now. I've started a project to add more strict security controls to the Android platform. Sure, we have permissions that a user must accept in order to install an application, but that isn't enough.
A good place to start would be to enable some of the security functionality back into the Linux kernel (Linux security modules). I have been doing my homework and know what challenges need to be over come yet I am running into great difficulty just getting the kernel to compile the way I want.
Since security modules have been disabled in the kernel itself, the kernel needs to be re-configured and re-compiled with the features enabled. I am working with the Nexus S kernel source code directly from Google using git (specifically the kernel/samsung.git project). When I get it I use the make ARCH=arm herring_defconfig to generate the .config file. I have found out (the hard way) that if the .config file isn't set up correctly, the compilation errors are endless.
But anyway, once the .config file is generated, I want to go into and enable the configurations I need. I do so, save, and exit. As soon as I go to make the kernel and compile the entire thing, it overwrites my edited version of .config and compiles it the way it wants to.
Anyone now a way around this?
Edit:
Solved the problem. Found a way around it using a make ARCH=arm menuconfig. Should have known...

Related

Recompile and overwrite applications in system/app

As an experiment I am trying to rebuild some standard android applications and replace them in system/app on the G1. I have been through all the steps to get the source code and build for the dream platform and have built the various .apk files of interest (e.g. AlarmClock.apk, Browser.apk etc)
To put the files on the device I delete the old .apk and .odex files and copy my newly built .apk file on to the device. However when I try to run the application it crashes with the following message.
The application Alarm Clock (process com.android.alarmclock) has stopped unexpectedly. Please try again.
I know that replacing the applications like this is possible, because the AutoRotating Browser build works fine when copies over in this manner.
I'm using JF1.31 (RC8)
My initial reaction was that I was not signing the applications properly but having read some posts I think the default built .apk should have the right key already in it.
Another theory I have is that perhaps the applications from the head of the source tree are not compatible with the RC8 (or RC30) Android OS releases. Can anyone tell me how to get the source tree which corresponds to this baseline, I've done some reading around but cannot figure it out. I presume I need to do a repo init -u git://android.git.kernel.org/platofrm/manifest.git -b BASELINE but I can't figure out what BASELINE should be.
Many thanks in advance for any help you can give me!!!
There are some branches in android sources:
master
cupcake
release-1.0
Apps from the first two will not run on default G1, you need to reinstall a whole system. I think by default, following google docs you'll get master. So you need to download a release-1.0 sources.
I may be wrong, but that is what I'm see from my experience.
Thanks for that, I'll get the 1.0 branch downloaded and have a go with that.
Cheers for your help!
I was also trying to recompile some of the built-in apps, specifically the browser, but I can't even get it to build. I get a bunch of import errors, stating that it can't find some of the android libraries, such as android.net.http.AndroidHttpClient, android.os.AsyncTask, etc. I've got the android.jar from the SDK in my build path, and it finds some of them, such as android.webkit.URLUtil.
Can anyone shed some light on what I need to do to get it to see the missing libraries? Thanks.
UndeadCretin said:
Thanks for that, I'll get the 1.0 branch downloaded and have a go with that.
Cheers for your help!
Click to expand...
Click to collapse
There are around a dozen build breaks in release-1.0... all of them are due to missing header #includes in various .c and .h files. So, when it doesn't work, don't give up. Fix the breaks and everything will build properly.
Are you resigning the .apk files? Cuz you have to do that for them to work correctly.
Koush said:
There are around a dozen build breaks in release-1.0... all of them are due to missing header #includes in various .c and .h files. So, when it doesn't work, don't give up. Fix the breaks and everything will build properly.
Click to expand...
Click to collapse
Yep I fixed these problems but I have now hit upon the following problem:
(unknown): error 17: Field android.hardware.SensorManager.LIGHT_NO_MOON has changed value from 0.0010f to 0.001f
******************************
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.
******************************
I've been in and modified SensorManager back to 0.0010f and that let me build get further but I hit the same error again later in the build.
Given that release-1.0 should be a stable branch is it normal to get all these build issues?
Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Just tried building the AlarmClock application and running on the G1 and it works fine. Thanks everyone for your help!
>Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Can you write, what did you fix?
^ Agreed, let us know which files need modifying and what needs doing, i've been trying to get my release-1.0 build root working too!
Alternatively, UndeadCretin, could you build the firmware (release-1.0) with a modified framework-res i can send you?
Ok, I managed to compile it without any editing of xml.
Just added stdlib, string, vector headers to dozen of cpp/h.
worry said:
>Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Can you write, what did you fix?
Click to expand...
Click to collapse
To fix the java issue, I modified frameworks/base/core/java/android/hardware/SensorManager to change the LIGHT_NO_MOON value to 0.0010f (from 0.001f) and in out/target/common/obj/PACKAGING I modified the <field name="LIGHT_NO_MOON" to have value-"0.0010f">
After this there were several other c++ files which were missing relevant includes. I'm afraid I didn't keep a note of these so cannot provide much detail but mostly they were missing one of the following
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
I think one file needed the following include
#include <string>
and there were a couple of other files that needed other includes. The best way to find these is to google for the function name that isn't building and you should be able to find the appropriate include (that's how I did it).
Hope that helps a bit!
were you able to repo sync after adding the local_manifest.xml?
ximonx said:
were you able to repo sync after adding the local_manifest.xml?
Click to expand...
Click to collapse
I did try that previously but it didn't work. I don't think the relevant files for the dream build are available in the release-1.0 branch. This wasn't a problem for me since I'm only interested in building the applications which work fine with the generic build.
I would like to do the same for the mms application. Could you give me the steps or a link how to do it? I mean do I need the whole sources from android platform to do it? How can I just compile one application?
Phlogiston said:
I would like to do the same for the mms application. Could you give me the steps or a link how to do it? I mean do I need the whole sources from android platform to do it? How can I just compile one application?
Click to expand...
Click to collapse
I downloaded the whole Android source (the release-1.0 branch) and compiled the lot. It may be possible to just build the individual application but I do not know how. It is not vital to build for the dream platform if you only care about the applications since they will work fine with the generic build.
So the basic steps to start are:
Get yourself a Linux or Mac OS platform (I use Ubuntu running in VMWare on my XP box).
Follow the instructions here: http://source.android.com/download but when you come to repo init add the flag -b release-1.0
Fix various build problems
When recompiling individual apps to replace system apps is there a way of just building a single application or does the entire thing need making?
ximonx said:
When recompiling individual apps to replace system apps is there a way of just building a single application or does the entire thing need making?
Click to expand...
Click to collapse
My experience is that you have to do the whole thing if you are building from source. There is one way I know of to get around this, which is to use baksmali and smali.
Just to be clear, making the entire thing = build from source root?
ximonx said:
Just to be clear, making the entire thing = build from source root?
Click to expand...
Click to collapse
If you are asking me--yes, that's what I mean. Make sure to build for dream-open as the target (it's generic by default).

Android Native Linux compiling

I'm not sure if this is the right forum, but XDA is really the only place I can figure to ask.
I've been looking for a way to compile linux applications to run on the command line, for instance nano or lynx. I've found the "agcc hello.c -o hello
" method, but the builds I'm trying for are defendant on ./configure.
I've got a working toolchain, and can even compile android itself, and I've got agcc working. I just can't figure out how to get them all working together.
Any help?
In the ./configure, you need to point it to your compiler (i.e. "agcc").
Try "./configure --help" to see the options it is looking for to make this configuration.
I think you have to set up an arm-eabi cross compiler.
You can try the android native development kit:
http://developer.android.com/sdk/ndk/1.5_r1/index.html
I think this is designed to make native components for the normal dalvik android apps, but it may have useful information.
maxisma said:
I think you have to set up an arm-eabi cross compiler.
Click to expand...
Click to collapse
He did.... agcc is a script that runs it.
RoboPhred said:
You can try the android native development kit:
http://developer.android.com/sdk/ndk/1.5_r1/index.html
I think this is designed to make native components for the normal dalvik android apps, but it may have useful information.
Click to expand...
Click to collapse
NDK creates libraries that can be called from within native apps (i.e. shared objects). It does not create native executables.
This should help?
http://forum.xda-developers.com/showthread.php?t=431329
I've made a wee bit of progress.
My current set up is this:
Step 1: Download this
Step 2: Push it to /system/sd/usr
Step 3: Remount system AND root partitions, then symlink /system/sd/usr to /usr. Then, mkdir /tmp.
Step 4: Push sources to /system/sd. Change working directory to your extracted source file, then run ./configure --host=armv6l-unknown-linux-gnueabi --with-build-cc=/bin/gcc
Step 5: ????
Step 6: Profit
I'm still working out the bugs here, and I'll report back when I've got something working. Currently, I'm trying to compile GNU Make for Android.
check the apps section i think i rememeber somone already compiling nano for android...
i wanted to compile sshfs but then again there is a lot of things i wanna do... LOL

[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][DEV] Kernel modules loading at boot-time : which framework ?

Hi,
Usually on linux, there is a kernel loading modules at boot-time framework, cf. modules.conf.
No longer present in android.
When typing lsmod, there is two modules loaded by default : tntfs, and bcm4329 (and voodoo_sound
if you have it).
I'm trying to figure out what is the standard procedure on android : I've noticed on the
init.rc that the tntfs.ko is loaded, but can't figure out when bcm4329.ko is loaded.
Any idea ?
Moreover, I know that voodoo controller is able to load his own kernel module (voodoo-sound)
at boot-time. Anyone knows how the voodoo dev did that ?
My current idea is to modify init.rc to source a new file - let's say init.rc.local - to keep my custom mod. It'll
allow minimal changes when updating+root : just copy the init.rc.local and change the init.rc...
Sounds like we're recreating linux boot framework. lol.
This is something I've done on the HTC Incredible and the Droid 1 in the past, but in honeycomb, this is different, not very obvious yet:
Rather than try to emulate whatever Redhat or Ubuntu has done, which usually doesn't work, I either would use the line where tntfs.ko is insmod'd in /init.ventana.rc (sorry, think that's the filename), and add in the modules you want to add right there. Make sure to save the original file so you'll have a shot at fixing it if you make a mess.
The other thing is just to find some developer that appears to know what they're doing, and download their ROM, like Roach. I just downloaded his prime 1.6 ROM and unpacked it, then noticed immediately that he's got this in there:
/system/etc/init.d/01init{stuff},
Well that seems pretty important, so I did a grep 'init.d' * -R from the / level, and could only see little of importance, not any shell file like initrc pointing to it, just that busybox is linked to it, etc.
I figured it's worth a shot to create the same file structure on the stock ROM (/system/etc/init.d/0X{name} and see if it executes :: Start it with the usual #!/system/bin/sh
# load some modules
/system/bin/inmod /system/lib/modules/cifs.ko (or whatever)
and see what happened, if anything.
Better yet, I'd just send a message to Roach or some other ROM developer and ask.
Good luck -
altsyst said:
Hi,
Usually on linux, there is a kernel loading modules at boot-time framework, cf. modules.conf.
No longer present in android.
When typing lsmod, there is two modules loaded by default : tntfs, and bcm4329 (and voodoo_sound
if you have it).
I'm trying to figure out what is the standard procedure on android : I've noticed on the
init.rc that the tntfs.ko is loaded, but can't figure out when bcm4329.ko is loaded.
Any idea ?
Moreover, I know that voodoo controller is able to load his own kernel module (voodoo-sound)
at boot-time. Anyone knows how the voodoo dev did that ?
My current idea is to modify init.rc to source a new file - let's say init.rc.local - to keep my custom mod. It'll
allow minimal changes when updating+root : just copy the init.rc.local and change the init.rc...
Sounds like we're recreating linux boot framework. lol.
Click to expand...
Click to collapse
Tested.
Does not work, because modified room probably calling busybox run-parts.
Anyway I've found a hack, I'm posting it on general section.

Got kexec-mod, kexec-tools working, atags in progress - Should Also Work With DroidX

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.

Categories

Resources