Initial RAM filesystem and RAM disk (initramfs/initrd) support () Initramfs source file(s) (NEW) 如果需要支持網(wǎng)絡(luò)啟動(dòng)反選 [] Initial RAM filesystem and RAM disk (initramfs/initrd) support 如果需要支持本地啟動(dòng)選中 Initial RAM filesystem and RAM disk (initramfs/initrd) support 設(shè)置 () Initramfs source file(s) (NEW) 為 root 拷貝 cupcake 編譯結(jié)果 out/target/product/littleton/root/ 到內(nèi)核頂層目錄 3> 編譯 內(nèi)核頂層目錄執(zhí)行 make zImage 編譯好的內(nèi)核: arch/arm/boot/zImage 5. 搭建網(wǎng)絡(luò)開發(fā)環(huán)境 1> 安裝nfs服務(wù)器 sudo apt-get install nfs-kernel-server nfs-common 2> 修改nfs服務(wù)器配置文件/etc/exports ,確保有以下配置項(xiàng) /nfsroot/rootfs *(rw,no_root_squash,sync) 我們?cè)趦?nèi)核中已經(jīng)固定,手機(jī)通過網(wǎng)絡(luò)方式啟動(dòng),默認(rèn)從 /nfsroot/rootfs 讀取文件系統(tǒng),修改配置項(xiàng)后需要重啟nfs服務(wù)器: sudo /etc/init.d/nfs-kernel-server restart 3> 配置網(wǎng)絡(luò)根文件系統(tǒng) 拷貝 out/target/product/littleton/root/ 內(nèi)容到 /nfsroot/rootfs 目錄 拷貝 out/target/product/littleton/system 內(nèi)容到 /nfsroot/rootfs/system 修改 /nfsroot/rootfs/init.rc 去掉幾個(gè)mount命令 為了使大家的過程,結(jié)果統(tǒng)一,可以使用腳本 mkfs.cupcake 完成 在執(zhí)行 mkfs.cupcake.nfs 腳本前先到 cupcake-jianping 目錄下執(zhí)行: . ./make_env15.sh設(shè)置環(huán)境變量, 獲取通過手動(dòng)輸入android源碼的位置,讓腳本來設(shè)置環(huán)境變量。 二 ubuntu下燒錄內(nèi)核和文件系統(tǒng) 1. 硬件: 手機(jī)一臺(tái) usb轉(zhuǎn)串口線一根 usb轉(zhuǎn)網(wǎng)卡線一根 2. 軟件環(huán)境 1> tftp 服務(wù)器 執(zhí)行腳本: setup_tftpd.sh 安裝和配置tftp服務(wù)器,我們默認(rèn)以 /tftpboot 為 tftp服務(wù)器的根目錄,需要下載的文件都放在該目錄下。 2> 獲取待燒錄的鏡像文件 svn list svn://192.168.2.148/smartphone/td0901/release/images 查看服務(wù)器上的 版本情況,通常我們下載最新的,例如,下載9月18號(hào)發(fā)布的版本: svn co svn://192.168.2.148/smartphone/td0901/r ... es20090918 3> 燒錄鏡像文件 用以下文件為例,示范通過tftp燒寫內(nèi)核和文件系統(tǒng) 內(nèi)核 zImage0917 系統(tǒng)分區(qū): system0918.img 數(shù)據(jù)分區(qū) data0918.img 待燒寫的以上文件必須存在于tftp服務(wù)器根目錄/tftpboot下。 具體步驟: 首先連接好硬件設(shè)備進(jìn)入blob下載模式 1> blob 起來后按任意鍵 Processing obm parameters... Can't detect micco. Set PMIC as normal I2C mode. NAND flash(Manu=0x98 Device=0xba) detected! Slot 0 Found get relocation table Found Main Bad block table at address 0x0f000000, version 0x01 Found Mirror Bad block table at address 0x0efc0000, version 0x01 Consider yourself BLOBed! blob version 2.0.5-pre3 for Marvell Littleton Copyright (C) 1999 2000 2001 2002 2003 Jan-Derk Bakker and Erik Mouw blob comes with ABSOLUTELY NO WARRANTY; read the GNU GPL for details. This is free software, and you are welcome to redistribute it under certain conditions; read the GNU GPL for details. length not align with page size, change to 0x0 Read flash from 0x60000, length 0x0 Done Autoboot (2 seconds) in progress, press any key to stop .. Autoboot aborted Type "help" to get a list of commands blob> 2> 通過 tftp 下載內(nèi)核到pc內(nèi)存 0x80800000 地址處 blob> tftp zImage0917 Begin init ether usbnet!!! ***** Plug-in USB cable & config usbdnet now ****** exit check_usb_connection:1 TFTPing zImage0917*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OK. received 6144 blocks (3145156 bytes) tftp_cmd: file 'zImage0917' loaded via tftp to address 0x80800000. 3> 擦除原來的內(nèi)核分區(qū),0x100000 為分區(qū)起始地址,0x300000為分區(qū)長度 blob> nanderase -z 0x100000 0x400000 the current NAND chip does not support Block Unlocking. Erase 0x300000 length data from flash: 0x100000 Erase flash from 0x100000, length 0x300000 ........................Done 4> 燒寫內(nèi)存 0x80800000 開始 實(shí)際長度為 3145156 的內(nèi)核數(shù)據(jù)到起始地址為 0x100000 的內(nèi)核分區(qū) blob> nandwrite -z 0x80800000 0x100000 3145156 the current NAND chip does not support Block Unlocking. Write 0x2ffdc4 length data from RAM: 0x80800000 to flash: 0x100000 Write flash from 0x100000, length 0x2ffdc4 Erase flash from 0x100000, length 0x300000 ........................Done ........................Done 5> 下載系統(tǒng)分區(qū)鏡像文件到pc內(nèi)存 0x80800000 地址處 blob> tftp system0918.img TFTPing system0918.img*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OK. received 113138 blocks (57925824 bytes) tftp_cmd: file 'system0918.img' loaded via tftp to address 0x80800000. 6> 擦除原來的flash系統(tǒng)分區(qū) blob> nanderase -z 0x500000 0x4000000 the current NAND chip does not support Block Unlocking. Erase 0x3e0f800 length data from flash: 0x400000 Erase flash from 0x400000, length 0x3e0f800 ................................................................................... ................................................................................... ................................................................................... ..........................Done 7> 燒寫數(shù)據(jù)到flash系統(tǒng)分區(qū) blob> nandwrite -y 0x80800000 0x500000 57925824 the current NAND chip does not support Block Unlocking. Write 0x373e0c0 length data from RAM: 0x80800000 to flash: 0x400000 Write flash from 0x400000, length 0x3591800 Erase flash from 0x400000, length 0x3591800 .................................................................................... ..................................................................................... ................................................................................Done .................................................................................... .................................................................................... ................................................................Done 8> 下載數(shù)據(jù)分區(qū)鏡像文件到pc內(nèi)存 0x80800000 地址處 blob> tftp data0918.img TFTPing data0918.img*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OK. received 33992 blocks (17402880 bytes) tftp_cmd: file 'data0918.img' loaded via tftp to address 0x80800000. blob> 9> 擦除原來的flash數(shù)據(jù)分區(qū) blob> nanderase -z 0x4500000 0xBB00000 the current NAND chip does not support Block Unlocking. Erase 0xa81f000 length data from flash: 0x4400000 Erase flash from 0x4400000, length 0xa81f000 ..................................................................................... ..................................................................................... ..................................................................................... ..................................................................................... ...................................................Done 10> 燒寫數(shù)據(jù)鏡像到flash數(shù)據(jù)分區(qū) blob> nandwrite -y 0x80800000 0x4500000 17402880 the current NAND chip does not support Block Unlocking. Write 0x1098c00 length data from RAM: 0x80800000 to flash: 0x4400000 Write flash from 0x4400000, length 0x1018000 Erase flash from 0x4400000, length 0x1018000 ..................................................................................Done ..................................................................................Done blob> flash分區(qū)圖: ******************************************* * * * * * * blob * kernel * system * data * * * * * * ******************************************* nanderase -z 0x100000 0x400000 tftp zImage nandwrite -z 0x80800000 0x100000 燒寫system.img: nanderase -z 0x500000 0x4000000 tftp system.img nandwrite -y 0x80800000 0x500000 燒寫 userdata.img : nanderase -z 0x4500000 0xBB00000 tftp userdata.img nandwrite -y 0x80800000 0x4500000 ============================ 涉及的內(nèi)容: svn服務(wù)器的使用 android的編譯系統(tǒng),原理,工具鏈,輔助工具,參數(shù)等,環(huán)境變量,怎樣單獨(dú)添加編譯一個(gè)單獨(dú)的模塊等。 android 的編譯結(jié)果:文件系統(tǒng)分析 文件系統(tǒng)的使用,啟動(dòng)流程 設(shè)置模塊流程分析 ============================ ==================================================== 1. Android編譯系統(tǒng)分析 編譯腳本及系統(tǒng)變量 build/envsetup.sh腳本分析 在編譯源代碼之前通常需要在android源代碼頂層目錄執(zhí)行 . ./build/envsetup.sh 目的是為了使用 腳本 envsetup.sh 里面定義了一些函數(shù): function help() function get_abs_build_var() function get_build_var() function check_product() function check_variant() function setpaths() function printconfig() function set_stuff_for_environment() function set_sequence_number() function settitle() function choosetype() function chooseproduct() function choosevariant() function tapas() function choosecombo() function print_lunch_menu() function lunch() function gettop function m() function findmakefile() function mm() function mmm() function croot() function pid() function gdbclient() function jgrep() function cgrep() function resgrep() function getprebuilt function tracedmdump() function runhat() function getbugreports() function startviewserver() function stopviewserver() function isviewserverstarted() function smoketest() function runtest() function runtest_py() function godir () choosecombo 命令分析: function choosecombo() { choosesim $1 echo echo choosetype $2 echo echo chooseproduct $3 echo echo choosevariant $4 echo set_stuff_for_environment printconfig } 會(huì)依次進(jìn)行如下選擇: Build for the simulator or the device? 1. Device 2. Simulator Which would you like? [1] Build type c