“Build Hikey960 on Android 10”的版本间的差异

来自个人维基
跳转至: 导航搜索
(以“#<u>Target</u> AOSP android-10.0.0_r36 kernel: use prebuilt 4.19 Host: server #Note: Use self-built linux still not work. #environment <source lang="c"> ssh -x <u...”为内容创建页面)
 
 
(未显示1个用户的3个中间版本)
第1行: 第1行:
#<u>Target</u>
+
<u>Target</u>
 
AOSP android-10.0.0_r36
 
AOSP android-10.0.0_r36
 
kernel: use prebuilt 4.19
 
kernel: use prebuilt 4.19
 
Host: server
 
Host: server
  
#Note:
+
<u>Note:</u>
Use self-built linux still not work.  
+
* Use self-built linux still not work.  
 +
* Use TARGET_KERNEL_USE=4.14 not work
  
#environment
+
<u>environment</u>
 
<source lang="c">
 
<source lang="c">
 
ssh -x <user>@10.11.60.16 -p2203   
 
ssh -x <user>@10.11.60.16 -p2203   
第22行: 第23行:
 
</source>  
 
</source>  
  
=================
+
* Download  
Download AOSP
+
<source lang="python">
=================
+
cd $PROJ_ROOTDIR
 
#now try this: (74G) 25 hr
 
#now try this: (74G) 25 hr
 
wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar  
 
wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar  
第30行: 第31行:
 
cd ./.repo/manifests; git branch -a
 
cd ./.repo/manifests; git branch -a
 
#checkout a branch
 
#checkout a branch
git checkout <branch> #android-9.0.0_r56
+
git checkout <branch> #android-9.0.0_r56, android-10.0.0_r36
 
repo sync
 
repo sync
 +
#codec patch
 
wget https://dl.google.com/dl/android/aosp/hisilicon-hikey960-OPR-3c243263.tgz  
 
wget https://dl.google.com/dl/android/aosp/hisilicon-hikey960-OPR-3c243263.tgz  
  
 
+
#download kernel
=================
+
Build Kernel
+
=================
+
* Building kernel
+
 
#prebuilt image: https://builds.96boards.org/snapshots/hikey960/linaro/aosp-master/latest/
 
#prebuilt image: https://builds.96boards.org/snapshots/hikey960/linaro/aosp-master/latest/
 +
#git clone https://github.com/96boards-hikey/linux.git
 +
git clone https://android.googlesource.com/kernel/hikey-linaro
 +
cd $KDIR
 +
git checkout -b android-hikey-linaro-$TARGET_KERNEL_USE origin/android-hikey-linaro-$TARGET_KERNEL_USE
 +
</source>
 +
Note: ./include/generated/uapi/linux/version.h
 +
#define LINUX_VERSION_CODE 263227 (=0x04043B)
  
cd $PROJ_ROOTDIR
 
$ git clone https://android.googlesource.com/kernel/hikey-linaro
 
$ cd $KDIR
 
#$ 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
+
* Building kernel
  
$ cp arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb $AOSP_ROOTDIR/device/linaro/hikey-kernel/hi3660-hikey960.dtb-$TARGET_KERNEL_USE
+
<source lang="python">
$ cp arch/arm64/boot/Image.gz $AOSP_ROOTDIR/device/linaro/hikey-kernel/Image.gz-dtb-hikey960-$TARGET_KERNEL_USE
+
make ARCH=arm64 hikey960_defconfig
 +
#check .config CONFIG_MODULES=y
  
 +
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
 +
</source>
  
#CONFIG_MODULES=y
+
* Build AOSP
=================
+
Build AOSP
+
<source lang="python">
=================
+
  
 
cd ${AOSP_ROOTDIR}
 
cd ${AOSP_ROOTDIR}
第66行: 第69行:
 
> output ${AOSP_ROOTDIR}/out/target/product/hikey960/*.img
 
> output ${AOSP_ROOTDIR}/out/target/product/hikey960/*.img
 
#make image only
 
#make image only
$ make bootimage -j24
+
make bootimage -j24
 +
</source>
  
Flash Image
+
*Flash Image
============
+
<source lang="python">
 
cp ${AOSP_ROOTDIR}/out/target/product/hikey960/*.img ~/.
 
cp ${AOSP_ROOTDIR}/out/target/product/hikey960/*.img ~/.
 
$ ./xcp.sh get *.img /mnt/.
 
$ ./xcp.sh get *.img /mnt/.
第80行: 第84行:
 
fastboot flash userdata userdata.img
 
fastboot flash userdata userdata.img
 
fastboot flash vendor vendor.img
 
fastboot flash vendor vendor.img
 +
</source>

2020年5月13日 (三) 19:59的最后版本

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

Note:

  • Use self-built linux still not work.
  • Use TARGET_KERNEL_USE=4.14 not work

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
cd $PROJ_ROOTDIR
#now try this: (74G) 25 hr
wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar 
#see branches
cd ./.repo/manifests; git branch -a
#checkout a branch
git checkout <branch> #android-9.0.0_r56, android-10.0.0_r36
repo sync
#codec patch
wget https://dl.google.com/dl/android/aosp/hisilicon-hikey960-OPR-3c243263.tgz 
 
#download kernel
#prebuilt image: https://builds.96boards.org/snapshots/hikey960/linaro/aosp-master/latest/
#git clone https://github.com/96boards-hikey/linux.git
git clone https://android.googlesource.com/kernel/hikey-linaro
cd $KDIR
git checkout -b android-hikey-linaro-$TARGET_KERNEL_USE origin/android-hikey-linaro-$TARGET_KERNEL_USE

Note: ./include/generated/uapi/linux/version.h

  1. define LINUX_VERSION_CODE 263227 (=0x04043B)


  • Building kernel
make ARCH=arm64 hikey960_defconfig
#check .config CONFIG_MODULES=y
 
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
  • Build AOSP
cd ${AOSP_ROOTDIR}
. ./build/envsetup
lunch hikey960-userdebug
make -j24
> output ${AOSP_ROOTDIR}/out/target/product/hikey960/*.img
#make image only
make bootimage -j24
  • Flash Image
cp ${AOSP_ROOTDIR}/out/target/product/hikey960/*.img ~/.
$ ./xcp.sh get *.img /mnt/.
#Board setting: On-Off-On
#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