wiki:Android/HTC/Vision/LinuxAnalysis

Linux Analysis

For the complete list of my articles on Android devices and software, including analysis of devices and system firmware, lists of external resources and tools, and How-To instructions, check the front page of this wiki under the Android heading

As part of my investigation into methods for replacing the HTC Linux kernel and Android system via a firmware update I am noting interesting information here.

Kernel Versions

The original T-Mobile G2 in the U.S.A. was released in October 2010 with:

Linux version 2.6.32.17-g814e0a1 (htc-kernel@and18-2) (gcc version 4.4.0 (GCC) ) #1 PREEMPT Wed Sep 15 14:27:28 CST 2010

The HTC Desire Z released in early November 2010 has:

Linux version 2.6.32.21-gd2764ed (htc-kernel@and18-2) (gcc version 4.4.0 (GCC) ) #1 PREEMPT Tue Oct 26 16:04:03 CST 2010

The diff output of the two devices kernel logs Download show several other changes.

eMMC Partitioning

This is my analysis of the partitioning. These are the symbolic links I created in a directory containing dumps of each partition (except the over-large userdata partition which isn't of interest). The hex values are the number of 512-byte sectors the partition uses. This is in hex so it is easy to spot it in the partition tables that are in both HBoot and REX.

01-dbl-03E8.raw
02-oemsbl-0080.raw
03-osbl-2328.raw
04-header_rex_amss.elf
05-rex_amss-EA60.elf
06-modem_DSP-61A8.raw
07-unknown_data-1000.raw
08-unknown-1800.raw
09-unknown-1000.raw
10-unknown-0800.raw
11-unknown-0800.raw
12-unknown-445F.raw
13-unknown-1800.efs
14-unknown-1800.efs
15-unknown-0800.raw
16-unknown-45FB.raw
17-misc-0200.raw
18-hboot-0800.raw
19-sp1-0800.raw
20-wifi-0A00.raw
21-recovery-43FA.raw
22-boot-2000.raw
23-mfg-0200.raw
24-sp2-0FFE.raw
25-system-116FFF.ext3
27-cache-095FFF.ext3
28-devlog-A5FF.ext3
29-pdata-0200.raw

The partitioning as seen by the kernel on a T-Mobile G2 with 2.6.32.17-g814e0a1:

cat /proc/partitions 
major minor  #blocks  name

   7        0      14585 loop0
 179        0    2203648 mmcblk0
 179        1        500 mmcblk0p1
 179        2         64 mmcblk0p2
 179        3       4500 mmcblk0p3
 179        4          1 mmcblk0p4
 179        5      30000 mmcblk0p5
 179        6      12500 mmcblk0p6
 179        7       2048 mmcblk0p7
 179        8       3072 mmcblk0p8
 179        9       2048 mmcblk0p9
 179       10       1024 mmcblk0p10
 179       11       1024 mmcblk0p11
 179       12       8751 mmcblk0p12
 179       13       3072 mmcblk0p13
 179       14       3072 mmcblk0p14
 179       15       1024 mmcblk0p15
 179       16       8957 mmcblk0p16
 179       17        256 mmcblk0p17
 179       18       1024 mmcblk0p18
 179       19       1024 mmcblk0p19
 179       20       1280 mmcblk0p20
 179       21       8701 mmcblk0p21
 179       22       4096 mmcblk0p22
 179       23        256 mmcblk0p23
 179       24        256 mmcblk0p24
 179       25     425726 mmcblk0p25
 179       26    1361920 mmcblk0p26
 179       27     209715 mmcblk0p27
 179       28      20480 mmcblk0p28
 179       32    7761920 mmcblk1
 179       33    7757824 mmcblk1p1
 254        0      14584 dm-0

# cat /proc/emmc 
dev:        size     erasesize name
mmcblk0p17: 00040000 00000200 "misc"
mmcblk0p21: 0087f400 00000200 "recovery"
mmcblk0p22: 00400000 00000200 "boot"
mmcblk0p25: 19fbfa00 00000200 "system"
mmcblk0p27: 0cccce00 00000200 "cache"
mmcblk0p26: 53200200 00000200 "userdata"
mmcblk0p28: 01400000 00000200 "devlog"

# busybox fdisk -l mmcblk0

Disk mmcblk0: 2256 MB, 2256535552 bytes
1 heads, 16 sectors/track, 275456 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

   Device Boot      Start         End      Blocks  Id System
mmcblk0p1   *           1          63         500  4d Unknown
Partition 1 does not end on cylinder boundary
mmcblk0p2              63          71          64  45 Unknown
Partition 2 does not end on cylinder boundary
mmcblk0p3              71         634        4500  46 Unknown
Partition 3 does not end on cylinder boundary
mmcblk0p4             634     1048577     8383544   5 Extended
Partition 4 does not end on cylinder boundary
mmcblk0p5             634        4384       30000  49 Unknown
mmcblk0p6            4384        5946       12500  50 Unknown
mmcblk0p7            5946        6202        2048  51 Unknown
mmcblk0p8            6202        6586        3072  52 Unknown
mmcblk0p9            6586        6842        2048  53 Unknown
mmcblk0p10           6842        6970        1024  54 Unknown
mmcblk0p11           6971        7098        1024  56 Unknown
mmcblk0p12           7099        8192        8751+ 55 Unknown
mmcblk0p13           8193        8577        3072  4a Unknown
mmcblk0p14           8577        8961        3072  4b Unknown
mmcblk0p15           8961        9089        1024  74 Unknown
mmcblk0p16           9089       10208        8957+ 75 Unknown
mmcblk0p17          10209       10240         256  76 Unknown
mmcblk0p18          10241       10369        1024  47 Unknown
mmcblk0p19          10369       10497        1024  34 Unknown
mmcblk0p20          10497       10657        1280  36 Unknown
mmcblk0p21          10657       11744        8701  71 Unknown
mmcblk0p22          11744       12256        4096  48 Unknown
mmcblk0p23          12257       12288         256  73 Unknown
mmcblk0p24          12289       12321         256  31 Unknown
mmcblk0p25          12321       65536      425726+ 83 Linux
mmcblk0p26          65537      235777     1361920+ 83 Linux
mmcblk0p27         235777      261991      209715+ 83 Linux
mmcblk0p28         261991      264551       20480  19 Unknown 

And seen differently (note the additional "pdata" partition) on a Desire Z with 2.6.32.21-gd2764ed:

# cat /proc/partitions
major minor  #blocks  name

 179        0    2277376 mmcblk0
 179        1        500 mmcblk0p1
 179        2         64 mmcblk0p2
 179        3       4500 mmcblk0p3
 179        4          1 mmcblk0p4
 179        5      30000 mmcblk0p5
 179        6      12500 mmcblk0p6
 179        7       2048 mmcblk0p7
 179        8       3072 mmcblk0p8
 179        9       2048 mmcblk0p9
 179       10       1024 mmcblk0p10
 179       11       1024 mmcblk0p11
 179       12       8751 mmcblk0p12
 179       13       3072 mmcblk0p13
 179       14       3072 mmcblk0p14
 179       15       1024 mmcblk0p15
 179       16       8957 mmcblk0p16
 179       17        256 mmcblk0p17
 179       18       1024 mmcblk0p18
 179       19       1024 mmcblk0p19
 179       20       1280 mmcblk0p20
 179       21       8701 mmcblk0p21
 179       22       4096 mmcblk0p22
 179       23        256 mmcblk0p23
 179       24       2047 mmcblk0p24
 179       25     571391 mmcblk0p25
 179       26    1203199 mmcblk0p26
 179       27     307199 mmcblk0p27
 179       28      21247 mmcblk0p28
 179       29        256 mmcblk0p29
 179       32    7772160 mmcblk1
 179       33    7768064 mmcblk1p1

# cat /proc/emmc
dev:        size     erasesize name
mmcblk0p17: 00040000 00000200 "misc"
mmcblk0p21: 0087f400 00000200 "recovery"
mmcblk0p22: 00400000 00000200 "boot"
mmcblk0p25: 22dffe00 00000200 "system"
mmcblk0p27: 12bffe00 00000200 "cache"
mmcblk0p26: 496ffe00 00000200 "userdata"
mmcblk0p28: 014bfe00 00000200 "devlog"
mmcblk0p29: 00040000 00000200 "pdata"

# fdisk -ul /dev/block/mmcblk0
Warning: deleting partitions after 60

Disk /dev/block/mmcblk0: 2332 MB, 2332033024 bytes
1 heads, 16 sectors/track, 284672 cylinders, total 4554752 sectors
Units = sectors of 1 * 512 = 512 bytes

              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1   *           1        1000         500  4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2            1001        1128          64  45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3            1129       10128        4500  46 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4           10129     4554750     2272311   5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5           10130       70129       30000  49 Unknown
/dev/block/mmcblk0p6           70131       95130       12500  50 Unknown
/dev/block/mmcblk0p7           95132       99227        2048  51 Unknown
/dev/block/mmcblk0p8           99229      105372        3072  52 Unknown
/dev/block/mmcblk0p9          105374      109469        2048  53 Unknown
/dev/block/mmcblk0p10         109471      111518        1024  54 Unknown
/dev/block/mmcblk0p11         111520      113567        1024  56 Unknown
/dev/block/mmcblk0p12         113569      131071        8751+ 55 Unknown
/dev/block/mmcblk0p13         131073      137216        3072  4a Unknown
/dev/block/mmcblk0p14         137218      143361        3072  4b Unknown
/dev/block/mmcblk0p15         143363      145410        1024  74 Unknown
/dev/block/mmcblk0p16         145412      163326        8957+ 75 Unknown
/dev/block/mmcblk0p17         163328      163839         256  76 Unknown
/dev/block/mmcblk0p18         163841      165888        1024  47 Unknown
/dev/block/mmcblk0p19         165890      167937        1024  34 Unknown
/dev/block/mmcblk0p20         167939      170498        1280  36 Unknown
/dev/block/mmcblk0p21         170500      187901        8701  71 Unknown
/dev/block/mmcblk0p22         187903      196094        4096  48 Unknown
/dev/block/mmcblk0p23         196096      196607         256  73 Unknown
/dev/block/mmcblk0p24         196609      200702        2047  26 Unknown
/dev/block/mmcblk0p25         200704     1343486      571391+ 83 Linux
/dev/block/mmcblk0p26        1343488     3749886     1203199+ 83 Linux
/dev/block/mmcblk0p27        3749888     4364286      307199+ 83 Linux
/dev/block/mmcblk0p28        4364288     4406782       21247+ 19 Unknown
/dev/block/mmcblk0p29        4406784     4407295         256  23 Unknown


Kernel Log

This dmesg output Download was captured by Scott Walker (scotty2 a.k.a damnoregonian) on his T-mobile G2 in response to a request from me.

Here's the log from a Desire Z Download.

Resources

 HTC source-code bundles for released kernels.

Linux  early boot sequence on ARM

Attachments