Search This Blog

Aug 29, 2011

Rescue VMware image file

My Ubuntu VMware image corrupted. All my Linux stuff are in this VMware image, it is important for me to recover it.


1.       Select another workable VMware image file, enter “Virtual Machine Settings”,
a.        select “Add Hardware Wizard”, add “Hard Disk”,

b. In “Select a Disk” windows, choose “Use an existing virtual disk”

c. Select your corrupt VMware image VMDK file.

d.      Now we can see secondary hard disk drive in VMware setting

2.       Power up this VMware image, enter Linux, we can see secondary hard disk in Linux, that indicate the corrupt image file can be accessed now.
3. Exit from Linux. Use VMware player to open your rescued image, then we can enter Linux .

Aug 15, 2011




Aug 5, 2011

Handle missing error when building customer's Android.

We are working on customer's Android source code. It tooks 6 hours to get the code, and it fails on building procedure, it report error, check error message below:
make: *** No rule to make target `out/target/product/imx50_evk/obj/lib/', needed by `out/target/product/imx50_evk/obj/SHARED_LIBRARIES/copybit.imx5x_intermediates/LINKED/'.  Stop.
Find out the reason why this happens.
1. Find, it locate at "~/myandroid/devices/fsl/proprietary/gpu/", in this directory, in, it already include So we need check where include the
2. We are using imx50_evk for customer configuration, so we enter directory "~/myandroid/devices/fsl/imx50_evk", check, found there is a line was commented
"#include devices/fsl/proprietary/gpu/".
3. uncomment this line and build it, it passed, OK.

Aug 2, 2011

How to interpret complex c delarations

For example, how to interpret it int * (* (*fp1) (int) ) [10];

1. We have important rule "The Right-Left rule"
This is a simple rule that allows you to interpret any declaration. It runs as follows:
Start reading the declaration from the innermost parentheses, go right, and then go left. When you encounter parentheses, the direction should be reversed. Once everything in the parentheses has been parsed, jump out of it. Continue till the whole declaration has been parsed.
 One small change to the right-left rule: When you start reading the declaration for the first time, you have to start from the identifier, and not the innermost parentheses.

int * (* (*fp1) (int) ) [10];

This can be interpreted as follows:
Start from the variable name -------------------------- fp1
Nothing to right but ) so go left to find * -------------- is a pointer
Jump out of parentheses and encounter (int) --------- to a function that takes an int as argument
Go left, find * ---------------------------------------- and returns a pointer
Jump put of parentheses, go right and hit [10] -------- to an array of 10
Go left find * ----------------------------------------- pointers to
Go left again, find int -------------------------------- ints.

2. Use cdecl tool
 $ apt-get install cdecl
 $ cdecl
 cdecl> explain int * (* (*fp1) (int) ) [10]
 declare fp1 as pointer to function (int) returning pointer to array 10 of pointer to int