Build Hikey960 on Android 10

来自个人维基
2020年5月7日 (四) 14:14free6d1823讨论 | 贡献的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索
  1. Target

AOSP android-10.0.0_r36
kernel: use prebuilt 4.19
Host: server

  1. Note:

Use self-built linux still not work.

  1. environment
ssh -x <user>@10.11.60.16 -p2203   
export HOME=/data/<user>
*export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
 
export PROJ_ROOTDIR=~/hikey960
export AOSP_ROOTDIR=~/hikey960/aosp
export KDIR=~/hikey960/hikey-linaro
export TARGET_KERNEL_USE=4.19
 
cd $PROJ_ROOTDIR

目录

=====

Download AOSP

=====
  1. now try this: (74G) 25 hr

wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar

  1. see branches

cd ./.repo/manifests; git branch -a

  1. checkout a branch

git checkout <branch> #android-9.0.0_r56
repo sync
wget https://dl.google.com/dl/android/aosp/hisilicon-hikey960-OPR-3c243263.tgz


=====

Build Kernel

=====
  • Building kernel
  1. prebuilt image: https://builds.96boards.org/snapshots/hikey960/linaro/aosp-master/latest/

cd $PROJ_ROOTDIR
$ git clone https://android.googlesource.com/kernel/hikey-linaro
$ cd $KDIR

  1. $ git checkout -b android-hikey-linaro-$TARGET_KERNEL_USE origin/android-hikey-linaro-$TARGET_KERNEL_USE

$ git checkout -b android-hikey-linaro-4.14 origin/android-hikey-linaro-4.14

$ make ARCH=arm64 hikey960_defconfig

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24

$ cp arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb $AOSP_ROOTDIR/device/linaro/hikey-kernel/hi3660-hikey960.dtb-$TARGET_KERNEL_USE
$ cp arch/arm64/boot/Image.gz $AOSP_ROOTDIR/device/linaro/hikey-kernel/Image.gz-dtb-hikey960-$TARGET_KERNEL_USE


  1. CONFIG_MODULES=y
=====

Build AOSP

=====

cd ${AOSP_ROOTDIR}
. ./build/envsetup
lunch hikey960-userdebug
make -j24
> output ${AOSP_ROOTDIR}/out/target/product/hikey960/*.img

  1. make image only

$ make bootimage -j24

Flash Image

==

cp ${AOSP_ROOTDIR}/out/target/product/hikey960/*.img ~/.
$ ./xcp.sh get *.img /mnt/.

  1. Board setting: On-Off-On
  2. In Windows host:

fastboot devices
fastboot flash boot boot.img
fastboot flash dts dt.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash vendor vendor.img