参考:https://nosemaj.org/howto-build-android-kitkat-nexus-5
repo init \
-u git://github.com/jamesonwilliams/platform_manifest.git \
-b android-4.4_r1.1
repo sync
. build/envsetup.sh
lunch aosp_hammerhead-userdebug
make clean
make updatepackage # -j10
遇到的问题有两个:
(1)jdk的问题
答案:使用1.6,并为其设置环境变量;
(2)问题:Can’t use ‘defined(@array)’ (Maybe you should just omit the defined()?) at kernel/timeconst.pl
答案:https://blog.youkuaiyun.com/wsclinux/article/details/77162244
(3)Make版本的问题
答案:直接改成4.1
完整的修改diff文件:
project build/
diff --git a/core/main.mk b/core/main.mk
index d424b25..fe947d6 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -41,7 +41,7 @@ endif
# (Allow any version under Cygwin since we don't actually build the platform there.)
ifeq (,$(findstring CYGWIN,$(shell uname -sm)))
ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.81))
-ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.82))
+ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 4.1))
$(warning ********************************************************************************)
$(warning * You are using version $(MAKE_VERSION) of make.)
$(warning * Android can only be built by versions 3.81 and 3.82.)
project kernel/
diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
index eb51d76..0461239 100644
--- a/kernel/timeconst.pl
+++ b/kernel/timeconst.pl
@@ -370,7 +370,7 @@ if ($hz eq '--can') {
}
@val = @{$canned_values{$hz}};
- if (!defined(@val)) {
+ if (!@val) {
@val = compute_values($hz);
}
output($hz, @val);