[Android Software/Hacking General [Developers Only]] bone101:
This is how it work by me by trying to flash the rom from 26.6. on http://quarx2k.ru/cm10.1-nightly-defy+/2.6.32/

ROOT= /cygdrive/f/Motorola Defy/PDriod/ApGPackages/ap

TOOL= /cygdrive/f/Motorola Defy/PDriod/ApGPackages/ap/patch_tools.tgz

ROM= /cygdrive/f/Motorola Defy/PDriod/cm-10.1-20130626-NIGHTLY-mb526.zip

ROMX= F:\MOTORO~1\PDriod\CM-101~1.ZIP

Updater: disabled

You will not be able to get automatic updates because we could not find 'git'.

Find out how to install git for your system and that feature should work automatically

### verify tools ###

/cygdrive/f/Motorola Defy/PDriod/ApGPackages/cygwin/bin/patch

/cygdrive/f/Motorola Defy/PDriod/ApGPackages/cygwin/bin/tar

/cygdrive/f/Motorola Defy/PDriod/ApGPackages/Java/bin/jar

/cygdrive/f/Motorola Defy/PDriod/ApGPackages/Java/bin/java

/cygdrive/f/Motorola Defy/PDriod/ApGPackages/cygwin/bin/cpio

### verify ROM ###

### running ./auto_patcher /cygdrive/f/Motorola Defy/PDriod/cm-10.1-20130626-NIGHTLY-mb526.zip openpdroid

PATH= /cygdrive/f/Motorola Defy/PDriod/ApGPackages/ap/tmp20130701192820:/cygdrive/f/Motorola Defy/PDriod/ApGPackages/Java/bin:/cygdrive/f/Motorola Defy/PDriod/ApGPackages/cygwin/bin:/cygdrive/f/Motorola Defy/PDriod/ApGPackages/cygwin/usr/sbin

### unzip patch tools ###

### unzip patch patches ###

... result of ROM check: RIL= MotoWrigley3GRIL

### probe rom type ###

#### Standard Build Query ####

# VER= v2.9.895

# OS= cygwin 32bit

# VID= 4.2.2

# PID= openpdroid

# MID= cm_mb526-userdebug

# RID= cm

# ANDR= 4.2

# BDID= 20130626

# DID= mb526

# BID= 20130626

Patches are openpdroid/4.2/cm/20130626

Current HEAD: 53b4e42d056eebbd87e4f6b2dfd7bf913bb2ac55 versioning

### DELETE FILES=

### COPY FILES= system/media/PDroid.jpeg

### JAR FILES= system/framework/framework.jar system/framework/core.jar system/framework/services.jar system/framework/telephony-common.jar

### APK FILES= system/app/Mms.apk

### IMG FILES=

### TXT FILES=

### unzip rom ###

### create updater script ###

... using Clockworkmod installer ...

# generated updater-script

ui_print("");

ui_print("");

ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

ui_print("* *");

ui_print("* * The Auto-Patcher * *");

ui_print("* * * * * *");

ui_print("* * by mateor * *");

ui_print("* *");

ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

ui_print("");

ui_print(" Attention");

ui_print(" ************************************");

ui_print("");

ui_print(" There is nothing that can go wrong here");

ui_print(" that reflashing your ROM won't fix.");

ui_print("");

mount("ext3", "EMMC", "/dev/block/mmcblk1p21", "/system");

package_extract_dir("system", "/system");

set_perm_recursive(0, 0, 0755, 0644, "/system");

set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");

set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");

set_perm(0, 3003, 02750, "/system/bin/netcfg");

set_perm(0, 3004, 02755, "/system/bin/ping");

set_perm(0, 2000, 06750, "/system/bin/run-as");

set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");

set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");

set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");

set_perm(0, 0, 0755, "/system/etc/init.d");

set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");

set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");

set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");

set_perm(0, 0, 0644, "/system/vendor/etc/audio_effects.conf");

set_perm(0, 0, 0644, "/system/vendor/lib/libbt-vendor.so");

set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");

set_perm(0, 0, 06755, "/system/xbin/librank");

set_perm(0, 0, 06755, "/system/xbin/procmem");

set_perm(0, 0, 06755, "/system/xbin/procrank");

set_perm(0, 0, 06755, "/system/xbin/su");

set_perm_recursive(0, 0, 0755, 0555, "/system/etc/init.d");

set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");

set_perm_recursive(0, 0, 0755, 0664, "/system/bootmenu/config");

set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/binary");

set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/script");

set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/recovery/sbin");

set_perm(0, 0, 0755, "/system/etc/motorola/comm_drv/commdrv_fs.sh");

unmount("/system");

ui_print(" .");

ui_print(" .");

