2009年3月19日星期四

我的使用手记---Ubuntu 8.10

Ubuntu 8.10

1、修改root用户密码
$ sudo passwd root
允许root用户登陆
$ sudo vim /etc/gdm/gdm.conf
AllowRoot=true
2、配置安装源

首先,备份source.list
命令:sudo cp /etc/apt/source.list /etc/apt/source.list.bak
然后,打开并编辑source.list
$ sudo vim /etc/apt/source.list
使用vim命令删掉source.list中的内容命令如下:: 1,$ d
将以下内容拷贝进去:
#cn99.com source
deb http://ubuntu.cn99.com/ubuntu/ intrepid main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ intrepid-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ intrepid-proposed main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid-security main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid-proposed main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid-backports main restricted universe multiverse


3、配置APT代理
sudo vim /etc/apt/apt.conf
Acquire::http::Proxy "http://wwwgate0.mot.com:1080";
4、更新APT
$ sudo apt-get update
5、配置中文环境
System --> Administration --> Language Support: check Chinese
6、安装pdf
sudo apt-get install xpdf-chinese-simplified xpdf-chinese-traditional poppler-data
7、安装音乐播放器Audacious
$ sudo apt-cache search “audacious*”
$ sudo apt-install “audacious*”
8、安装linux下的source insight工具
$ sudo apt-cache search “kscope*”
$ sudo apt-get install “kscope*”
由于kscope使用的是kate3的库,ubuntu 8.10使用的是kate4,所以,我们需要安装kate3的库。过程如下:
下载kate_3.5.9.dfsg.XXX_i386.deb
$ ar x kate_3.5.9.dfsg.XXX_i386.deb
$ tar zxvf data.tar.gz
$ sudo cp usr/lib/libkateinterfaces.so.* /usr/local/lib
$ sudo cp usr/lib/libkateutils.so.* /usr/local/lib
$ cd /usr/local/lib
$ sudo ldconfig

7、Ubuntu常用技巧
http://wiki.ubuntu.org.cn/UbuntuSkills

2009年3月10日星期二

Android Get Source

Android Get Source
星期四, 三月 5, 10:12 上午

1. Setting up your machine

OpenSUSE Linux

The Android build is routinely tested on recent versions of OpenSUSE 11.0.
*Required Packages:
* Git 1.5.4 or newer
* JDK 5.0,update 12 or higher
In my platform:
Git 1.6.4
JDK 6u10
*You might also want Valgrind,a tool that will help you find memory leaks,stack corruption,array bounds overflows,etc.

2. Installing Repo

Make sure you have a ~/bin directory in your home directory, and check to be sure that this bin directory is in your path:
$ cd ~
$ mkdir bin
$ echo $PATH
Download the Repo script and make sure it is executable:
$ curl http://android.git.kernel.org/repo > ~/bin/repo
$ chmod a + x ~/bin/repo
*Set Git Proxy
$ curl http://www.meadowy.org/~gotoh/ssh/connect.c > connect.c
$ gcc -o connect connect.c
$ cd ~/bin
$ vi http-proxy
#!/bin/sh
# FileName: http-proxy
# This connects to an HTTP Proxy using connect.c
connect -H http://proxy.bupt.edu.cn:8080 $@
$ chmod a+x http-proxy
$ git config --global core.gitproxy "http-proxy for kernel.org"
##write rc file for connect
$ vi /etc/connectrc
HTTP_PROXY_USER=liangtaohy
HTTP_PROXY_PASSWORD=8712715
Initializing a Repo client
*Create an empty directory to hold your working files:
$ mkdir mydroid
$ cd mydroid
*Run repo init to bring down the latest version of Repo
$ repo init -u git://android.git.kernel.org/platform/manifest.git
*Getting the file
$ repo sync
###解决sync断开问题#######
###repo-sync shell#####
###这个是拷贝的###########
$ vi ~/bin/repo-sync
#!/bin/sh
echo "======start repo sync======"
repo sync
while [ $? = 1 ]; do
echo "======sync failed,re-sync again======"
sleep 10
repo sync
done

*Building the code
$ cd ~/android
$ make
If your build fails,complaining about a missing "run-java-tool", try setting the ANDROID_JAVA_HOME env var to $JAVA_HOME before making.
$ export ANDROID_JAVA_HOME=$JAVA_HOME

3. Config the environment of Java
My Java version is 1.6.0_10
The environment vars are:
JAVA_HOME=/usr/java/


2. Make Android Ramdisk
$ gnucpio -iz -F ramdisk.img
$ gnucpio -i -t -F ../ramdisk.img | gnucpio -o -H newc -O ../roofs.img

3. Error List
When I compiled the Android Source, I have encounterred some of errors.They are in the following list:
#Error 1
javac: 1.5 :can't find file
javac: 999999999: can't find file
...
----------------------
I surfed online and found that it's because there are two or more versions of java.
You should choose one. I remove the old version and assign JAVA_HOME,JDK_HOME to the new version.And I add the JAVA_HOME/bin to PATH,too.
#Error 2
target DEX:core
can't reserve enough space to VM
can't create JVM
----------------------
That's because the space assigned is too large for HOST.
I find the file include 'Xmx*M' in build directory and change it to 'Xmx1400M'.
You can find the proper value for your host by following:
$ java -Xmx1400M -version