jbech-linaro / docker_optee Goto Github PK
View Code? Open in Web Editor NEWSimple Dockerfile that makes it easy to try OP-TEE using Docker
Simple Dockerfile that makes it easy to try OP-TEE using Docker
cd build && make -j `nproc`
I see the error during the build process, however this doesn't break the build process
make run
actually does not run and the particular gmp.h
file is not available hence I cannot run further.
Not sure if I should post this error here or in one of the op-tee repos, but wanted to know if there is a way to solve this issue?
I follow the Dockerfile, and make one based on ubuntu 20.04 as
FROM alpine:3.17.1 AS repo
WORKDIR /output
RUN apk add git
RUN git clone -b v2.12.2 http://mirrors.ustc.edu.cn/aosp/git-repo.git
RUN cd git-repo chmod u+x repo && cp repo /output/
FROM ubuntu:20.04
# @see https://optee.readthedocs.io/en/latest/building/prerequisites.html#prerequisites
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update &&\
apt install -y \
android-tools-adb \
android-tools-fastboot \
autoconf \
automake \
bc \
bison \
build-essential \
ccache \
cscope \
curl \
device-tree-compiler \
expect \
flex \
ftp-upload \
gdisk \
iasl \
libattr1-dev \
libcap-dev \
libfdt-dev \
libftdi-dev \
libglib2.0-dev \
libgmp3-dev \
libhidapi-dev \
libmpc-dev \
libncurses5-dev \
libpixman-1-dev \
libssl-dev \
libtool \
make \
mtools \
netcat \
ninja-build \
python3-crypto \
python3-cryptography \
python3-pip \
python3-pyelftools \
python3-serial \
rsync \
unzip \
uuid-dev \
xdg-utils \
xterm \
xz-utils \
zlib1g-dev
RUN apt install -y wget cpio git cmake &&\
ln -sf /usr/bin/python3 /usr/bin/python
RUN apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=repo /output/repo /bin/repo
ENV USE_CCACHE=1 \
CCACHE_DIR=/optee/.ccache \
CCACHE_UMASK=002
RUN useradd --shell /bin/bash -u 1000 -o -c "" -m optee && echo 'optee:optee' | chpasswd
RUN mkdir /optee && chown -R optee:optee /optee
USER optee
# Configure git so repo won't complain later on
RUN git config --global user.name "optee"
RUN git config --global user.email "[email protected]"
WORKDIR /optee
RUN repo init -b 3.20.0 -u https://github.com/OP-TEE/manifest.git -m qemu_v8.xml
RUN repo sync -j4 -v
WORKDIR /optee/build
RUN make -j4 toolchains
Start the built image and make run -j8
, and then got errors as
make[1]: Entering directory '/optee/build'
ln -sf /optee/build/../out-br/images/rootfs.cpio.gz /optee/build/../out/bin/
* QEMU is now waiting to start the execution
* Start execution with either a 'c' followed by <enter> in the QEMU console or
* attach a debugger and continue from there.
*
* To run OP-TEE tests, use the xtest command in the 'Normal World' terminal
* Enter 'xtest -h' for help.
cd /optee/build/../out/bin && /optee/build/../qemu/build/aarch64-softmmu/qemu-system-aarch64 \
-nographic \
-serial tcp:localhost:54320 -serial tcp:localhost:54321 \
-smp 2 \
-s -S -machine virt,secure=on,mte=off,gic-version=3,virtualization=false \
-cpu max,pauth-impdef=on \
-d unimp -semihosting-config enable=on,target=native \
-m 1057 \
-bios bl1.bin \
-initrd rootfs.cpio.gz \
-kernel Image -no-acpi \
-append 'console=ttyAMA0,38400 keep_bootcon root=/dev/vda2 ' \
\
-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0,max-bytes=1024,period=1000 -netdev user,id=vmnic -device virtio-net-device,netdev=vmnic
qemu-system-aarch64: -netdev user,id=vmnic: network backend 'user' is not compiled into this binary
make[1]: *** [Makefile:434: run-only] Error 1
make[1]: Leaving directory '/optee/build'
make: *** [Makefile:403: run] Error 2
In a previous issue I asked about adding openssl
to the 'Normal World' environment and was pointed to the common.mk
file in the build
directory. From my investigations of common.mk
it looks as if openssl
should be part of the build.
BR2_PER_PACKAGE_DIRECTORIES ?= y
BR2_PACKAGE_LIBOPENSSL ?= y
BR2_PACKAGE_MMC_UTILS ?= y
BR2_PACKAGE_OPENSSL ?= y
BR2_PACKAGE_OPTEE_BENCHMARK_EXT ?= $(CFG_TEE_BENCHMARK)
BR2_PACKAGE_OPTEE_BENCHMARK_EXT_SITE ?= $(BENCHMARK_APP_PATH)
BR2_PACKAGE_OPTEE_CLIENT_EXT_SITE ?= $(OPTEE_CLIENT_PATH)
BR2_PACKAGE_OPTEE_EXAMPLES_EXT ?= y
BR2_PACKAGE_OPTEE_EXAMPLES_EXT_CROSS_COMPILE ?= $(CROSS_COMPILE_S_USER)
BR2_PACKAGE_OPTEE_EXAMPLES_EXT_SDK ?= $(OPTEE_OS_TA_DEV_KIT_DIR)
BR2_PACKAGE_OPTEE_EXAMPLES_EXT_SITE ?= $(OPTEE_EXAMPLES_PATH)
In examining the 'Normal World' this is what i find
# find | grep -i openssl
./etc/ssl/openssl.cnf
./etc/ssl/openssl.cnf.dist
Other elements from the config show up as would be expected but not openssl
.
In looking through the build of the rootfs.cpio.gz
It looks like that config makes its way to the out-br/defconfig
file via the python script
here.
.PHONY: buildroot
buildroot: optee-os optee-rust
@mkdir -p ../out-br
@rm -f ../out-br/build/optee_*/.stamp_*
@rm -f ../out-br/extra.conf
@$(call append-br2-vars,../out-br/extra.conf)
@(cd .. && $(PYTHON3) build/br-ext/scripts/make_def_config.py \
--br buildroot --out out-br --br-ext build/br-ext \
--top-dir "$(ROOT)" \
--br-defconfig build/br-ext/configs/optee_$(BUILDROOT_ARCH) \
--br-defconfig build/br-ext/configs/optee_generic \
--br-defconfig build/br-ext/configs/$(BUILDROOT_TOOLCHAIN) \
$(DEFCONFIG_GDBSERVER) \
$(DEFCONFIG_XEN) \
$(DEFCONFIG_TSS) \
$(DEFCONFIG_TPM_MODULE) \
$(DEFCONFIG_FTPM) \
--br-defconfig out-br/extra.conf \
--make-cmd $(MAKE))
@$(MAKE) $(br-make-flags) -C ../out-br all
After this i lose my way in the make started by the python script and on that follows below it.
My ultimate goal is to have optee as the keystore for openssl via pkcs11 to workout how this might be used for code signing, etc.
Is there something simple i am missing?
make
with the current configuration will produce a command not found for dtc
.
installing device-tree-compiler
fixed that issue.
In your description for getting xterm working i found that this as the DISPLAY env worked
docker run -it --env="DISPLAY=host.docker.internal:0" -v /tmp/.X11-unix:/tmp/.X11-unix:rw
There is a discussion about it here
https://gist.github.com/cschiewek/246a244ba23da8b9f0e7b11a68bf3285?permalink_comment_id=3477013#gistcomment-3477013
after applying below diff, I succeeded build.
I tested with ubuntu 20.04 & XPS 9570.
diff --git a/Dockerfile b/Dockerfile
index 970351c..a66fbae 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -53,7 +53,9 @@ RUN apt update && apt install -y \
wget \
pkg-config \
cpio \
- meson
+ meson \
+ libgmp3-dev \
+ libmpc-dev
# Download repo
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo
Thanks
Line 11 in 692d37e
Is there a particular reason why the local time is set to a particular asian timezone and not via e.g., volume mounting /etc/localtime
from the host machine into the container?
Hello,
I've already downloaded the docker_optee and setup it correctly.
Now, I'm trying to setup java environment, and run java code in the normal world.
Would it be possible to give me some advice about how to setup java environment to the host side in normal world?
Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.