Building Android Kernel

[from BMB @ stackoverflow]

Since August 2009 the kernel is no longer part of the standard repo manifest that you get when you follow the instructions to download the source code for the android open source project. The steps that are needed to succesfully download, build and run a specific kernel on the emulator are as follows:

  • Get the Android kernel either by adding it to your repo manifest or manually by running: git clone git://android.git.kernel.org/kernel/common.git
  • Check out the correct branch for working with the emulator, i.e. goldfish: git checkout -t origin/android-goldfish-2.6.29 -b goldfish
  • Generate the emulator configuration (qemu emulator runs arm code, i.e. an arm config): make ARCH=arm goldfish_defconfig
  • Now build the kernel using the cross compilation tools distributed with the open source project: make ARCH=arm CROSS_COMPILE=mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-
  • The kernel built this way should end up in the arch/arm/boot folder of your kernel tree (where you put the code from git clone)
  • To run the emulator with your kernel there are two alternatives, either copy it to the prebuilt kernel folder of the open source project to replace the standard kernel. The other option is to start the emulator with the kernel option set: emulator -avd my_avd -kernel mydroid/kernel/common/arch/arm/boot/zImage

Note that I have used the default paths in the above description, you need to change them to what applies to your setup. It has been a some time since last time I tested this but I think it should work.

Some extra information: In the standard Android open source distribution the kernel is distributed as a pre-built binary in the mydroid/prebuilt/android-arm/kernel folder and the source code is not included. The kernel source was removed from the default manifest for two reasons as I take it. One is that it takes a lot of bandwith and diskspace for a platform component that most people will not work with much. The other reason is that since the kernel is built with the kernel build system and not as part of the aosp build system it makes sense to keep it separated. The common branch for the kernel is the one used by the emulator. There are also branches for experimental, msm (Qualcomm platforms) and Omap (TI platform) and maybe some more. If you want to use the Android kernel with hardware these may be more interesting to you.

 

VirtualBox on Headless Gentoo

转载: http://www.nuclex.org/blog/1-personal/97-virtualbox-on-headless-gentoo

1. Install VirtualBox

VirtualBox can be trimmed down so it builds without a graphical client, thereby avoiding any X11 dependencies. Here are the USE flags I set in my /etc/portage/package.use to get rid of most of VirtualBox' dependencies:

###############################################################################
# virtualbox-ose
#
#   headless  Don't build graphical client (avoid X serve dependency)
#   -chm      Don't build CHM viewer for online help
#   -hal      Don't use Hardware Access Layer on host OS
#   -opengl   Disable OpenGL emulation
#   -qt4      Do not use qt4
#
app-emulation/virtualbox-ose headless -chm -hal -opengl -qt4

 

After that is taken care of, emerge VirtualBox on your system:

emerge virtualbox-ose

2. Create a Virtual Machine

Let VirtualBox create a new VM. VirtualBox puts the VM and later its hard drives in the home directory of the user that invoked VBoxManage, so make sure you're logged in as the user you later want to run your VMs with. The Gentoo ebuild for VirtualBox' commercial distribution currently neglects to set up symlinks, so you might have to run the commands (eg. VBoxManage) by specifying their full path (eg. /opt/VirtualBox/VBoxManage instead)

VBoxManage createvm \
  --name "Builder1" \
  --register

Next step: configure it. I'm using 512 MB of RAM and built-in NAT networking because it's way easier to configure than bridged networking and you might not want to expose additional IP addresses through your network adapter in a server environment. VirtualBox' built-in NAT supports port forwarding, so there's really no need for bridging.

VBoxManage modifyvm "Builder1" \
  --memory 512 \
  --acpi on \
  --boot1 dvd \
  --nic1 nat \
  --ostype WindowsXP

You can omit the ostype setting if you wish. This is a hint to VirtualBox about which operating system you plan to install as the guest OS, allowing for some OS-specific optimizations to be performed. I've had BSODs booting my VM if I used Windows 7 with a wrong ostype, so it's probably a good idea to specify this. You can get a list of valid OS identifiers with VBoxManage list ostypes.

Next, create a hard drive image to install the guest operating system on

VBoxManage createhd \
  --filename "Builder1.vdi" \
  --size 16384 \
  --register

Then assign this image to the VM's virtual hard drive:

