[GUIDE][FAQ][Android 4.4 KitKat] Installing & Customizing CM11 or SlimKat

Search This thread

_ck_

Senior Member
Defy is my "daily driver" with CM7 but since this guide was posted in May I am very tempted to try CM11 as performance is lagging compared to the dual core 1.2ghz phones I've tried.

How has stability faired since then? Hoping all my apps can just backup and restore and still run.
 

crizolli

Senior Member
Sep 2, 2011
196
29
Boston
Thanks for the amazing guide.

I found my Defy hanging in a drawer this weekend and it was still running CM7.

Thanks to your guide I've updated it to SlimKat and I'm happy to say that performance is pretty solid so far.
 

jadrake

Member
Aug 31, 2007
12
0
Resize partition?

Hi,

I've followed the instructions to the letter, and when I get to installing CM11 I get:
Please resize partition before installing CM11
Then it fails to install.

Any ideas?
 
Hi! In my first post, I wanted to share with you the best settings I found myself testing the Defy.

Kernel Settings, for stable, no-reboots, daily use.
I changed parameters with Kernel Adiutor App.
Build version tested: cm11-20151129-Nightly-mb52x

CPU Governor: Interactive, 300-1000mhz cpu freq. (default nightly).
I/O Scheduler: Internal Storage: SIO - Read Ahead 128k (deadline seems very unstable to me).
External Storage: Same settings.

Kernel Samepage Merging: KSM: Enable

Low Memory Killer: Medium Settings

Virtual Memory: Swappiness=0
Z-RAM=30 mb

More than three days that it is running smoothly without sudden reboots.

