++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
download and compile cm-13-kiwi (begin)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--------------------------------------------------------------
[root@localhost ~]# mkdir /opt/android-x86/cm-13-kiwi/
[root@localhost ~]# cd /opt/android-x86/cm-13-kiwi/
[root@localhost cm-13-kiwi]# dnf install maven
[root@localhost cm-13-kiwi]# ln -s /usr/lib/jvm/java-1.8.0-openjdk /usr/lib/jvm/java-8-openjdk-amd64
[root@localhost cm-13-kiwi]#
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo
chmod a+x /usr/bin/repo
## Initialize the CyanogenMod source repository
repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
## Download the source code
repo sync
[root@localhost cm-13-kiwi]# du -hs .
26G .
[root@localhost cm-13-kiwi]#
--------------------------------------------------------------
####################################
## Prepare the device-specific code
####################################
## https://wiki.cyanogenmod.org/w/Build_for_kiwi
source build/envsetup.sh
breakfast kiwi
-------------------------------------
error
-------------------------------------
[root@localhost cm-13-kiwi]# breakfast kiwi
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:234: *** Can not locate config makefile for product "cm_kiwi"。 停止。
Device kiwi not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Failed to search GitHub
build/core/product_config.mk:234: *** Can not locate config makefile for product "cm_kiwi"。 停止。
** Don't have a product spec for: 'cm_kiwi'
** Do you have the right repo manifest?
[root@localhost cm-13-kiwi]#
-------------------------------------
solution
-------------------------------------
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo
then rerun
repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
repo sync
-------------------------------------
----------------------------------------------------------------------------------------------------------
[root@localhost cm-13-kiwi]# repo sync
正在检出文件: 100% (51996/51996), 完成.
Looking for dependencies
Dependencies file not found, bailing out.
Looking for dependencies
Dependencies file not found, bailing out.
Looking for dependencies
Dependencies file not found, bailing out.
Looking for dependencies
Dependencies file not found, bailing out.
Done
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
CM_VERSION=13.0-20161022-UNOFFICIAL-kiwi
TARGET_PRODUCT=cm_kiwi
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.6.4-301.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
HOST_BUILD_TYPE=release
BUILD_ID=M4B30X
OUT_DIR=/opt/android-x86/cm-13-kiwi/out
============================================
[root@localhost cm-13-kiwi]# source build/envsetup.sh
[root@localhost cm-13-kiwi]# breakfast kiwi
including vendor/cm/vendorsetup.sh
Looking for dependencies
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
CM_VERSION=13.0-20161022-UNOFFICIAL-kiwi
TARGET_PRODUCT=cm_kiwi
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.6.4-301.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
HOST_BUILD_TYPE=release
BUILD_ID=M4B30X
OUT_DIR=/opt/android-x86/cm-13-kiwi/out
============================================
[root@localhost cm-13-kiwi]#
####################################
## Extract proprietary blobs
####################################
## https://wiki.cyanogenmod.org/w/Build_for_kiwi
Now ensure that your Honor 5X is connected to your computer via the USB cable and that you are in the cm-13-kiwi/device/huawei/kiwi directory (you can cd cm-13-kiwi/device/huawei/kiwi if necessary). Then run the extract-files.sh script:
$ ./extract-files.sh
It’s important that these proprietary files are extracted to the cm-13-kiwi/vendor/huawei directory by using the extract-files.sh script.
####################################
## Start the build, the first method
####################################
[root@localhost cm-13-kiwi]# brunch kiwi
including vendor/cm/vendorsetup.sh
Looking for dependencies
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
CM_VERSION=13.0-20161022-UNOFFICIAL-kiwi
TARGET_PRODUCT=cm_kiwi
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.6.4-301.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
HOST_BUILD_TYPE=release
BUILD_ID=M4B30X
OUT_DIR=/opt/android-x86/cm-13-kiwi/out
============================================
make: Entering directory '/opt/android-x86/cm-13-kiwi'
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
CM_VERSION=13.0-20161022-UNOFFICIAL-kiwi
TARGET_PRODUCT=cm_kiwi
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.6.4-301.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
HOST_BUILD_TYPE=release
BUILD_ID=M4B30X
OUT_DIR=/opt/android-x86/cm-13-kiwi/out
============================================
Checking build tools versions...
external/speex/Android.mk:55: TODOArm64: enable neon in libspeex
build/core/base_rules.mk:559: warning: overriding recipe for target '/opt/android-x86/cm-13-kiwi/out/target/product/kiwi/root/res/images/charger/battery_fail.png'
build/core/base_rules.mk:559: warning: ignoring old recipe for target '/opt/android-x86/cm-13-kiwi/out/target/product/kiwi/root/res/images/charger/battery_fail.png'
find: ‘dummy’: No such file or directory
No private recovery resources for TARGET_DEVICE kiwi
Import includes file: /opt/android-x86/cm-13-kiwi/out/host/linux-x86/obj/EXECUTABLES/mkbootimg_intermediates/import_includes
host C: libcompiler_rt-extras <= external/compiler-rt/lib/builtins/mulodi4.c
Import includes file: /opt/android-x86/cm-13-kiwi/out/host/linux-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/import_includes
host C++: libc++abi <= external/libcxxabi/src/abort_message.cpp
host C++: libc++abi <= external/libcxxabi/src/cxa_aux_runtime.cpp
host C++: libc++abi <= external/libcxxabi/src/cxa_default_handlers.cpp
......
----------------------------------------------------------------------------------------------------------
####################################
## Start the build, the second method
####################################
[root@localhost cm-13-kiwi]# lunch cm_kiwi-userdebug
[root@localhost cm-13-kiwi]# m -j32
make: Entering directory '/opt/android-x86/cm-13-kiwi'
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
CM_VERSION=13.0-20161022-UNOFFICIAL-kiwi
TARGET_PRODUCT=cm_kiwi
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.6.4-301.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
HOST_BUILD_TYPE=release
BUILD_ID=M4B30X
OUT_DIR=/opt/android-x86/cm-13-kiwi/out
============================================
external/speex/Android.mk:55: TODOArm64: enable neon in libspeex
----------------------------------------------------------------------------------------------------------
-----------------------
In the root of the source tree, do the following:
[root@localhost cm-13-kiwi]# pwd
/opt/android-x86/cm-13-kiwi
[root@localhost cm-13-kiwi]#
export USE_CCACHE=1
export CCACHE_DIR=/mnt/vm_img/ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G
The suggested cache size is 50-100G.
On Linux, you can watch ccache being used by doing the following:
watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
-----------------------
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.2.fc20.x86_64
export PATH=$JAVA_HOME/bin:$PATH
. build/envsetup.sh
lunch aosp_x86_64-eng
// m -j32 iso_img
m -j32
---------------------
make clean
cd kernel; make mrproper; cd -
mkdir -p /opt/android-x86/cm-13-kiwi/out/target/product/android_x86_64/obj/KERNEL_OBJ/usr
m -j32 iso_img
// make -jx iso_img TARGET_PRODUCT=your-target
// /opt/android-x86/cm-13-kiwi/kernel is not clean, please run 'make mrproper'
// in the '/opt/android-x86/cm-13-kiwi/kernel' directory.
---------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
download and compile cm-13-kiwi (end)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
running_cm-13-kiwi-huawei_on_virtualbox (begin) aiming to get cm_android_x86_64.iso
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@localhost cm-13-kiwi]# pwd
/opt/android-x86/cm-13-kiwi
[root@localhost cm-13-kiwi]#
mkdir -p /opt/android-x86/cm-13-kiwi/out/target/product/android_x86_64/obj/KERNEL_OBJ/usr
cp -r ../cm-x86-13.0-rc1/device/generic/android_x86_64/ device/generic/
// rm device/generic/android_x86_64 -rf
mv device/generic/common/ ../cm-13-kiwi-external-backup/common.org
cp -r ../cm-x86-13.0-rc1/device/generic/common/ device/generic/
// rm device/generic/common -rf
// mv ../cm-13-kiwi-external-backup/common.org device/generic/common
cp -r ../cm-x86-13.0-rc1/device/generic/firmware/ device/generic/
// rm device/generic/firmware -rf
cp -r ../cm-x86-13.0-rc1/bootable/newinstaller/ bootable/
// rm bootable/newinstaller -rf
cp ../cm-x86-13.0-rc1/external/ffmpeg/android/config-x86_64-x86_64.mak external/ffmpeg/android/config-x86_64.mak
// rm external/ffmpeg/android/config-x86_64.mak -f
mv build/core/Makefile ../cm-13-kiwi-external-backup/build.core.Makefile.org
cp ../cm-x86-13.0-rc1/build/core/Makefile build/core/
// mv ../cm-13-kiwi-external-backup/build.core.Makefile.org build/core/Makefile
vim build/core/Makefile
kernel/COPYING \
-> kernel/huawei/kiwi/COPYING \
----------------------
[root@localhost cm-13-kiwi]# vim build/core/product.mk
----------------------
BOARD_RECOVERYIMAGE_PARTITION_SIZE \
BOARD_SYSTEMIMAGE_PARTITION_SIZE \ // delete this line
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE \
----------------------
cp ../cm-x86-13.0-rc1/kernel/arch/x86/configs/android-x86_64_defconfig kernel/huawei/kiwi/arch/x86/configs/
// rm kernel/huawei/kiwi/arch/x86/configs/android-x86_64_defconfig -f
mv external/mesa3d/ ../cm-13-kiwi-external-backup/mesa3d.org
cp -r ../cm-x86-13.0-rc1/external/mesa/ external/
cd external/mesa; ./autogen.sh; cd -
// rm external/mesa -rf
// mv ../cm-13-kiwi-external-backup/mesa3d.org external/mesa3d
--------------------------------------- no use
cd external/mesa3d; ./autogen.sh; cd -
cp external/libdrm/xf86drm.h external/mesa3d/include/
cp external/libdrm/include/drm/drm.h external/mesa3d/include/
cp external/libdrm/include/drm/drm_mode.h external/mesa3d/include/
cp external/drm_gralloc/gralloc_drm_handle.h external/mesa3d/include/
// cd external/mesa3d/include/; /bin/rm xf86drm.h drm.h drm_mode.h gralloc_drm_handle.h; cd -
---------------------------------------
###############################
## important files
###############################
device/generic/android_x86_64/BoardConfig.mk
device/generic/common/BoardConfig.mk
###############################
## A & Q begin
###############################
------------------------------- used to compile kiwi (arm)
make: *** No rule to make target '/opt/android-x86/cm-13-kiwi/out/target/product/kiwi/obj_arm/lib/libtfa9895.so', needed by '/opt/android-x86/cm-13-kiwi/out/target/product/kiwi/obj_arm/SHARED_LIBRARIES/audio_amplifier.msm8916_intermediates/LINKED/audio_amplifier.msm8916.so'。 停止。
make: *** 正在等待未完成的任务....
-------------------------------
Solved this problem by using command:
-------------------------------
https://wiki.cyanogenmod.org/w/Build_for_kiwi
Extract proprietary blobs
-------------------------------
---------------------------------------
[root@localhost cm-13-kiwi]# vim external/mesa3d/src/gallium/Android.mk
---------------------------------------
SUBDIRS += \
winsys/nouveau/drm \
drivers/nouveau \
drivers/nvfx \ ## delete this line
drivers/nv50 \
drivers/nvc0
---------------------------------------
---------------------------------------
[root@localhost cm-13-kiwi]# vim external/mesa3d/src/egl/main/Android.mk
----------------------------
gallium_DRIVERS += \
libmesa_winsys_nouveau \
libmesa_pipe_nvfx \ ## delete this line
libmesa_pipe_nv50 \
libmesa_pipe_nvc0 \
libmesa_pipe_nouveau
---------------------------------------
---------------------------------------
build/core/main.mk:487: BOARD_SYSTEMIMAGE_PARTITION_SIZE has been modified: 0
build/core/main.mk:487: previous value: 1610612736
build/core/main.mk:487: *** The following variables have been changed: BOARD_SYSTEMIMAGE_PARTITION_SIZE。 停止。
---------------------------------------
----------------------
[root@localhost cm-13-kiwi]# vim build/core/product.mk
----------------------
BOARD_RECOVERYIMAGE_PARTITION_SIZE \
BOARD_SYSTEMIMAGE_PARTITION_SIZE \ // delete this line
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE \
----------------------
---------------------------------------
---------------------------------------
make: *** No rule to make target 'external/ffmpeg/libswscale/../android/include/../config-x86_64.mak'。 停止。
---------------------------------------
cp ../cm-x86-13.0-rc1/external/ffmpeg/android/config-x86_64-x86_64.mak external/ffmpeg/android/config-x86_64.mak
// rm external/ffmpeg/android/config-x86_64.mak -f
---------------------------------------
---------------------------------------
make: *** No rule to make target '/opt/android-x86/cm-13-kiwi/out/target/product/android_x86_64/obj/KERNEL_OBJ/usr', needed by '/opt/android-x86/cm-13-kiwi/out/target/product/android_x86_64/obj/SHARED_LIBRARIES/libtinyalsa_intermediates/mixer.o'。 停止。
make: *** 正在等待未完成的任务....
----------------------------
Solved this problem by using command:
mkdir -p /opt/android-x86/cm-13-kiwi/out/target/product/android_x86_64/obj/KERNEL_OBJ/usr
---------------------------------------
---------------------------------------
build/core/tasks/kernel.mk:158: ***************************************************************
build/core/tasks/kernel.mk:159: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:160: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:161: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:162: * source repository to kernel/generic/android_x86_64
build/core/tasks/kernel.mk:163: * See http://wiki.cyanogenmod.org/w/Doc:_integrated_kernel_building
build/core/tasks/kernel.mk:164: * for more information *
build/core/tasks/kernel.mk:165: ***************************************************************
---------------------------------------
---------------------------------------
---------------------------------------
make: *** No rule to make target '/opt/android-x86/cm-13-kiwi/out/target/product/android_x86_64/kernel', needed by '/opt/android-x86/cm-13-kiwi/out/target/product/android_x86_64/cm_android_x86_64.iso'。 停止。
---------------------------------------
---------------------------------------
###############################
## A & Q end
###############################
----------------------------
[root@localhost cm-13-kiwi]# build/core/tasks/kernel.mk
----------------------------
ifeq ($(KERNEL_ARCH),arm64)
# Avoid "unsupported RELA relocation: 311" errors (R_AARCH64_ADR_GOT_PAGE)
MAKE_FLAGS += CFLAGS_MODULE="-fno-pic"
ifeq ($(TARGET_ARCH),arm)
KERNEL_CONFIG_OVERRIDE := CONFIG_ANDROID_BINDER_IPC_32BIT=y
endif
endif
----------------------------
----------------------------
ll build/core/
----------------------------
-rw-r--r--. 1 root root 95995 10月 16 17:09 build/core/definitions.mk // the two files are same
-rw-r--r--. 1 root root 96047 10月 15 22:41 build/core/definitions.mk
-rw-r--r--. 1 root root 95047 10月 16 17:09 build/core/Makefile
-rw-r--r--. 1 root root 95270 10月 15 22:41 build/core/Makefile // differences between the two files
*****************************************************************************
1> [root@localhost cm-13-kiwi]# vim build/core/Makefile
2> [root@localhost cm-x86-13.0-rc1]# vim build/core/Makefile
1> $(intermediate_system_build_prop): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file) $(INSTALLED_ANDROID_INFO_TXT_TARGET)
2> $(intermediate_system_build_prop): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file) $(TARGET_DEVICE_DIR)/BoardConfig.mk $(INSTALLED_ANDROID_INFO_TXT_TARGET)
1> prebuilts/qemu-kernel/arm/LINUX_KERNEL_COPYING \
2> kernel/COPYING \
1> $(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
2>
ifneq (0,$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
$(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
endif
ifneq ($(MKSQUASHFS),)
$(PRODUCT_OUT)/system.sfs: $(BUILT_SYSTEMIMAGE)
$(call build-squashfs-target,$^,$@)
endif
1> $(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
2>
ifneq (0,$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
$(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
endif
*****************************************************************************
----------------------------
----------------------------
ll build/core/tasks/
----------------------------
-rw-r--r--. 1 root root 16066 10月 16 17:09 build/core/tasks/kernel.mk
-rw-r--r--. 1 root root 4291 10月 15 22:41 build/core/tasks/kernel.mk // differences between the two files
*****************************************************************************
*****************************************************************************
----------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
running_cm-13-kiwi-huawei_on_virtualbox (end)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
###############################
## compile
###############################
. build/envsetup.sh
lunch cm_android_x86_64-userdebug
m -j32 iso_img
m -j32
---------------------
make clean
cd kernel; make mrproper; cd -
cd kernel/huawei/kiwi/; make mrproper; cd -