VBoxManage modifyvm "Builder1" \
  --hda "Builder1.vdi"

(..更多内容)

GoboLinux

Linux 的世界总是有些激动人心的事情发生,最近发现一款Linux发行版—GoboLinux。如果你还为Linux普通的文件树管理方式感到困惑,如果你仍然分不清 /var, /opt, /usr 里面都存放的什么文件,还不知道软件应该安装到 /opt 还是 /usr/local, 试一下GobeLinux吧,软件? 都在Programs 下面,而且还可以多版本共存, 系统都在Systems文件夹下,用户都在Users 文件夹下,是不是清楚明了, 感觉这样才自然。

有空一定要试一下。

官方网站:http://www.gobolinux.org/

下面是官方网站的简介:

What is GoboLinux?

GoboLinux is a modular Linux distribution: it organizes the programs in your system in a new, logical way. Instead of having parts of a program thrown at /usr/bin, other parts at /etc and yet more parts thrown at /usr/share/something/or/another, each program gets its own directory tree, keeping them all neatly separated and allowing you to see everything that's installed in the system and which files belong to which programs in a simple and obvious way.

This is what you see in the root of a GoboLinux system:

~] cd /
/] ls
Programs
Users
System
Files
Mount
Depot

/Programs is where all programs reside. No exceptions. You can explore what is installed in the system by looking inside it:

/] cd /Programs
/Programs] ls

AfterStep     E2FSProgs    Htop        NTP          Subversion
ALSA-Driver   Ed           HTTPD       OpenOffice   Sudo
ALSA-Lib      Eject        Hydrogen    OpenSSH      Swfdec
ALSA-OSS      Elinks       IBM-Java2   OpenSSL      Synaptics
ALSA-Utils    Ethereal     ID3Lib      Pango        SysFSUtils
Ardour        Expat        IEEE80211   Patch        Sysklogd
Audacity      File         IMLib2      Perl         TCL
Aumix         Firefox      InetUtils   Pkgconfig    TeTeX
Autoconf      Flac         Intltool    PodXTPro     Texinfo
Automake      Flex         IpodSlave   Popt         TIFF
Bash          Fontconfig   Iptables    PPP          TiMidity++

...           ...          ...         ...          ...

Each program entry contains all files for that program, stored in a versioned subdirectory.

/Programs] find Bash
Bash
Bash/3.0
Bash/3.0/bin
Bash/3.0/bin/sh
Bash/3.0/bin/bash
Bash/3.0/bin/bashbug
Bash/3.0/info
Bash/3.0/info/bash.info
Bash/3.0/man
Bash/3.0/man/man1
Bash/3.0/man/man1/bash.1
...

Multiple versions of a program can be maintained simultaneously, so you can alternate between them as you desire, or even use both at the same time when necessary.

/Programs] ls -l OpenOffice
total 8
drwxr-xr-x  9 root root 4096 2005-09-22 01:07 1.1.4
drwxr-xr-x  3 root root 4096 2005-09-23 04:36 2.0
lrwxrwxrwx  1 root root    5 2005-09-23 04:36 Current -> 2.0

/Programs] ls -l GTK+
total 12
drwxr-xr-x  10 root root 4096 2005-10-02 01:39 1.2.10
drwxr-xr-x   9 root root 4096 2005-08-21 05:48 2.6.7
lrwxrwxrwx   1 root root    6 2005-10-02 01:39 Current -> 2.6.7
drwxr-xr-x   4 root root 4096 2005-10-02 01:39 Settings

 

flash 本地信息保存设置失败

装好系统,本来想玩会 三国杀 来,结果再等待了近10分钟的下载,加载结束之后,出现了杯具,FlashPlayer 弹出对话框 问我允不允许 保存本地信息,然后我看这 Allow 和 Deny , 点击任何地方无任何反应, Tab能focus 到 Allow 按钮上,但是再按Enter 依然无反应... 本来以为小问题,Google半天无果,网上有人出现过这种情况,在更新Flash版本后解决,我尝试了10.1以后几乎所有版本均无效,怀疑是系统其他地方不兼容,Gentoo+fluxbox 为啥不兼容呢,换 Chrome 问题依旧,折腾一晚上,先这样吧,有人知道什么问题的话,还请告知...

================================

