Git Product home page Git Product logo

optee_android_manifest's Introduction

Android+OP-TEE manifest

This repository contains a local manifest that can be used to build an AOSP build that includes OP-TEE for the hikey board.

1. References

2. Prerequisites

  • Should already be able to build aosp. Distro should have necessary packages installed, and the repo tool should be installed. Note that AOSP 6 needs to be built with Java 1.8. Also make sure that the mtools package is installed, which is needed to make the hikey boot image.

  • In addition, you will need the pre-requisites necessary to build optee-os. Currently, the trusted firmware image is not built as part of these instructions. Please follow the instructions on https://github.com/OP-TEE/optee-os to build that platform for HiKey. This will generate a file arm-trusted-firmware/build/hikey/release/fip.bin that will be needed for flashing.

    After following the AOSP setup instructions, the following additional packages are needed.

$ sudo apt-get install bc ncurses-dev realpath python-crypto \
     android-tools-fsutils dosfstools python-wand

3. Build steps

3.1. In an empty directory, clone the tree:

$ repo init -u https://android.googlesource.com/platform/manifest -b master

3.2. Add the OP-TEE overlay:

$ cd .repo
$ git clone https://github.com/linaro-swg/optee_android_manifest.git local_manifests
$ cd ..

3.3. Sync

$ repo sync

3.4. Download the HiKey vendor binary

$ wget https://dl.google.com/dl/android/aosp/linaro-hikey-20160226-67c37b1a.tgz
$ tar xzf linaro-hikey-20160226-67c37b1a.tgz
$ ./extract-linaro-hikey.sh

3.5. Configure the environment for Android

source ./build/envsetup.sh
lunch hikey-userdebug

3.6. Download the Linaro toolchain

The Linux kernel is built using the Linaro gcc toolchain. Use this helper script to download this for you:

$ ./optee/get_toolchain.sh

3.7. Build the Linux kernel

There is also a helper script to build the Linux kernel. Android typically uses pre-built kernels, so it is necessary to build this manually.

$ ./optee/build_kernel.sh

3.8. Run the rest of the android build, For an 8GB board, use:

make -j32

For a 4GB board, use:

make -j32 TARGET_USERDATAIMAGE_4GB=true

4. Flashing the image

The instructions for flashing the image can be found in detail under device/linaro/hikey/install/README in the tree.

  1. Jumper links 1-2 and 3-4, leaving 5-6 open, and reset the board.
  2. Invoke
./device/linaro/hikey/installer/flash-all.sh /dev/ttyUSBn

where the ttyUSBn device is the one that appears after rebooting with the 3-4 jumper installed. Note that the device only remains in this recovery mode for about 90 seconds. If you take too long to run the flash commands, it will need to be reset again.

5. Partial flashing

The last handful of lines in the flash-all.sh script flash various images. After modifying and rebuilding Android, it is only necessary to flash boot, system, cache, and userdata. If you aren't modifying the kernel, boot is not necessary, either.

This directory contains a prebuilt trusted firmware image fip.bin. If you wish to build the trusted os from source, follow the HiKey instructions in the OP-TEE OS README. After running the build, the fip.bin file will be under

arm-trusted-firmware/build/hikey/release/fip.bin

optee_android_manifest's People

Contributors

d3zd3z avatar

Watchers

 avatar

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.