Git Product home page Git Product logo

docker_optee's People

Contributors

jbech-linaro avatar mzoubert-forvia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker_optee's Issues

gmp.h not found

Reproduction

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.

Query

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?

make run failed as "network backend 'user' is not compiled into this binary"

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

Openssl availability in 'Normal World'

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 run' failed

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

How to setup java environment in docker_optee

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!

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.