Please share your results!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 58
    This guide explains how to install and update CyanogenMod 11 (CM11) and SlimKat roms (aftermarket firmwares of Android 4.4) on your Motorola Defy (MB525) or Defy+ (MB526). Neither the CyanogenMod development team nor the Slim Roms development team officially support the Defy. Thankfully, a number of independent developers (listed below) are working hard to port those roms to the Defy, and the present versions are mostly (but not completely) bug-free and stable.

    Please note: The latest CM11 and SlimKat roms for the Defy still have a few bugs, most of which are explained in a bug list that is frequently updated by okij. Although okij's bug list concerns the CM11 roms built by Quarx, most of these bugs also apply to TJKV's SlimKat roms, which are based partly on Quarx's sources.

    If you just want a perfectly stable, bug-free phone, and don't care about having the latest and coolest features of Android, CM11 and SlimKat are not for you. I recommend installing CyanogenMod 7 (CM7) instead: it's very fast and perfectly stable. However, CM11 and SlimKat are continually becoming more stable, and are already usable as daily drivers if you can live with the few remaining bugs.

    How to install Android 4.4 SlimKat or CM11 on the Motorola Defy or Defy+

    Step 1: Download the correct files for installation.
    • If installing SlimKat, download the rom (Slim-mb526-4.4.2.build.4-UNOFFICIAL-20140407-2344.zip) and Google Apps package (minimal_Slim_AIO_gapps.4.4.2.build.4.zip) here.
    • If installing CM11, download the rom here (or here) and the minimal Google Apps package here (or here or here). (You want the file called "GApps_Minimal_4.4.4_signed.zip". Do NOT try to install the "Standard" Google Apps package, as there is not enough room on the Defy's system partition.)

    Customize the rom file if desired. (See "Tips for customizing & improving performance," below.) Then put both files on your phone's SD card. Also download defy_twrp_recovery_2.6.3.0.zip and safewipe.zip, and put those files on the SD card too.

    Note: SlimKat build 4 is very stable, but it does have a bug that causes the phone to reboot into recovery mode automatically if the phone encounters a telephony error, instead of rebooting normally. To fix this issue, download DefyParts.apk here and replace the old DefyParts.apk by following the instructions in this post.​

    Step 2: Install Team Win Recovery (TWRP) version 2.6.3.0 (or newer).
    • If you have already installed a custom recovery on your phone (e.g. ClockWorkMod or an earlier version of TWRP) and you know how to use it, just flash defy_twrp_recovery_2.6.3.0.zip and proceed to step 3. If you've never used a custom recovery, keep reading.
    • If you're using a stock rom from Motorola, you first need to root the phone (I recommend using either Framaroot or SuperOneClick), then install 2ndInit. Run the 2ndInit app and use it to install the custom recovery (ClockworkMod Recovery). Then reboot the phone, and watch the small LED light at the top of your phone. If the recovery was installed properly, the LED will light up with a blue color for a few seconds during startup. Allow the phone to fully boot up, then reboot the phone again and watch for the blue light. As soon as you see the blue light, press the volume down button to enter the bootmenu. Use the volume buttons to navigate the menu and the power button to select an option. Select Recovery > Custom Recovery > Backup and restore > Backup (all), and wait for the backup process to complete. This will create a backup of your system on your SD card, so you can revert to the stock rom later if needed. Next, select Go Back > install zip from sdcard > choose zip from sdcard, and install defy_twrp_recovery_2.6.3.0.zip.
    Step 3: Install CM11 or SlimKat, and the corresponding Google Apps package.
    • After installing TWRP 2.6.3.0, reboot the phone and enter the bootmenu again by pressing the volume down button when you see the blue LED. (Note: If you're updating from a recent version of SlimKat or CM11, you won't see any blue light. Instead you'll see a screen that tells you to either press the menu button to enter recovery or the search button to continue with normal bootup.)
    • Enter TeamWin Recovery, which you can navigate with the touchscreen rather than the volume buttons. Wait 30 seconds before proceeding, to make sure the recovery is behaving in a stable way. (If the phone spontaneously reboots, just try again.)
    • Select Install, choose safewipe.zip, then swipe to confirm the flash.
    • In the same way, flash the rom of your choice (either SlimKat or CM11), followed by the Google Apps package.
    • Reboot the phone. The first boot will take a while (typically 5-10 minutes), since the phone has to build the Dalvik Cache.
    Step 4: Set the correct baseband, and adjust performance settings.
    Go to System settings > Advanced options > Device > Baseband selection, and make sure that the correct baseband is selected for your region and carrier. (Note: This step is not necessary if you already changed the default baseband in the zip file. See "Tips for customizing & improving performance," below.)

    I also strongly recommend configuring the rom for better performance, by following the tips listed below. (See especially the tips about using Aero Kernel Control. This will help with many problems, for example the infamous call wakeup delay issue.)

    Step 5: Thank our awesome developers, and donate to them if you can.

    You can find donation links under any post by the developers. (Just look for the button that says "donate to me.") Here's the donation link for Quarx.

    How to update SlimKat or CM11 to newer versions (or downgrade to older versions)

    Step 1: Backup your current rom, apps, and settings.
    • I recommend using Online Nandroid Backup to create TWRP-compatible backups, for the reasons mentioned here (see bug #36). In the Online Nandroid Backup app, select Custom Backup > Backup Type > TWRP. Then select Backup Mode > Selective, and select the "system" and "data" partitions to backup. Make sure the Save Location is set to /sdcard, and also check the box to "Exclude Dalvik Cache." Then press the blue arrow (looks like a "play" button) at the top right corner of the screen to begin the backup.
    • Also back up your apps and settings with Titanium Backup.
    Step 2: Download the updated rom.

    Customize the rom file if desired. (See "Tips for customizing & improving performance," below.) Then place it on your phone's SD card along with the appropriate Google Apps package. [Note: if using CM updater, you don't have to download the rom ahead of time.]

    Step 3: Install the updated rom using one of the following three methods:
    Note: If switching from SlimKat to CM11 or vice versa, you must use the clean install method.
    • "Clean" install (recommended)
      - Boot into TWRP by pressing the menu button when you see the bootstrap image (the screen that tells you to either press the menu button to enter recovery or the search button to continue with normal bootup), which should appear just after the Motorola logo disappears and before the boot animation begins.
      - Select "Install" and flash safewipe.zip, then flash the updated rom, followed by Google Apps.
      - After rebooting the phone, you'll have to restore your apps and settings using Titanium Backup. Don't restore settings for system apps unless necessary, as that may lead to problems.
    • "Dirty" flash (easier, but may cause problems)
      - Boot into TWRP and select Wipe > Advanced Wipe, and select Dalvik Cache, Cache, and System (not Data), then swipe to wipe. (WARNING: Wiping the system partition also deletes the custom recovery, so you must either flash a rom or restore a backup before rebooting the phone. If the phone is rebooted before a new system is installed, it will be "soft bricked" and you'll have to flash a stock sbf with RSD Lite to recover it.) Then press the back button to return to the main menu and select Install. Flash the updated rom, followed by Google Apps. Now it is safe to reboot the phone.
      - Since this method does not affect the /data partition, you won't have to restore all of your apps and settings, but you may still need to switch the baseband. If you encounter any bugs or problems after updating the firmware by this method, do not report them. First try a "clean" install, and check whether that solves the issue.
    • CM updater method (easiest, but may cause problems)
      - If you're using CM11, you can update via the built-in CM updater located under Settings > About Phone > CyanogenMod Updates. (Obviously this won't work on SlimKat.)
      - If you encounter any bugs or problems after updating the firmware by this method, do not report them. First try a "clean" install, and check whether that solves the issue.

    Tips for customizing & improving performance

    How to customize the rom before installation:
    Install 7-zip on your PC.

    Right-click on the CM11 or SlimKat zip file and select 7-zip > Open archive. (Don't extract it; just open it.) Now you can:
    • Remove unnecessary files to save space on the system partition. For example, you can navigate to system > media > audio, and delete any ringtones you don't use. You can also delete unused apps from system > app. See @x53's post here for a list of system apps that are safe to remove; see also here and here for more info. Here's a list of system apps that I removed before installing SlimKat: BasicDreams (live wallpaper), Browser (I use Next Browser instead), Calendar, Dashclock, Deskclock, Email (I just use Gmail app), Exchange2, Gallery2, Livewallpaperspicker, PhaseBeam (live wallpaper), PhotoTable, PicoTTS, Slimcenter, SlimFileManager, SlimIRC, SoundRecorder, VisualizationWallpapers.
    • Replace the default bootanimation in system > media. (Just drag and drop your custom bootanimation to replace the original.)
    • Replace the default bootstrap image in system > bootstrap > images.
    • Change the default baseband. To do this, navigate to system > etc > motorola > basebands, and find the zip file that corresponds to your region and carrier. Drag that file out to a folder on your PC, and extract (unzip) it. Then drag and drop those extracted baseband files into system > etc > motorola > bp_nvm_default, replacing the default baseband files in the rom.
    • Edit build properties. To do this, find the build.prop file in the system directory, and drag it out to a folder on your PC. Open the file in Notepad++, and edit the build properties as desired. (For example, you can change the LCD screen density by editing the line that says "ro.sf.lcd_density=". The default density in CM11 is 240, and the default in SlimKat is 213. Larger numbers make icons appear larger on your screen.) After making any desired changes, save the file and drag it back into the rom zip file where you found it, replacing the original.
    After installation, configure the rom for better performance:
    • Install Aero Kernel Control from the Google Play store, which will allow you to tweak many settings to improve the performance of your phone. For starters, I recommend the following: In the Aero Control app, go to CPU Performance > Governor Settings, and select “ondemand”. The default is Interactive governor, which may be able to deliver slightly better performance if you know how to tweak its settings, but its default settings aren’t very good, so I recommend using On Demand at least initially.
      If you want to try using Interactive governor, I recommend the following settings: open Aero Kernel Control, go to CPU Performance, select Interactive governor, then tap the little phone icon at the top right corner of the screen to open the settings for the Interactive governor. Set suspend_enabled to 0. That should help to reduce the call wakeup delay. Changing hispeed_freq and input_boost_freq to your maximum value (e.g. 1200000 if you've overclocked to 1200 MHz) will also boost performance, though you may see a slight drop in battery life. Note: Interactive governor is not recommended for CM11 builds prior to the 06-10 nightly, because the suspend/resume handler was missing. (See okij's note on bug #26 for more info.)​
    • Open the HWA Settings app (which is already installed as part of the rom) and disable HWA for all apps except ones that really need it. (Explanation: HWA requires more RAM, and the Defy is already short on RAM, so enabling HWA usually does more harm than good. That's why it's best to disable it whenever it's not really needed for an app to function properly.)
      The following apps require HWA: Camera, Dialer (on CM11 only), Google Maps (version 7+), Chrome browser. Other apps may also require HWA. If an app doesn't display properly, try enabling HWA again to see if that solves the problem.​
    • Install Greenify, which you can use to “hibernate” any apps that you don’t want to run automatically at startup.

    Other tips & suggestions:
    • You may wish to install Google Camera instead of the stock camera, for the reasons mentioned here.
    • For offline voice recognition, see here.
    • For better GPS performance, you may want to try flashing this zip and/or using this app. (Thanks to @Male_zvire and @okij for recommending these solutions.)

    FAQ & what to do if something goes wrong

    A freshly installed rom takes some time to "settle" while various services run in the background, so the phone may be a bit unstable at first. If you're still encountering errors or other problems after a few hours, first check the bug list and use the XDA forum search feature to see if the issue you are having has already been reported.

    If you think you've found a new bug, don't just complain about it; try to help solve it by taking logs. @measel has provided a very helpful guide for taking logs.

    What if the phone doesn't boot up properly?
    If you can still access the custom recovery, just flash safewipe again and re-install the rom, or restore a backup. (To enter TeamWin recovery after installing SlimKat or CM11, press the menu button when you see the screen that tells you to either press the menu button to enter recovery or the search button to continue with normal bootup. That screen should appear just after the Motorola logo disappears, and before the boot animation begins.)

    If you can't access the recovery, you may need to flash an sbf file using RSD Lite. Be careful! Flashing an sbf file improperly is one of the few things that can actually hard-brick the Defy, and if you flash the wrong sbf file for your phone, it may be impossible to restore your phone back to its original firmware. Read the All-in-One Defy Beginner's guide for more information about sbfs and RSD Lite. You can also check out the Motorola Defy wiki page for other tips and tutorials.


    A special thanks to @Quarx, who has been faithfully updating our phone to newer and better firmwares since the beginning of Defy history, and has undoubtedly put more work into this project than anyone else. Thanks also to our many other developers, past and present: @TJKV (who uses Quarx's kernel sources to port SlimKat to the Defy), @Blechd0se (who has made significant contributions to the kernel development for the Defy and also developed the Aero Control app that we use to fine-tune the performance of our phones), @SlugZero, @YetAnotherForumUser, @struq, @htto, @Epsylon3, @maniac103, @walter79, @czechop, @kabaldan, and @Kayant. Many thanks to all of them, and to anyone I may have forgotten. Thanks also to @okij and other Defy users who have helped with testing new builds and identifying bugs for the developers to solve.
    3
    suggestion for improvement

    Thanks for the guide. I'm pretty sure it is very useful for beginners! ;)

    I would suggest to try to get rid of as much text as possible and make it more step-by-step-y, you know what I mean? People (at least I recognized that on me) tend to give up quickly when it comes to reading. Right now it looks really difficult!

    Just a suggestions. People will still appreciate your work as is. Thanks.
    3
    more recommendations

    I've updated and reorganized the OP, adding a section on customizing & improving performance.

    While I'm at it, here's another recommendation:

    I recommend using the new Google Camera app instead of the stock camera, because it shows the whole field of view of the camera. The SlimKat camera allows you to see the whole field of view when taking pictures (if the "True View" option is enabled), but you still won't see the whole field of view when recording videos in SD resolution. Even with "True View" enabled, the stock camera preview shows a widescreen aspect ratio when recording videos in 480p, which means that you won't see the whole field of view that you are recording. The Google Camera app solves that problem for both CM11 and SlimKat.
    3
    I've updated the guide and added a section that explains how to customize the rom before installation: how to remove unnecessary files to save space in the system partition, replace the default bootanimation and boostrap image, change the default baseband and LCD screen dpi, etc. Does anyone have any suggestions for other possible customizations I should mention?
    2
    Hey :) First of all, thanks for the Guide!
    [...]
    Im desperate and I dont know what to do, almost wanted to throw that damn thing out of the window ;D soooo... does someone have an idea how to solve my problem ? :/ Or did I destroy the damn thing ? I just installed 2ndlnit , that cant be the problem right ?

    No, you probably haven't. just follow the defy unbrick guide - http://xdaforums.com/showthread.php?t=1828639

    I have sucessfully rooted and installed CM11 on my old Defy yesterday, following the guide on the first page.
    Had a couple of problems (bloated phone w/ android 2.2, perhaps I should have done a wipe before rooting it), SuperSU kept stopping after boot and after any app asking for root, so I had to give permissions to them manually in SuperSU, I had to install 2ndinit v. 1.4.2, and my blue LED never lit up, phone entered recovery after every boot.

    After flashing TWRP the phone just showed the M logo and then black screen, no blue LED... but I have still managed to enter boot menu after pressing repeteadly the vloume down key when the M logo was on screen.
    Had to try some 10 times before getting it right, but it appeared that to flash a SBF I would have to install windows first :laugh: - as I've found out now, it should be easier than in windows :cool: http://xdaforums.com/showthread.php?p=13730405

    The recommended version of TWRP ( 2.6.3.0) can flash up to 10 zip files at once, I've put all the 3 files in the queue and I wiped dalvik cache before rebooting.
    Basically I think you did everything almost right, except that when already in the boot menu you should have flashed TWRP, reboot, "safewipe.zip", the CM11 zip and the gapps zip.\

    Good luck with unbricking!

    And many thanks to Proverbs2 for putting together this very complete guide!