Giter VIP home page Giter VIP logo

hikey970-aosp-build's Introduction

Basic directory - /home/maxim/hikey970source/

0. Toolchain && misc
Create folder for toolchain and enter it

mkdir toolchain && cd toolchain

Clone compile toolchain:

git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9

Download and unpack gcc 7.1.1

wget https://releases.linaro.org/components/toolchain/binaries/7.1-2017.08/aarch64-linux-gnu/gcc-linaro-7.1.1-2017.08-x86_64_aarch64-linux-gnu.tar.xz
tar -xzvf gcc-linaro-7.1.1-2017.08-x86_64_aarch64-linux-gnu.tar.xz

1. Bootloader

sudo apt-get install uuid-dev build-essential
mkdir bootloader && cd bootloader
git clone https://github.com/96boards-hikey/tools-images-hikey970.git
git clone https://github.com/96boards-hikey/OpenPlatformPkg.git -b hikey970_v1.0
git clone https://github.com/96boards-hikey/arm-trusted-firmware.git -b hikey970_v1.0
git clone https://github.com/96boards-hikey/l-loader.git -b hikey970_v1.0
git clone https://github.com/96boards-hikey/edk2.git -b hikey970_v1.0
git clone https://github.com/96boards-hikey/uefi-tools.git -b hikey970_v1.0
cd edk2
ln -sf ../OpenPlatformPkg

Replace path to GCC 7.1.1 /home/maxim/hikey970source/toolchain/gcc-linaro-7.1.1-2017.08-x86_64_aarch64-linux-gnu/bin

vim /home/maxim/hikey970source/bootloader/l-loader/build_uefi.sh

Install openssl headers on ubuntu

sudo apt install libssl-dev

Compile:

l-loader/build_uefi.sh hikey970

2. Kernel

mkdir kernel && cd kernel
git clone https://github.com/96boards-hikey/linux.git -b hikey970-v4.9
cd linux
git checkout hikey970-v4.9

Setting environment variables:

export ARCH=arm64
export CROSS_COMPILE=/home/maxim/hikey970source/toolchain/aarch64-linux-android-4.9/bin/aarch64-linux-android-

Making:

make hikey970_defconfig
make -j4
make hisilicon/kirin970-hikey970.dtb

3. AOSP

mkdir aosp && cd aosp
repo init -u https://android.googlesource.com/platform/manifest -b master
git clone https://github.com/96boards-hikey/android-manifest.git -b hikey970_v1.0 .repo/local_manifest
sudo repo sync

Copy for compilation:

kirin970-hikey970.dtb -> kirin970-hikey970.dtb-4.9

cp /home/maxim/hikey970source/kernel/linux/arch/arm64/boot/dts/hisilicon/kirin970-hikey970.dtb /home/maxim/hikey970source/aosp/device/linaro/hikey-kernel/kirin970-hikey.dtv-4.9

Image.gz -> Image.gz-hikey970-4.9

cp /home/maxim/hikey970source/kernel/linux/arch/arm64/boot/Image.gz /home/maxim/hikey970source/aosp/device/linaro/hikey-kernel/Image.gz-hikey970-4.9

Build:

source ./build/envsetup.sh
lunch hikey970-userdebug
make -j$(nproc)

Generate boot.img:

Copy Image and kirin970-hikey970.dtb from kernel directory copy ramdisk.img from android out/

cat Image kirin970-hikey970.dtb > Image-dtb
mkbootimg --kernel Image-dtb --ramdisk ramdisk.img --cmdline "androidboot.hardware=hikey970 firmware_class.path=/system/etc/firmware loglevel=15 buildvariant=userdebug androidboot.selinux=permissive clk_ignore_unused=true initrd=0xBE19D000,0x16677F earlycon=pl011,0xfff32000,115200 console=ttyAMA6 androidboot.serialno=54DA9CD5022525E4 clk_ignore_unused=true" -o boot.img

hikey970-aosp-build's People

Contributors

neonvoice avatar

Forkers

jiapei100

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.