ui_print(" done!");

### create restore.zip ###

### decompile system files ###

... decompile framework.jar ...

... extract preloaded-classes ...

\vergr�t: preloaded-classes

... decompile core.jar ...

... decompile services.jar ...

... decompile telephony-common.jar ...

\vergr�t: system/framework/framework-res.apk

... installing framework files ...

... decompile Mms.apk ...

I: Baksmaling...

I: Loading resource table...

I: Loaded.

I: Decoding AndroidManifest.xml with resources...

I: Loading resource table from file: C:\Users\Bone\apktool\framework\1.apk

I: Loaded.

I: Regular manifest package...

I: Decoding file-resources...

I: Decoding values */* XMLs...

I: Done.

I: Copying assets and libs...

### copy patch openpdroid/4.2/cm/20130626 ###

... copying system/media/PDroid.jpeg ...

... overwriting system/media/PDroid.jpeg from openpdroid ...

`patches/openpdroid/4.2/cm/20130626/system/media/PDroid.jpeg' -> `./system/media/PDroid.jpeg'

... overwriting ContentResolver.smali ...

### delete patch openpdroid/4.2/cm/20130626 ###

### jar patch openpdroid/4.2/cm/20130626 ###

... apply framework.patch ...

... apply preloaded.patch ...

GARBAGE=

GARBAGE=

... apply core.patch ...

GARBAGE=

GARBAGE=

... apply services.patch ...

... apply services-gps_fix.patch ...

GARBAGE= tmp/system/framework/services.jar.out/smali/com/android/server/am/BroadcastQueue.smali.orig tmp/system/framework/services.jar.out/smali/com/android/server/ServerThread.smali.orig

GARBAGE= tmp/system/framework/services.jar.out/smali/com/android/server/ServerThread.smali.rej

... apply telephony-common.patch ...

1 out of 78 hunks FAILED -- saving rejects to file smali/com/android/internal/telephony/cdma/CdmaServiceStateTracker.smali.rej

Reversed (or previously applied) patch detected! Skipping patch.

15 out of 15 hunks ignored -- saving rejects to file 'smali/com/android/internal/telephony/RIL$RILSender.smali.rej'

!!! PATCHING FAILED FOR com/android/internal/telephony/cdma/CdmaServiceStateTracker.smali !!!

!!! patch error for com/android/internal/telephony/cdma/CdmaServiceStateTracker.smali !!!

File for which patching failed:

---------------------------------------------

CdmaServiceStateTracker.smali

---------------------------------------------

We are adding a pre-patched copy of those files.

Please only file a bug report if running the program gives you problems!!!

... replace com/android/internal/telephony/cdma/CdmaServiceStateTracker.smali ...

`patches/openpdroid/4.2/.provisionals/system/framework/telephony-common.jar.out/smali/com/android/internal/telephony/cdma/CdmaServiceStateTracker.smali' -> `tmp/system/framework/telephony-common.jar.out/smali/com/android/internal/telephony/cdma/CdmaServiceStateTracker.smali'

... failed patch sucessfully resolved ...

GARBAGE=

GARBAGE= tmp/system/framework/telephony-common.jar.out/smali/com/android/internal/telephony/RIL$RILSender.smali.rej

### apk patch openpdroid/4.2/cm/20130626 ###

... apply Mms.apk.patch ...

GARBAGE=

GARBAGE=

### img patch openpdroid/4.2/cm/20130626 ###

### text patch openpdroid/4.2/cm/20130626 ###

### rebuild jar ###

... rebuild framework.jar ...

classes.dex wird hinzugef�n = 8349772) (aus = 3370521)(59 % verkleinert)

preloaded-classes wird hinzugef�n = 96019) (aus = 16111)(83 % verkleinert)

... rebuild core.jar ...

classes.dex wird hinzugef�n = 2565476) (aus = 1073136)(58 % verkleinert)

... rebuild services.jar ...

tmp\system\framework\services.jar.out\smali\com\android\server\ServerThread.smali[929,19] Label "cond_344" is not defined.

tmp\system\framework\services.jar.out\smali\com\android\server\ServerThread.smali[1031,16] Label "cond_387" is not defined.

tmp\system\framework\services.jar.out\smali\com\android\server\ServerThread.smali[1036,4] mismatched tree node: I_STATEMENT_FORMAT21c_STRING expecting I_CATCHES

tmp\system\framework\services.jar.out\smali\com\android\server\ServerThread.smali[1040,4] mismatched tree node: I_STATEMENT_FORMAT21c expecting I_FIELDS

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!! error: failed compiling services.jar !!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!! This error is generally due to an unknown bug in the smali binary!

Late i read that quarx rom are not supported )-: