[Motorola Droid RAZR] Hashcode:
** WARNING: THIS THREAD SHOULD BE FOR KERNEL DEVELOPERS OR ROM DEVS.

Users please post questions in your ROM's support threads. **

** DEVS: If you choose to use a kexec kernel in your ROM add a "KERNEL CREDIT" for the first 4 people in the "WHO HAS WORKED ON THIS?" section below. This has been spectacular development and credit is due. **

TESTING ROMS FOR KEXEC KERNEL PROGRESS:

Droid RAZR:

[2013-03-12] cm-10.1 on v3.0.8 JB kernel: http://goo.im/devs/Hashcode/spyder/cm10.1/KEXEC-cm-10.1-20130312-UNOFFICIAL-spyder.zip

GSM RAZR:

cm-10.1 on v3.0.8: http://goo.im/devs/Hashcode/umts_spyder/cm10.1/KEXEC-cm-10.1-20130308-UNOFFICIAL-umts_spyder.zip

MAPPHONE 3.0.x KEXEC KERNEL:

For use on Motorola devices; Droid RAZR, GSM RAZR, RAZR MAXX, Bionic and Droid 4. (1 GB OMAP4 devices for now, 512MB support coming).

WHAT IS A KERNEL?

Also from Wikipedia: http://en.wikipedia.org/wiki/Kernel_%28computing%29

Summary: If you had to choose 1 binary file which connects the hardware components of your device to the OS layer whether it be Android or some other software, it would be the kernel.

WHAT IS KEXEC?

The best description is found here on Wikipedia: http://en.wikipedia.org/wiki/Kexec

Summary: kexec is a process for hot reloading a new kernel while a device is running.

WHERE DID THIS KERNEL COME FROM?

Initially the source came from Motorola. All GPL components of Android are posted on Sourceforge.net for Motorola devices:

http://sourceforge.net/motorola/

After that it's been worked on (see below) to support kexec function and work for our needs.

WHO HAS WORKED ON THIS?

Several people played a large role in making this happen:

Kholk & [MBM]: Initial development work done on the RAZR/Bionic under Gingerbread to setup kexec modules + booting kexec kernel (no 2nd cpu)

jonpry: Ported and improved Kholk/MBM's work for use on the Droid 3. Brought up 2nd CPU, fixes for audio and more.

Hashcode (myself): On going development of this kernel for flawless function on our devices.

A full kernel source history on github starting with omapzoom sources and migrating Motorola source in commit by commit

Fixes for clocks, local timers, GPMC setup, race conditions in irq's due to kexec and more.

On going development towards full support for current Android / Ubuntu Phone OS requirements (including 512MB and Droid 3 support).

Other's have also contributed code (and hopefully more will as well): kfazz(D4), jarveson(D3) and more.

WHERE IS THE SOURCE?

KERNEL SOURCES (ALL DEVICES):

https://github.com/STS-Dev-Team/kernel_mapphone_kexec

BRANCH: stock-ics-kexec

DESCRIPTION: This is a perfect copy of the ICS kernel running as kexec. For use with stock-based ROM's etc.

STATUS: Ready for use

BRANCH: jb-mr1

DESCRIPTION: Ongoing kernel branch for support of newer Android OS (Jellybean MR1 currently).

STATUS: Work-in-progress. Heavy development

KEXEC KERNEL-MODULE SOURCES FOR ICS/JB BASED DEVICES:

https://github.com/STS-Dev-Team/kernel_kexec_modules/tree/3.0.8-ics-spyder

Branch: 3.0.8-ics-spyder

Defconfig: mapphone_kexec_defconfig

KEXEC KERNEL-MODULE SOURCES FOR GB BASED DEVICES (Droid 3):

https://github.com/STS-Dev-Team/kernel_kexec_modules/tree/2.6.35-solana/

Branch: 2.6.35-solana

Defconfig: mapphone_defconfig

HOW TO KEXEC A DEVICE

1. Download kexec kernel modules + kexec binary for your base kernel version

(Most devices found here):

https://github.com/STS-Dev-Team/android_device_motorola_omap4-kexec-common/tree/cm-10.1/kexec

(Droid 3 Users need GB based modules here):

https://github.com/STS-Dev-Team/android_device_motorola_solana/tree/jb-mr1/kexec

2. Download the devtree for your device:

Droid RAZR: https://github.com/STS-Dev-Team/android_device_motorola_spyder/tree/jb-mr1/kexec

GSM RAZR: https://github.com/STS-Dev-Team/android_device_motorola_umts_spyder/tree/jb-mr1/kexec

Bionic: https://github.com/STS-Dev-Team/android_device_motorola_targa/tree/jb-mr1/kexec

Droid 4: https://github.com/STS-Dev-Team/android_device_motorola_maserati/tree/jb-mr1/kexec

Droid 3: Droid 4: https://github.com/STS-Dev-Team/android_device_motorola_solana/tree/jb-mr1/kexec

3. Need a kexec kernel binary from the above sources: renamed the zImage as "kernel".

4. Need a .gz cpio ramdisk named: ramdisk.img

**RAMDISK needs to take care of mounting related filesystems for your ROM.

Ususally Safestrap/BMM handles this in some way for rom-slots.

For easy kexec tests you can build a CWM ramdisk and use that.

Now boot up into a safe kexec point on the device be it BMM or Safestrap where you can use adb.

5. Move all of the above files onto the rootfs

6. Execute the following as a script:

# run this from a "safe" boot point (safestrap / bootmanager) where no mounts are active
cd /
chmod 755 /kexec
# you will lose USB function here till the new kernel boots -- hence the script
insmod /uart.ko
insmod /arm_kexec.ko
insmod /kexec.ko
/kexec -l /kernel --devtree=/devtree --ramdisk=/ramdisk.img
sleep 1
/kexec -e

CURRENT DEVELOPMENT ROAD MAP

Merge up to Linux Mainline v3.0.21 + Google kernel/common commits (where applicable)

Cherry-pick from TI's kernel tag 4AI.1.5 to 4.AI.1.6

Merge up to Linux Mainline v3.0.31 + Google kernel/common commits (where applicable)

Cherry-pick from TI's kernel tag 4AI.1.6 to 4.AI.1.7

Also pick up any p-android-omap-3.0 and p-android-omap-3.0-dev commits where needed

Merge up to current Linux Mainline + Google kernel/common commits (where applicable)