CyanogenMod ROM Samsung Galaxy Tab 10.1 GT-P7510 (Wi-Fi) (p4wifi)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 10.1 (Android 4.2.2 (Jelly Bean))

Special boot modes

  • Recovery: Vol Down & Power then use Vol Down to choose the box icon, press Vol Up to select
  • Download: Volume Down

Source code

Galaxy Tab 10.1 (Wi-Fi) Specifications
Codename: p4wifi
Also known as: GT-P7510
Vendor: Samsung
Manufacturer: samsung
Type: tablet
LTE freq: 700MHz
Platform: NVIDIA Tegra 2
CPU: 1 GHz dual-core T2 250
GPU: ULP Geforce
Weight: 565 g (19.9 oz)
Dimensions: 256 mm (10.1 in) (h)
175 mm (6.8 in) (w)
9.7 mm (0.38 in) (d)
Screen size: 257 mm (10.1 in)
Resolution: 1280×800
Screen density: 169 PPI
Internal storage: 8/16/32GB
Bluetooth: 3.0
Wi-Fi: 802.11 b/g/n
Main camera: 3.1MP
Secondary camera: 1.3MP
Power: 7000 mAh (Non-removable)
Peripherals: capacitive touchscreen, proximity & light sensors, A-GPS, 3-axis accelerometer, additional 3-axis gyroscope, digital compass
CM supported: 9, 10, 10.1


Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.


ALL p4wifi tablets must use the bootloader in the guide below to use CyanogenMod 10.1, even if it’s a UK model!

Installing a custom recovery on Samsung Galaxy Tab 10.1 (Wifi)

Samsung devices come with a unique boot mode called Download Mode which is very similar to Fastboot Mode on some devices with unlocked bootloaders. P3/P4 family tablets need to use Odin3-v1.85 to interface with the device while in Download Mode. The preferred method of installing a custom recovery is through this boot mode. Rooting the stock firmware is neither recommended nor necessary.

Odin3 Method – Windows Only

  1. Download pershoot’s ClockworkMod Recovery package, and Odin3-v1.85:
    • pershoot’s ClockworkMod Recovery: download
      md5: 076f45220d78c8a5b15435d40a14f08a
    • Bootloader: download
      md5: 6bc78065ba9cf7899d914322bcfeaee1
    • Odin3-v1.85: download
    • Samsung USB Drivers with Escape: download
  2. Open Odin3-v1.85.
  3. Power off the Samsung Galaxy Tab 10.1 (Wifi) and connect the USB adapter to the computer but not to the Samsung Galaxy Tab 10.1.
  4. Boot the Samsung Galaxy Tab 10.1 (Wifi) into download mode by holding down Vol Down & Power simultaneously and hold past the Samsung boot screen, then select Download mode by hitting Vol Up. Connect the USB cable.
    NOTE: To confirm the device is connected and working, look for the message box with the word Added!! on lower left side.
  5. Uncheck the box labeled Auto Reboot.
  6. Press the dialog box labeled PDA and select the bootloader package, which is inside the zip file.
  7. Press Start.
  8. A blue transfer bar will appear on the device showing the recovery being transferred. You should see the following in the message box – <OSM> All threads completed. (succeed 1 / failed 0). Once completed, the device may reboot automatically.
  9. Note: Some devices will not reboot automatically. Reboot manually by using Vol Down & Power method again, then return to Download mode by selecting Vol Up. Then continue to the next step. If you accidentally boot in the main o/s, you are fine. Just power off and try again.
  10. Repeat Steps 2-7 using the recovery file the exact same way as the bootloader. You should see the following in the message box – <OSM> All threads completed. (succeed 1 / failed 0)
  11. The Samsung Galaxy Tab 10.1 (Wifi) now has ClockworkMod Recovery and the bootloader you need installed. Continue to the next section.

