Brillo: RPi 2B(树莓派)与brilloemulator-arm相互验证

由于运行Brillo的Raspberrry Pi 2B(树莓派)只是在原来代码的基础上新增了一些文件,原来的文件并没有做改动,所以可以考虑让emulator运行rpi-eng编译出来的代码,或者是让Raspberrry Pi 2B(树莓派)运行brilloemulaotr_arm-eng编译出来的代码。以便进行交叉验证。

  • 让brilloemulator-arm运行由rpi-eng编译出来的代码:

首先要编译brilloemulator-arm所需要的kernel和kernel-dtb文件:

$ . build/envsetup.sh
$ lunch brilloemulator_arm-eng
$ m -j 4 out/host/linux-x86/bin/brilloemuator-arm
$ m -j 4 out/target/product/brilloemulator_arm/kernel

接着编译Raspberry Pi 2B的ramdisk.img与system.img,修改device/hzak/rpi/BoardConfig.mk, 将system分区改成256MB:

$ . build/envsetup.sh
$ lunch rpi-eng
$ m -j 4 out/target/product/rpi/ramdisk.img
$ m -j 4 out/target/product/rpi/system.img

由于编译出来的kernel没有cfg80211与nl80211模块,apmanager服务运行的时候会crash, 需要将apmanager服务关闭并重新生成system.img:

$ rm out/target/product/rpi/system/etc/init/apmanager.rc
$ m snod

再接着做一个虚拟硬盘(sdcard), 使用dd创建文件,再通过fdisk分区:

$ cd out/target/product/rpi
$ dd if=/dev/zero of=mmc.bin bs=$((1024*1024)) count=$((1024+512))
$ cfdisk mmc.bin

创建如下分区:

#Disk mmc.bin: 1610 MB, 1610612736 bytes
#255 heads, 63 sectors/track, 195 cylinders, total 3145728 sectors
#Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x61a15a29

  Device Boot      Start         End      Blocks   Id  System
mmc.bin1            2048      526335      262144   83  Linux
mmc.bin2          526336     1050623      262144   83  Linux
mmc.bin3         1050624     1574911      262144   83  Linux
mmc.bin4         1574912     3145727      785408    5  Extended
mmc.bin5         1576960     2101247      262144   83  Linux
mmc.bin6         2103296     2627583      262144   83  Linux

NOTE: 1个block是1024字节,分区分别为boot, recovery_system, recovery_data, system, data

评论

Be the First to Comment!

提醒我
avatar

wpDiscuz