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

Search This thread

ilikenwf

Senior Member
Oct 30, 2009
193
61
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!
 
Last edited:

ilikenwf

Senior Member
Oct 30, 2009
193
61
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 :p
 
Last edited:

ilikenwf

Senior Member
Oct 30, 2009
193
61
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?

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.
 

ilikenwf

Senior Member
Oct 30, 2009
193
61
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.
 

ilikenwf

Senior Member
Oct 30, 2009
193
61
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.
 

rahul.amu2

New member
Aug 17, 2008
1
0
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.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    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!