Heimdall Method (Experimental)

  1. Download ClockworkMod Recovery, and the Heimdall Suite:
    Regular: download md5: 1dce47b7e7cc15f069c4cacd9dcbbdf7
    Touch: download md5: f0ae0233a20cf1a358447985dc107d0e
    • Windows:
      • Heimdall Suite 1.4RC1 Command-line Binary(has bug): download
      • Heimdall Suite 1.4RC2 Command-line Binary: download
        NOTE: The Heimdall Suite 1.4RC2 requires the Microsoft Visual C++ 2012 Redistributable Package to be installed on the computer, which can be downloaded here. You will need the 32/64 bit version as required by Heimdall, NOT as required by your OS. Heimdall currently seems to be 32 bit. You may well ACTUALLY need to reboot for the redistributable to install properly.
    • Linux:
      • Heimdall Suite 1.4RC1 Command-line Binary 32bit: download
      • Heimdall Suite 1.4RC1 Command-line Binary 64bit: download
        NOTE: Heimdall may be available in your distro’s app repositories. However, it may be out of date. If you run into issues, verify you are using the latest one.
    • Mac OS X:
      • Heimdall Suite 1.4RC1 Command-line Binary: download
        • Place the libusb-1.0.0.dylib library from the zip inside /opt/local/lib on the machine.
    • Building From Source: The source code for the Heimdall Suite is available on Github. For more details about how to compile the Heimdall Suite, please refer to the README provided on Github or refer to the instructions to Install and compile Heimdall.
  2. Power off the Samsung Galaxy Tab 10.1 (Wifi) and connect the USB adapter to the computer but not to the Samsung Galaxy Tab 10.1 (Wifi).
  3. Now boot the Samsung Galaxy Tab 10.1 (Wifi) into download mode by holding down Vol Down & Power, highlight the right icon by using Vol Down, and select it with Vol Up. Accept the disclaimer. After this insert the USB cable into the device.

    1. Run the included zadig.exe in the drivers folder of the Heimdall Suite.
    2. Choose Options » List All Devices from the menu.
    3. Select Samsung USB Composite Device or MSM8x60 or Gadget Serial or Device Name from the drop down menu.
    4. Click Replace Driver (having selecting “Installed Driver” from the drop down list built into the button).
    NOTE: A prompt may appear warning that the installer is unable to verify the publisher of the driver, ignore it and select “Install this driver anyway.” Also you may receive two strange prompts, possibly from Windows, about security. Cancel then both and just carry on.
    NOTE: On Windows 8 you must disable driver signature enforcement in order to use zadig.
  4. On the computer, open a terminal and run the following command from the Heimdall directory:
    heimdall flash --SOS recovery.img --no-reboot
    Tip: It may be necessary to run the command as root in Linux distributions, ie “sudo heimdall […]”. If a blue bar doesn’t show up after the process has finished or this appears: “Failed to confirm end of file transfer sequence!”, it may be a symptom.
    Tip: it may be necessary to capitalize the name of the partition on some devices… ie –KERNEL instead of –kernel, or –recovery instead of –RECOVERY
    Tip: protocol initialization can (does?) fail if the device is connected via a USB hub – connect directly to the PC
    Linux 64bit:

    If you see this message: “unable to execute ./heimdall: No such file or directory” – try the 32bit version and make sure to run it with sudo.
    Mac OS X:

    If you see this message: “ERROR: Claiming interface failed!“, if so, you need to disable the default USB drivers with the following commands:

    sudo kextunload -b;
    sudo kextunload -b;
    sudo kextunload -b;
    If you have installed Samsung Kies, you may further need to unload those USB drivers with the following commands:

    sudo kextunload -b com.devguru.driver.SamsungComposite;
    sudo kextunload -b com.devguru.driver.SamsungACMData
    sudo kextunload -b com.devguru.driver.SamsungACMControl
  5. A blue transfer bar will appear on the device showing the recovery being transferred.
  6. You need now to manually reboot the phone into ClockworkMod Recovery mode by holding Vol Down & Power and selecting the left icon.
  7. The Samsung Galaxy Tab 10.1 (Wifi) now has ClockworkMod Recovery installed. Continue to the next section.

