OP-TEE + Android

Hello,

How can I build OP-TEE with Android on a HiKey board?

First, I found "https://github.com/jforissier/hikey_optee," but it’s outdated and gave me the link "https://github.com/linaro-swg/optee_android_manifest."

It said that
This ‘widevine’ branch adds support for a repo that is only available to certain parties under NDA. If you have access to this repo, you should make sure that you can access it before running the ‘repo sync’, otherwise repo tends to hang. If you do not have access to this repo, you should use the ‘master’ branch.

I tried to use ‘master’ branch, but it looks the same as the result of ‘widevine’ branch.

How can I build them? Can I manually setup each OP-TEE and AOSP?

Thanks,
Dan

Looks like some of the widevine commits got merged by mistake. Thanks for reporting!
We will inform the author for fixes.
In the meantime, please use this workaround:


$ repo init -u https://android.googlesource.com/platform/manifest -b master
$ cd .repo
$ git clone https://github.com/linaro-swg/optee_android_manifest.git local_manifests
$ cd local_manifests
$ git reset --hard b64e87163aeeac8f41566d6241fd8cc7d39b5649
$ cd ../..
$ repo sync

Update: the branches have been fixed so you should be good to go.

Thank you! I will try!

Hi,

I am trying to build OP-TEE with Android on a HiKey board with the above describe procedure but getting an error “config file: out/soong/soong.variables did not parse correctly: invalid character ‘d’ after object key:value pair”.

Can you help me to understand how to remove this error?

Regards,

Above procedure is outdated.
Please start from scratch and follow the instructions in https://github.com/linaro-swg/optee_android_manifest/tree/hikey-n-4.9-master.

Hi,

First command is successful.

repo init -u “https://android-git.linaro.org/git/platform/manifest.git” -b android-7.1.2_r33 -g “default,-non-default,-device,hikey,fugu”
If you want to change this, please re-run ‘repo init’ with --config-name
repo has been initialized in /home/xxx/hikey

Getting an error on second command, please see below

repo init -u /home/ubuntu/aosp-mirror/platform/manifest.git -b android-7.1.2_r33 -g “default,-non-default,-device,hikey,fugu” -p linux
fatal: ‘/home/ubuntu/aosp-mirror/platform/manifest.git’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/manifest.git’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: cannot obtain manifest /home/ubuntu/aosp-mirror/platform/manifest.git

The rest commands are,

~/hikey$ cd .repo
~/hikey/.repo$ git clone “https://android-git.linaro.org/git/platform/manifest.git” -b linaro-nougat-tv local_manifests
Cloning into ‘local_manifests’…
remote: Counting objects: 12545, done.
remote: Compressing objects: 100% (5776/5776), done.
remote: Total 12545 (delta 6822), reused 9280 (delta 5474)
Receiving objects: 100% (12545/12545), 3.50 MiB | 0 bytes/s, done.
Resolving deltas: 100% (6822/6822), done.
Checking connectivity… done.

~/hikey/.repo$ cd local_manifests
~/hikey/.repo/local_manifests$ rm optee.xml
rm: cannot remove ‘optee.xml’: No such file or directory

~/hikey/.repo/local_manifests$ wget “https://raw.githubusercontent.com/linaro-swg/optee_android_manifest/hikey-n-4.9-master/optee.xml
converted ‘https://raw.githubusercontent.com/linaro-swg/optee_android_manifest/hikey-n-4.9-master/optee.xml’ (ANSI_X3.4-1968) → ‘https://raw.githubusercontent.com/linaro-swg/optee_android_manifest/hikey-n-4.9-master/optee.xml’ (UTF-8)
–2017-08-25 13:17:38-- “https://raw.githubusercontent.com/linaro-swg/optee_android_manifest/hikey-n-4.9-master/optee.xml
Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 151.101.112.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.112.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 229 [text/plain]
Saving to: ‘optee.xml’
optee.xml 100%[=====================>] 229 --.-KB/s in 0s
2017-08-25 13:17:38 (3.19 MB/s) - ‘optee.xml’ saved [229/229]

~/hikey/.repo/local_manifests$ cd …/…/

Here, I am failed to fetch the repo,

~/hikey$ repo sync
fatal: ‘/home/ubuntu/aosp-mirror/platform/manifest.git’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/manifest.git’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Fetching project platform/external/mockftpserver
Fetching project platform/packages/services/Telecomm
Fetching project platform/external/curl
Fetching project platform/external/valgrind
fatal: ‘/home/ubuntu/aosp-mirror/platform/external/curl’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/external/valgrind’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/external/mockftpserver’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/packages/services/Telecomm’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/external/curl’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/packages/services/Telecomm’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/external/mockftpserver’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/home/ubuntu/aosp-mirror/platform/external/valgrind’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
error: Cannot fetch platform/external/curl
Fetching project platform/packages/inputmethods/LatinIME
fatal: ‘/home/ubuntu/aosp-mirror/platform/packages/inputmethods/LatinIME’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
error: Cannot fetch platform/external/mockftpserver
error: Cannot fetch platform/packages/services/Telecomm
error: Cannot fetch platform/external/valgrind
fatal: ‘/home/ubuntu/aosp-mirror/platform/packages/inputmethods/LatinIME’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
error: Cannot fetch platform/packages/inputmethods/LatinIME

Regards,

Please do NOT run any commands that start with #$. These are meant to be comments only. I.e. in above, you shouldn’t have run repo init -u /home/ubuntu/aosp-mirror/platform/manifest.git -b android-7.1.2_r33 -g "default,-non-default,-device,hikey,fugu" -p linux. Please try again without it. I’ll also update the page to make this clearer.

Hi,

I am trying to build OP-TEE from the link https://github.com/linaro-swg/optee_android_manifest/tree/hikey-n-4.9-master. Everything is successful except the last step

$ make TARGET_BUILD_KERNEL=true TARGET_BUILD_UEFI=true TARGET_TEE_IS_OPTEE=true CFG_SECURE_DATA_PATH=n TARGET_BOOTIMAGE_USE_FAT=true

However, I haven’t run the step 3.6 as per my understanding it is NO longer require. Please see below and help me to understand the reason and cause of this error.

[ 7% 3587/49755] build out/target/product/hikey/boot_fat.uefi.img
FAILED: /bin/bash -c “(dd if=/dev/zero of=out/target/product/hikey/boot_fat.uefi.img bs=512 count=98304 ) && (mkfs.fat -n “boot” out/target/product/hikey/boot_fat.uefi.img ) && (mcopy -i out/target/product/hikey/boot_fat.uefi.img out/target/product/hikey/kernel ::kernel ) && (mcopy -i out/target/product/hikey/boot_fat.uefi.img out/target/product/hikey/hi6220-hikey.dtb ::hi6220-hikey.dtb ) && (mcopy -s -i out/target/product/hikey/boot_fat.uefi.img device/linaro/hikey/bootloader/* :: ) && (mcopy -i out/target/product/hikey/boot_fat.uefi.img out/target/product/hikey/ramdisk.img ::ramdisk.img )”
98304+0 records in
98304+0 records out
50331648 bytes (50 MB, 48 MiB) copied, 0.098181 s, 513 MB/s
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mkfs.fat 3.0.28 (2015-05-16)
/bin/bash: mcopy: command not found
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target ‘ninja_wrapper’ failed
make: *** [ninja_wrapper] Error 1

Regards,
Moakht

/bin/bash: mcopy: command not found

Do you have mcopy on your pc? If not, install it first. For ubuntu/debian, sudo apt-get install mtools.