替代方案:使用 Adobe Air 桌面版三国杀, 先安装Adobe Air, 再去下载Air 桌面版。

fontconfig中文版用户手册(version 2.8.0)

又换了台机器,不得已又折腾了一遍Gentoo,这次花时间仔细学习了 Fontconfig 的配置,顺便更新了一下网上流传的 fontconfig用户手册中文版的版本,更新到跟英文版保持一直到2.8.0,放这里备份一下。

Fonts-conf

名称

fonts.conf - 字体配置文件

文件纲要

/etc/fonts/fonts.conf
/etc/fonts/fonts.dtd
~/.fonts.conf

描述

fontconfig 是提供系统范围内字体设置,定制和允许应用程序访问的函数库。

功能概述

fontconfig
包含两个基本的模块,即读取XML文件并建立内部配置的配置模块和接受请求的字体样板
并返回最接近请求字体的匹配模块。

字体设置

fontconfig的配置模块由FcConfig 数据类型,libexpat和FcConfigParse
组成。它扫描一个XML树并将其中的数据处理成一个配置文件。从外部来看,函数库的配
置就是生成一个有效的XML树并将其交给FcConfigParse模块解析。应用程序改变运行中的函数库配置的唯一途径就是添加字体和目录到用户的字体文件列表中。

这样做的目的就是让字体的配置变得相对静态,并且可以尽可能多地让其他应用程序共享。这种做法预计可以在应用程序相互传递字体名称的时候获得相对稳定的字体选择。XML被选为配置文件的标准格式是因为它是一个既便于外部程序编辑又可以保留正确结构和语法的格式。

字体的配置和字体的匹配是分开的。需要采取自身特定匹配方式的应用程序可以从库中访问已有的字体并执行独立的匹配操作。这样做是为了让应用程序可以从字体库中挑选并选定合适的库功能,而不是强迫他们选择这个库或者私有的设置机制。这种做法预计可以让所有应用程序的字体配置集中在一处。集中的字体配置可以标准化和简化字体安装和定制。

字体属性

虽然字体样板可能包含任意基本属性,但还是有一些众所周知的属性及其附带的类型。Fontconfig利用这些属性来匹配和完成字体配置。其他属性则被用来为应用程序的渲染机制提供方便。

属性             类型        描述
-------------------------------------------------------------
family               String        字体家族名称 (宋体,仿宋体等)
familylang        String        家族对应的语言
style                 String        字体风格,覆盖粗度(weight)和倾斜度(slant)。
stylelang          String        风格对应的语言
fullname           String        字体全名(一般包含字体的风格)
fullnamelang    String        全名对应的语言
slant             Int         倾斜度,分为Italic(斜体)oblique(倾斜罗马体)或者roman(罗马体)
weight          Int Light(微粗),medium(稍粗),demibold(略粗),bold(粗)或者black(黑体)
size               Double     尺寸大小
width                  Int        Condensed(压缩),normal(正常)或者expanded(伸展)
aspect            Double     在微调(hinting)前水平拉伸字体
pixelsize          Double     像素大小
spacing          Int         间距,Proportial (可变),dual-width(双倍),monospace (等宽) 或者charcell (字符单元)
foundry         String     字体厂商名称
antialias           Bool         字体渲染是否采用抗锯齿功能
hinting           Bool         渲染引擎是否采用微调
hintstyle             Int        自动微调风格
verticallayout   Bool         采用竖直排版
autohint           Bool         采用自动微调代替普通微调
globaladvance    Bool         使用字体全局数据
file      String     存储字体的文件名称
index      Int         字体文件内的字体索引
ftface     FT_Face     使用指定的Freetype格式对象
rasterizer     String     正在使用的渲染引擎
outline     Bool         字型是否是轮廓字体
scalable     Bool         字型是否可以放缩
scale      Double     点->像素的缩放比例
dpi          Double        目标点数/英寸
rgba      Int         unkonw, rgb, brg, vrgb, vbgr, none - 子像素的几何排列
lcdfilter    Int        LCD显示屏过滤器
minspace     Bool         是否采用最小行间距
charset      CharSet     字体编码的字符集
lang      String     字体支持的RFC-3066-style 语言列表。
fontversion    Int        字体的版本
capability    String        字体的布局能力
embolden    Bool        渲染引擎是否综合的增强字体

(..更多内容)