用CyanogenMod成功build出I9000(galaxysmtd)的ROM,记录一下build过程中所修改的文件,以便参考。
1.build/core/main.mk
ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0
改为0之后,以后adb shell 自动进入到root
2.build/tools/releasetools/common.py
cmd = [“java”, “-Xmx2048m”, “-jar”, os.path.join(OPTIONS.search_path, “framework”, “signapk.jar”)]
在虚拟机中build,2G内存实在没有,改小成650m了,build时间长点没关系,慢慢等
3.build/envsetup.sh
function mka() 中的下面一行最终被调用进行make,
schedtool -B -n 1 -e ionice -n 1 make -j$(cat /proc/cpuinfo | grep “^processor” | wc -l) “$@” showcommands
如果想在build过程显示详细的命令执行信息,可以加上showcommands
4.build/tools/releasetools/ota_from_target_files
updating_recovery = (source_recovery.data != target_recovery.data)
改为 updating_recovery = False,这样不用update recovery
5.build/tools/roomservice.py
os.system(‘repo sync %s’ % repo_path) 会调用repo sync
fetch_dependencies(repo_path, fallback_branch) 会repo sync依赖的project
如果fetch失败,可以将前面一行注释掉,下次build时跳过repo sync,速度快点
6.生成ota update.zip
./build/tools/releasetools/ota_from_target_files -v -i mnt/build/ota/cm_galaxysmtd-target_files-eng.jfo.20130125.zip mnt/build/ota/cm_galaxysmtd-target_files-eng.jfo.20130214.zip update-20130125_20130214.zip
7.其他编译选项
export OUT_DIR_COMMON_BASE=<path-to-your-out-directory>
make -j4 CYANOGEN_WITH_GOOGLE=true otapackage
8.产生ota package以及签名,参考日志otapkg_cmd
./build/tools/releasetools/ota_from_target_files -v \
-p /home/jfo/android/system/mnt/build/out/system/host/linux-x86 \
-k build/target/product/security/testkey \
–backup=true \
–override_device=galaxys,galaxysmtd,GT-I9000,GT-I9000M,GT-I9000T \
/home/jfo/android/system/mnt/build/out/system/target/product/galaxysmtd/obj/PACKAGING/target_files_intermediates/cm_galaxysmtd-target_files-eng.jfo.zip /home/jfo/android/system/mnt/build/out/system/target/product/galaxysmtd/cm_galaxysmtd-ota-eng.jfo.zip
java -Xmx650m -jar /home/jfo/android/system/mnt/build/out/system/host/linux-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /tmp/tmpi1Xn7t /home/jfo/android/system/mnt/build/out/system/target/product/galaxysmtd/cm_galaxysmtd-ota-eng.jfo.zip
参考:
How To Build CyanogenMod Android for Samsung Galaxy S (“galaxysmtd”) 【文档下载:pdf格式,html格式,png格式】
修改文件列表:modified_files