[Huawei MediaPad M2] beast.in.black:
Hi people,

I would like to collect some dev info for the M2 which may help in future development efforts - maybe tweak the official ROMs to be less idiotic, or develop new ROMs, apps, etc.

If any of you can contribute info similar to what I have shown below, it would be greatly appreciated. I will collate and analyze the info from your replies and add it to these first couple of posts so that it serves as the main repo of this dev info.

*** DISCLAIMER *** Please do not attempt to collect any info from your device if you are not confident about or familiar with how to root your device or how to use shell commands in a root terminal shell. Any and all damage you may cause to your device in the pursuit of gathering this information is solely your responsibility and I will be neither responsible nor accountable for any such damage.

Still reading? Good. I commend your enthusiasm :good:

Guide: Block Device/Partition Information

Introduction

Here are some links explaining what Android partitions are and what they do. While some of the info in the links refers to other devices or has been superseded by changes to Android since the article was written, the basic information itself holds good:

http://www.all-things-android.com/content/review-android-partition-layout

http://donandroid.com/android-partitions-sdcard-boot-recovery-cache-data-system-misc-1043

https://sites.google.com/site/tomsgt123/adb-fastboot/understanding-android

This information is important because:

It will help us to map the contents of the official UPDATE.APP to the proper locations on the ROM Storage where they must be flashed.

It will help the developers of the Huawei Update Extractor tool to create an extractor profile specific for our M2 8.0 or 10.0 devices.

EDIT: I have actually already done this for the M2-802L, see my post on the Huawei Update extractor tool thread. Now we just need to wait for worstenbrood to integrate it into a new release of the Extractor.

It will help in the development of new ROMs.

How to get the partition info on your device

Prerequisites:

Your device needs to be rooted.

You need to be able to get a root shell terminal on your phone, either using adb or using a terminal emulator app like "Termux" or "Terminal Emulator for Android". If you're going to be using a Terminal Emulator app on your phone, you'll find that the Hacker's Keyboard app will make your life much much easier when dealing with shells on the phone (ever tried to type any control character sequence at all, like CTRL+C, using all those cute fancy soft keyboards on the play store?)

You need to know how to use a terminal emulator and be comfortable with using shell commands (see Disclaimer above).

Method

Using ADB to get a root shell on your phone:

Ensure that you have the drivers for the phone installed on the computer. If not,

For Windows: just install the HiSuite app from Huawei to get the drivers. You can uninstall HiSuite immediately after it's installed (it's a useless piece of dreck, only useful for the drivers it installs) but the drivers will remain installed.

For Linux: The Android SDK for Linux should give you the generic ADB drivers. Then see this webpage for setting a proper USB device ID for Huawei devices in case you have issues. I have not yet tested this for myself, BTW.

Ensure that you have adb on your computer. If not,

For Windows: you can grab it from the Unlock guide thread.

For Linux: The Android SDK for Linux should have given you this already. If not, something is very very wrong with your universe.

Ensure that your phone is rooted. Follow the above-linked guide if you need to only if you are confident about being able to perform what's required and don't mind voiding your warranty and risking permanent damage to your phone and sanity. If your phone is not rooted, this is not going to work.

Connect your phone to the computer via USB.

Open up a command prompt. On Windows, this involves typing "cmd" in the search bar. On Linux, fire up the terminal app of your choice. I recommend gnome-terminal. Then navigate to the directory where the adb executable is located.

Check whether your device is recognized by adb. Type the following command:

adb devices

Your output should look something like this (the device ID in the output below will be particular to your phone):

List of devices attached
AAA0A1234567890 device

If your output doesn't look like the above, you may have a problem with the setup, and subsequent steps may not work. But we'll see.

Obtain a shell into your phone from adb:

adb shell

This should return a prompt into a shell on your phone which looks something like this:

shell@HWMozart:/ $

Now convert that plain old shell into a root shell (you are rooted by now, aren't you?):

su

You should now be in a root shell, as evidenced by the following output (notice that the $ in the previous output changed to #):

shell@HWMozart:/ #

Using a Terminal Emulator app on the phone to get a root shell:

Fire up the terminal emulator app on your phone (see the "Prerequisites" section above for a couple of suggestions on good terminal emulators I've personally used).

Type the following to get into a root shell in the terminal:

su

You should now be in a root shell, as evidenced by your prompt changing from $ to #.

Now we actually get to business! If you successfully got a root shell, it's time to issue the command to get the device partitions and their mappings! Type the following command exactly as shown (the cleverer folk can simple copy-paste it):

ls -l /dev/block/platform/hi_mci.0/by-name | tr -s ' ' | cut -d' ' -f6-8 > /storage/sdcard0/mypartitions.txt

The above command should put a list of partitions and their mappings into a text file called mypartitions.txt on the root directory of your phone's internal SD card mountpoint (if you want it put on your external SD card mountpoint, replace /storage/sdcard0/mypartitions.txt in the command with this: /storage/sdcard1/mypartitions.txt and you should find it placed accordingly).

The file mypartitions.txt can now be transferred from your phone to your computer via USB (or you can open it directly on your phone using a text editor) and add the info to a reply here.

Good luck!