2010年10月5日 星期二

Mold HTC Magic to Android 2.1

This is a personal note about how to upgrade my HTC magic to Android 2.1. Although there are already lots of articles discussing about the upgrade HTC Magic to Android 2.1, Most of them (especially the chinese ones) use goldcard and RUU of European engineering version. Since I can not create the goldcard (I still don't know why ><), I take a brutal way to mold my magic. Most of the methods comes from XDA forum and blog of Abin (Chinese). The note is based on 32A magic.

  • Replace Default SPL to Engineering SPL
We start from the relacing the default SPL. Deault SPL ( Second Process Loader) needs to be replaced with engineering version because default SPL is S-ON and therefore can not be used to program flash by means of fastboot.
  1. Download HTC Sync and make sure the device driver is correctly installed. If you have any problem, please refer to the artical of Abin and this article.
  2. Download Android SDK from here and extract it.
  3. Get engineering SPL(1.33.2010) from here and appropriate recovery image (recovery-RA-sapphire-v1.6.2H.img) from here. Put engineering SPL into your SD card and recovery image in the tools directory of Android SDK.
Follow the instruction of the article but use RA-sapphire-v1.6.2H.img as recovery image.
  1. Connect your magic to PC and make sure the device driver is installed. Turn magic on into FASTBOOT mode by pressing POWER and BACK
  2. Use a text console and type 'fastboot boot RA-sapphire-v1.6.2H.img' and wait for one or two minutes before you see a recovery menu.
  3. In the recovery menu, select 'Apply sdcard:choose zip' and then select engineering SPL (1.33.2010)
After that, enter FASTBOOT mode againg and your SPL should be 1.33.2010 with S-OFF.
  • Replace Radio, SPL, and Recovery
Basically, follow this article to replace your radio code to 6.35 Radio, 1.76.2007 SPL, recovery-RA-hero-1.6.2. There are methods to restore old SPL and RADIO in the article also.
  1. Download 6.35 radio and 1.76.2007 SPL from the link of the article.
  2. Boot your magic into FASTBOOT mode and connect the USB cable to your PC.
  3. Use fastboot to upgrade 6.35 radio and 1.76 SPL. There are detailed steps in the article.
  • Upgrade to Android 2.1
Now, it time for us to flash the android image to the flash of magic after we replaced old Radio, SPL, and recovery.
  1. Download Sanpei 2.1 image for magic 32A from here. Put it in root of the SD card.
  2. Boot the magic into recovery mode by pressing PWR+HOME
  3. Select 'Wipe data/factory reset' and then 'Wipe Dalvik-cache'
  4. Choose 'Flash zip from sdcard' and then select the zip file you download from step 1.
  5. Follow the prompt of the screen of magic and you will have a magic with 2.1 firmware.
  • Afterwords
After installation of 2.1 firmware, the connection between magic and PC is lost. According to Abin's article, HTC sync need to be updated to 2.0.25. After HTC sync is upgraded, device will be recognized.

2010年1月23日 星期六

Note of Aptitude

Reference:
http://wiki.ubuntu-tw.org/index.php?title=Aptitude
http://man.ddvip.com/linux/debian/aptitude/index.html
  • Package status































StateDescriptionNote
p(p)urgedThe package is not installed
i(i)stanlledThe package is installed
u(u)npackedThe package is unpacked but not installed
v(v)irtualTha package is a virtual package
c(c)onfig remainsThe package is removed, but there are still configuration files
Chalf (C)onfiguredThe package is configured, but the configuration process is not complete
B(B)rokenThe package is broken because dependency can't be satisfied
E(E)rrorInternal error

  • Package Action



























ActionsDescriptionNote
h(h)oldThe package will be hold in current version
p(p)urgeThe package will be purged
d(d)eleteThe package will be deleted (config will remain)
i(i)installThe package will be installed
r(r)einstallThe package will be reinstalled
u(u)pgradeThe package will be upgraded
A(A)utomaticThe package is automatically installed

  • Some key binding

























































KeyDecriptionNote
+InstallMark the package to be installed
-RemoveMark the package to be removed
_PurgeMark the package to be purged
=HoldMark the package to be hold to prevent future upgrade
MAutoMark the package as automatically installed. It will be removed if there are no long package depends on it
mManualMark the package as manually installed
:CancelCancel pending actions to the package
gGoExecute pending actions
bBreakSearch break packages
CChangeLogSee changelog of the package
dDepends onSee dependencies of the package
rRelate toSee packages depends on the given package
fForget newClear packages shown as new
/SearchSearch the package
\Backward searchSearch the package backward
Ctrl+uRecoverRecover last action
Ctrl+tMenuMove to menu bar


  • Command line

































ActionsDescription
installInstall the package. You can also specify flags such as _,-,+,M... For example, you can use the command
"aptitude install A+ B- C_ D+M" to install A, remove B, purge C, and install D and mark D as auto
removeTo remove a package
purgeTo purge a package
updateTo update package list
safe-upgradeUpgrade currently installed packages
full-upgradeUpgrade the whole system
cleanClean the cache
auto-cleanClean unnecessary .deb in the cache
downloadDownload .deb package


  • Search Pattern
Please refer to Table 2.1 in the aptitude manual
Here are some examples in Chinese.

2010年1月17日 星期日

HTML encoder

To post HTML code on your blog, you should first HTML encode it.
That will escape interpretation of blog.

http://www.opinionatedgeek.com/dotnet/tools/htmlencode/Encode.aspx

2010年1月16日 星期六

Blogspot remove table blank

To remove the big blank in blog spot, you wrap you table like this:

<style type="text/css">.nobrtable br { display: none }</style><br /><div class="nobrtable">


Your Table...


</div>

2010年1月15日 星期五

Ubuntu component summary

Ubuntu has four components, they are grouped according to License Policy.
  • Main component contains free software and fully supported by Ubuntu.
  • Universe component contains free softwares from open source world. They are not guaranteed with fixed by Ubuntu.
  • Restricted component contains popular software which is not completely free. Ubuntu team supports the software. (The support may not complete because the license may prohibit Ubuntu from modifying for the bug fix.)
  • Multiverse component contains non-free software
Here is a summay table.



















Free softwarenon-free software
Offical Supportmainrestricted
Unofficialuniversemultiverse



Reference documents:
http://wiki.ubuntu.com/Ubuntu/ForDebianDevelopers
http://http://www.ubuntu.com/community/ubuntustory/components

2010年1月9日 星期六

Download deb file by apt-get

Use apt-get -d install PACKAGE-NAME
The deb package will be put on /var/cache/apt/archieves

ubuntu-9.10 and JDK-5

Because JDK6 is removed by Ubuntu-9.10 (Karmic)
We need to add the following line to /etc/apt/sources.list

deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse

2010年1月2日 星期六

NAND flash and NOR flash

Reference: http://en.wikipedia.org/wiki/NOR_flash

NOR Flash
  • Random access
  • Large block size
  • Long erase/program time
NOTE: 1->0 by byte basis, 0->1 by block basis

NAND Flash
  • Block access
  • Small block size
  • Fast program/erase time