Helpful Tip

  • The stock ROM may overwrite your custom recovery on boot. To prevent this, boot immediately into ClockworkMod Recovery after leaving Download Mode instead of letting the ROM boot up normally. If your recovery is overwritten, simply redo the steps you followed above and catch it before it boots next time.
  • Some users have reported connection errors if the device is connected to a USB hub. If you experience such errors it is recommended that you try connecting your device to a USB port on the motherboard.
  • Antivirus software may prevent Heidmall from connecting properly. Disable your antivirus before proceeding.
  • If Heimdall fails to connect, the Download mode may get stuck, making all further attempts fail too. To retry, you may need to restart the Download mode: turn off the phone by holding Power for 5-10 seconds, then boot into Download mode and run Heimdall again.
  • If Heimdall fails to connect (errors related to initialising the protocol, or transferring data), in Zadig try installing the libusbK driver rather than the WinUSB driver.

Installing CyanogenMod from recovery


Some devices do not have removable SD cards. Regardless, there should still be a partition on the device named “/sdcard” that can be used for flashing purposes, even though the contents of /sdcard may actually be in internal storage.

  1. Download the prebuilt release of CyanogenMod you wish to install. (Or if you’ve built CM yourself, look in the $OUT directory for the .zip.)
    Optional: Download any supplemental 3rd-party applications packages for the device you wish to use.
  2. Place the CyanogenMod rom .zip file on the root of the SD card:
    • From a terminal (command prompt) run adb push /sdcard/
    See adb documentation for additional help with this step.
    Optional: Place any supplemental packages (eg Google Apps or kernels) .zip file(s) on the root of the SD card.
    Note: This device needs to use Google Apps sourced from here for CyanogenMod 10.1.
  3. Boot to recovery mode on the Samsung Galaxy Tab 10.1 (Wifi) by holding Vol Down & Power then use Vol Down to choose the box icon, press Vol Up to select.
  4. Once the device boots into the ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm your selection, although for some devices the power button is used as a “back” button to go up one level, in which case the home button is used to confirm the selection.
    Optional/Recommended: Select backup and restore to create a backup of the current installation on the Samsung Galaxy Tab 10.1 (Wifi).
  5. Select the option to wipe data/factory reset.
  6. Select install zip from sdcard.
  7. Select choose zip from sdcard.
  8. Select the CyanogenMod file you placed on the sdcard. You will then need to then confirm that you do wish to flash this file.
    Optional: Install any additional packages you wish using the same method.
  9. Once the installation has finished, return back to the main menu, and select the reboot system now option. The Samsung Galaxy Tab 10.1 (Wifi) should now boot into CyanogenMod.

How To Build CyanogenMod For Samsung Galaxy Tab 10.1 (Wi-Fi) (p4wifi)


These instructions will hopefully assist you to start with a stock Galaxy Tab 10.1 (Wi-Fi), unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Galaxy Tab 10.1 (Wi-Fi)
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Galaxy Tab 10.1 (Wi-Fi) (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.


You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment


You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u -b cm-13.0

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)


$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast p4wifi

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:

$ source build/
$ breakfast p4wifi

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/ does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/ from ~/android/system.

Extract proprietary blobs

Now ensure that your Galaxy Tab 10.1 (Wi-Fi) is connected to your computer via the USB cable and that you are in the ~/android/system/device/samsung/p4wifi directory (you can cd ~/android/system/device/samsung/p4wifi if necessary). Then run the script:

$ ./

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/samsung directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.


Your device should already be running a build of CyanogenMod for the branch you wish to build for the script to function properly.


It’s important that these proprietary files are extracted to the ~/android/system/vendor/samsung directory by using the script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch p4wifi

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make p4wifi should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/ command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/p4wifi/] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2), which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:


The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from, under CC BY-SA 3.0 licence.