- 浏览: 110189 次
- 性别:
- 来自: 北京
最新评论
-
ocean1999:
有代码没 想学习哈 邮箱65614435@qq.com ,非常 ...
使用Google app做了个文件上传网站 http://avatar-share.appspot.com -
mywayscut:
很不错。详细介绍下吧,上传到blob的实现的怎么样的
使用Google app做了个文件上传网站 http://avatar-share.appspot.com
原文地址: System Requirements
For the Impatient
If you already know everything, you can find required steps for Nexus One in summary from this thread. But your mileage may vary.Compiling Android Platform
Google uses Git to as the VCS for both Android and its own Linux kernel. Their source is published on Git web at http://android.git.kernel.org/.
VCS
Here are a couple of Git tutorials for CVS users:
Google publishes its repo tool for managing Android source. Repo does not seem to work on the Linux Kernel source tree though.CHECKING-OUT SOURCE
1. Create two separate directories to hold Andorid platform and its Linux kernel source trees:laptop-2:~/myandroid$ ls
kernel platform
2. Next, change to the platform directory and and initialize the repo.$ cd platform
$HOME repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
The branch name "froyo" can be found on the git web at:
http://android.git.kernel.org/?p=platform/manifest.git;a=summary
Remote branch names can be found in the "heads" section on that web page. $HOME repo sync
This makes "~/myandroid/platform" the root of the platform source tree. We will use "platform" for short in the following examples.BUILDING
$ . build/envsetup.sh
2. If building a phone-specific Android, then build adb first. Otherwise, skip to step six. But note that you can only build a generic Android if you skip device steps. If you flash a generic Android image to your phone, your phone will not even get a radio signal. Nor will you be able to use any buttons on the device. So skip this step only if you just want to play with the emulator.$ make adb
3. Make adb available on the path.$ export $HOME/myandroid/platform/out/host/linux-x86/bin:$PATH
$ which adb
$HOME/myandroid/platform/out/host/linux-x86/bin/adb
4. We need to extract device specific files from Nexus One. Connect the phone to the laptop using the USB cable. The phone needs to be powered on. If the phone has not been set to USB debugging. Set it at:/out/host/linux-x86/bin$ sudo ./adb devices
[sudo] password for userone:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HTXXXXXXXXX device
5. Google Nexus One is HTC Passion. So we now run the Passion-specific extraction script under the "device/htc/passion" directory.
Note that the device files must be extracted from a Android device that matches to your build. Here we extract from a Nexus One with 2.2 update because we are going to build the Froyo branch of the code.$ cd device/htc/passion
/device/htc/passion$./extract-files.sh
Note that adb must be on the path in order for the extraction script to succeed. The extraction script will pull HTC proprietary files from the device and store them under "vendor/htc/passion"./vendor/htc/passion/proprietary$ ls
01_qcomm_omx.cfg libEGL_adreno200.so libOmxVdec.so
AdieHWCodecSetting.csv libGLESv1_CM_adreno200.so libOmxVidEnc.so
akmd libGLESv2_adreno200.so libopencorehw.so
AudioBTID.csv libgps.so libq3dtools_adreno200.so
bcm4329.hcd libgsl.so libqcomm_omx.so
default.acdb libhtc_acoustic.so libstagefrighthw.so
default_att.acdb libhtc_ril.so mm-venc-omx-test
default_france.acdb liblvmxipc.so parse_radio_log
fw_bcm4329_apsta.bin libmm-omxcore.so vpimg
fw_bcm4329.bin liboemcamera.so yamato_pfp.fw
libcamera.so libOmxCore.so yamato_pm4.fw
6. Change back to the root of the source tree and use "lunch" to set up appropriate build environment variables.$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. generic-eng
2. simulator
3. full_dream-userdebug
4. full_passion-userdebug
5. full_sapphire-userdebug
Which would you like? [generic-eng] 4
The "generic-eng" build option will allow you to build an Android that is not device specific. But then you can't really use a generic Android image on a real phone because the generic image does not know how to use device-specific features such as buttons and camera. Nor can the generic image read radio signals. Therefore, the generic-eng build is only useful for emulator purpose. The main difference between generic-eng and userdebug is if the file system is read-write or read-only by default. We will select "full_passion-user-debug" here because we want to flash our images to the device.$ make
Note: When building "full_passion-userdebug" the first time, I hit a compiler error on "librpc.so not found" which caused references in HTC's proprietary libgps to fail compiling. After googling a solution, I found the following workaround:$ mm librpc
$ make
Do not run "make clean" when performing the two steps above. I have since checked out the froyo branch many times and have never encountered this problem again.
The build artifacts are located under the out subdirectory.$ ls out
casecheck.txt CaseCheck.txt debug host target tmp versions_checked.mk
The Android tools for Linux/X86 are located under "host". The device images are under "target".
1. Clone the MSM family of the kernel tree from the Android Git to a working directory. As of July 2010, all HTC Android phones use Qualcomm's MSM family of the CDMA/GSM/UMTS chipsets. Nexus One is no exception.userone@userone-laptop-2:~/myandroid/kernel$ git clone git://android.git.kernel.org/kernel/msm.git .
If building the emulator kernel, use "git://android.git.kernel.org/kernel/common.git" instead.
userone@userone-laptop-2:~/myandroid/kernel$ git checkout --track -b userone-msm-2.6.32-nexusonec remotes/origin/android-msm-2.6.32-nexusonec
When the check out is done, you can use git to verify the branch info.userone@userone-laptop-2:~/myandroid/kernel$ git branch -a
android-msm-2.6.27
userone-msm-2.6.32
* userone-msm-2.6.32-nexusonec
remotes/origin/HEAD -> origin/android-msm-2.6.27
remotes/origin/android-msm-2.6.25
remotes/origin/android-msm-2.6.27
remotes/origin/android-msm-2.6.29
remotes/origin/android-msm-2.6.29-donut
remotes/origin/android-msm-2.6.29-nexusone
remotes/origin/android-msm-2.6.32
remotes/origin/android-msm-2.6.32-nexusonec
remotes/origin/android-msm-htc-2.6.25
remotes/origin/android-msm8k-2.6.29
remotes/origin/msm-2.6.25
The root of the kernel tree is now "userone@userone-laptop-2:~/myandroid/kernel". BUILDING
1. Setup the build environment using the "build/envsetup.sh" script as shown in the platform build. This sets up important cross compiling environment variables for ARM build.
2. Set up environment variables for cross compiling.$ export ARCH=arm
$ CROSS_COMPILE=arm-eabi-
3. Pull the kernel configuration from the device and then build the source. This step is the same for building a kernel for Android emulator.$ adb pull /proc/config.gz
$ gunzip config.gz
$ mv config .config
$ make
The arm target can be found under ..kernel/arch/arm/boot.$ ls arch/arm/boot
bootp compressed Image install.sh Makefile zImage
The newly built kernel is "zImage".$ rm -rf out
$ make -j4 TARGET_PREBUILT_KERNEL=$HOME/myandroid/kernel/arch/arm/boot/zImage
The TARGET_PREBUILT_KERNEL will instruct the Android build system to use our custom-built kernel.Flash Android Image to the Device
Warning!! Flashing images will erase all your user data on the phone!
Warning!! Attempting this at your own Risk!! Your phone will be bricked!!
Warning!! Always have factory images handy so you can recover in case of bricked phones!
# Reboot phone into fastboot: Power off device and hold down trackball while powering back on. (The fastboot screen is the one with the Androids on skateboards)
# Open a command prompt and navigate to your Android SDK tools folder.
# Type ‘fastboot devices‘ to make sure your phone is recognized.
# Type ‘fastboot oem unlock‘ to unlock the bootloader.
# Use volume keys to navigate to yes and press the power button to confirm.
FLASH ANDROID IMAGES TO NEXUS ONE
We now flash android images that we just built to the device.$ sudo $HOME/myandroid/platform/out/host/linux-x86/bin/fastboot -p passion -w flashall
[sudo] password for userone:
< waiting for device >
--------------------------------------------
Bootloader Version...: 0.33.0012
Baseband Version.....: 4.06.00.12_7
Serial Number........: HTXXXXXXXXX
--------------------------------------------
checking mid... OKAY [ 0.003s]
checking product... OKAY [ 0.009s]
checking version-bootloader... OKAY [ 0.002s]
checking version-microp... OKAY [ 0.004s]
checking version-baseband... OKAY [ 0.012s]
sending 'boot' (2336 KB)... OKAY [ 0.366s]
writing 'boot'... OKAY [ 0.917s]
sending 'recovery' (2562 KB)... OKAY [ 0.405s]
writing 'recovery'... OKAY [ 1.048s]
sending 'system' (75301 KB)... OKAY [ 10.943s]
writing 'system'... OKAY [ 25.634s]
erasing 'userdata'... FAILED (remote: not allowed)
finished. total time: 39.418s
The error about failing to erase userdata is because we selected user build (i.e. "userdebug") when building android. We can flash it manually:$ sudo $HOME/myandroid/platform/out/host/linux-x86/bin/fastboot flash userdata $HOME/myandroid/platform/out/target/product/passion/userdata.img
sending 'userdata' (2 KB)... OKAY [ 0.022s]
writing 'userdata'... OKAY [ 4.872s]
finished. total time: 4.894s
If the phone hangs after rebooting, we can restore it back to factory images.RESTORE NEXUS ONE TO FACTORY SETTINGS
1. Download HTC Nexus One images from HTC Dev Center. HTC currently only provides Android 2.1 images for Nexus One. You can use your Google account to get the official 2.2 OTA update after restoring the phone to factory images.
2. Unzip images to a directory.userone@userone-laptop-2:~/Downloads/nexusone$ ls
android-info.txt NexusOne_ERE36B_TMOUS.zip system.img
boot.img recovery.img userdata.img
3. Flash all images to the device using fastboot.
This is the method I used to restore my Nexus One to factory settings.$ sudo $HOME/myandroid/platform/out/host/linux-x86/bin/fastboot flash boot ./boot.img
$ sudo $HOME/myandroid/platform/out/host/linux-x86/bin/fastboot flash recovery ./recovery.img
$ sudo $HOME/myandroid/platform/out/host/linux-x86/bin/fastboot flash system ./system.img
$ sudo $HOME/myandroid/platform/out/host/linux-x86/bin/fastboot flash userdata ./userdata.img
I did not use "fastboot -w flashall" and "fastboot update [some].zip" because they complained about missing files.TIPS
$ adb reboot recovery
$ adb push <recovery-image-package>.zip /sdcard/update.zip
$ sudo fastboot boot arc/arm/boot/zImage
$ adb pull /proc/config.gz
References
发表评论
-
Android Power Manager分析[转载]
2011-07-20 03:06 2573一、Android的电源管理部分文件路径如下: ... -
How BatteryService works in android.
2011-07-14 05:04 2039BatteryService monitors the cha ... -
Android的System Server
2011-06-29 05:26 8682System Server是Android系统的核心,他在Da ... -
Android 编译C模块
2011-06-14 03:57 3402Android 编译环境 本身比较复杂,且不像普通的编 ... -
Activity的启动流程【zhuanzai】
2011-06-12 11:08 2903Activity启动分为很多种情况,这里说的是打开新的应用程序 ... -
Android源码目录结构
2011-05-05 03:24 1605GNU的内核在体积和运行效率上不适合移动设备,系统核心组件都是 ... -
编译Android源码和Linux内核源码时候遇到的一些错误
2011-05-02 02:52 109951. Ubuntu下执行命令 "adb reb ...
相关推荐
This resource is particularly useful for those interested in designing embedded systems based on the Linux kernel, as it covers essential aspects of building, configuring, and customizing the kernel....
标题中提到的几个关键词组成了这篇文章的主要知识点:Building Android for Qemu、Mesa、Virgil3D。在描述中,文章提到了“Running the Linux mainline graphics stack on Android devices”,这暗示了文章将会涉及...
1. **Building the Linux Kernel Image (Section 1.1):** - This section discusses how to compile and build the Linux kernel image. It covers the necessary tools, configurations, and steps required to ...
Updated for the latest version of the Linux kernel, this new edition gives you the basics of building embedded Linux systems, along with the configuration, setup, and use of more than 40 different ...
This new and expanded second edition of Learning Java by Building Android Games shows you how to start building Android games from scratch. The difficulty level will grow steadily as you explore key ...
#### 构建Linux内核映像(Building the Linux Kernel Image) 构建Linux内核是启动过程的第一步。这一阶段涉及源代码的编译与链接,最终产出一个可执行的内核映像文件。开发者通过配置选项调整内核功能,如选择支持...
机器学习核心算法与100个案例的代码实现 Joe Suzuki - Kernel Methods for Machine Learning with Math and Python - 100 Exercises for Building Logic
This hands-on book shows you how to use these open source web standards to design and build apps that can be adapted for any Android device — without having to use Java. You’ll learn how to create...
The Android Developer's Cookbook Building Applications with the Android SDK and Source Project Code 源书(pdf)及源代码12章全都有(rar) Book Description Want to get started building applications for ...
此外,附录A“Tips for Developers and the Future of Mono and Android”为开发者提供了一些额外的技巧,并展望了Mono和Android的未来。 综上所述,这本书是一个全面的Android开发教程,涵盖了从基础概念到高级...
2. Requirements for Building and Using the Kernel . . . . . . . . . . . . . . . . 5 Tools to Build the Kernel 5 Tools to Use the Kernel 6 3. Retrieving the Kernel Source . . . . . . . . . . . . . . . ...
Exploring BeagleBone: Tools and Techniques for Building with Embedded Linux By 作者: Derek Molloy ISBN-10 书号: 1119533163 ISBN-13 书号: 9781119533160 Edition 版本: 2 出版日期: 2019-01-07 pages 页数: ...
6. **开发资源**:从Mentor Embedded Linux (MEL) Kit for PandaBoard获取所需的引导加载程序、预编译的内核、根文件系统和源代码。该资源可以从http://go.mentor.com/linux-kits/ 获取。 更多关于Sourcery ...
文档中提到的“Related titles”部分列举了与Linux内核理解相关的其他资源,如“Building Embedded Linux Systems”、“Linux Device Drivers”、“Linux in a Nutshell”等,这些书名表明了对Linux内核的学习不仅...
Linux Clustering Building and Maintaining Linux Clusters
This hands-on book shows you how to use these open source web standards to design and build apps that can be adapted for any Android device -- without having to use Java. You'll learn how to create ...
Beaglebone Black Ti Linux 内核编译指导手册 This wiki will cover the basic steps for building the Linux kernel.