jenswi-linaro / lcu14_optee_hello_world

22 stars 16 forks source link

'/bin/sh: hello_world: not found' #18

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello, after checking all the isues in this thread I'm not able to execute the hello world program in the normal world.

I built the program, copied 8aaaf200-2450-11e4-abe20002a5d5c51b.ta to /lib/teetz , copied the executable hello world to /bin on the host and changed its permission to 755. Also edited the filelist-tee.txt file in gen_rootfs.

After that it keeps telling me not found.

Can someone help me please?

Thank you so much.

vchong commented 8 years ago

What's the error? Cannot find TA? *.ta files should go to /lib/optee_armtz, not /lib/teetz.

ghost commented 8 years ago

The error its not found when I try to execute hello_world in normal world.

I moved *.ta files to /lib/optee_armtz but still getting same error.

vchong commented 8 years ago

You need to rerun make run again under the build folder after updating filelist-tee.txt so the files get inserted into the rootfs.

ghost commented 8 years ago

I did!

pascal-brand38 commented 8 years ago

I used to have such an issue with user-normal-world on 32bits, and kernel-normal-world in 64bits. Is this you setup?

vchong commented 8 years ago

Do a ls -l command under /lib/optee_armtz and /bin and see if the files are there. If not, the filelist-tee.txt file might be incorrect.

ghost commented 8 years ago

I've just found that filelist-tee.txt overwrites content after doing a make all run. Why?

This is the content of the file:

# xtest / optee_test
file /bin/xtest /home/optee/devel/optee/build/../optee_test/out/xtest/xtest 755 0 0
# hello_world / hello_world
file /bin/hello_world /home/optee/devel/optee/build/../optee_test/out/hello_world/hello_world 755 0 0
# TAs
dir /lib/optee_armtz 755 0 0
file /lib/optee_armtz/8aaaf200-2450-11e4-abe20002a5d5c51b.ta /home/optee/devel/optee/build/../optee_test/out/ta/hello_world/8aaaf200-2450-11e4-abe20002a5d5c51b.ta 444 0 0
file /lib/optee_armtz/d17f73a0-36ef-11e1-984a0002a5d5c51b.ta /home/optee/devel/optee/build/../optee_test/out/ta/rpc_test/d17f73a0-36ef-11e1-984a0002a5d5c51b.ta 444 0 0
file /lib/optee_armtz/cb3e5ba0-adf1-11e0-998b0002a5d5c51b.ta /home/optee/devel/optee/build/../optee_test/out/ta/crypt/cb3e5ba0-adf1-11e0-998b0002a5d5c51b.ta 444 0 0
file /lib/optee_armtz/b689f2a7-8adf-477a-9f9932e90c0ad0a2.ta /home/optee/devel/optee/build/../optee_test/out/ta/storage/b689f2a7-8adf-477a-9f9932e90c0ad0a2.ta 444 0 0
file /lib/optee_armtz/8aaaf200-2450-11e4-abe20002a5d5c51b.ta /home/optee/devel/optee/build/../optee_test/out/ta/hello_world/8aaaf200-2450-11e4-abe20002a5d5c51b.ta 444 0 0
file /lib/optee_armtz/c3f6e2c0-3548-11e1-b86c0800200c9a66.ta /home/optee/devel/optee/build/../optee_test/out/ta/create_fail_test/c3f6e2c0-3548-11e1-b86c0800200c9a66.ta 444 0 0
file /lib/optee_armtz/e6a33ed4-562b-463a-bb7eff5e15a493c8.ta /home/optee/devel/optee/build/../optee_test/out/ta/sims/e6a33ed4-562b-463a-bb7eff5e15a493c8.ta 444 0 0
file /lib/optee_armtz/5b9e0e40-2636-11e1-ad9e0002a5d5c51b.ta /home/optee/devel/optee/build/../optee_test/out/ta/os_test/5b9e0e40-2636-11e1-ad9e0002a5d5c51b.ta 444 0 0
# Secure storage dig
dir /data 755 0 0
dir /data/tee 755 0 0
# OP-TEE device
dir /lib/modules 755 0 0
dir /lib/modules/4.1.0-rc1 755 0 0
file /lib/modules/4.1.0-rc1/optee.ko /home/optee/devel/optee/build/../optee_linuxdriver/core/optee.ko 755 0 0
file /lib/modules/4.1.0-rc1/optee_armtz.ko /home/optee/devel/optee/build/../optee_linuxdriver/armtz/optee_armtz.ko 755 0 0
# OP-TEE Client
file /bin/tee-supplicant /home/optee/devel/optee/build/../optee_client/out/export/bin/tee-supplicant 755 0 0
dir /lib/arm-linux-gnueabihf 755 0 0
file /lib/arm-linux-gnueabihf/libteec.so.1.0 /home/optee/devel/optee/build/../optee_client/out/export/lib/libteec.so.1.0 755 0 0
slink /lib/arm-linux-gnueabihf/libteec.so.1 libteec.so.1.0 755 0 0
slink /lib/arm-linux-gnueabihf/libteec.so libteec.so.1 755 0 0

I've just found too that the hello_world executable can be found in /bin from terminal but not found in /bin from normal world.

The ls -l inside /lib/optee_armtz:

issue

And the -ls -l inside /bin screenshot is too large, but I swear that there is a hello world file :)

Now I have to go, tomorrow will continue with this.

So much thank you for your time.

ghost commented 8 years ago

Hi @vchong ! I'm at the office. Can you help me?

Thanks!

ghost commented 8 years ago

@pascal-brand-st-dev I don't know. How can I see the kernel-normal-world architecture?

pascal-brand38 commented 8 years ago

I did not follow carefully all the description you sent. Can you summarize:

Thanks, Pascal.

ghost commented 8 years ago

issue

Thank you so much.

pascal-brand38 commented 8 years ago

Thanks for the info.

I can't find the sha1 696be4cb40e3f7fd27522aa6b6b1f4c2fcf7092b in the manifest :(

Do you think it is possible for you to:

Once everything is ok with the default configuration, it may be easier to integrate the hello world test.

ghost commented 8 years ago

Thanks Pascal, but I have to tell you that xtest runs successfully, the problem is only in the Hello world example.

I don't know if that changes the process you ask to me before.

ghost commented 8 years ago

@pascal-brand-st-dev I've just done what you told me and now it throws me this error when I do a make run:

issue2

pascal-brand38 commented 8 years ago

optee_linuxdriver is neither downloaded nor compiled with the current stable version. So this error is very surprising.

ghost commented 8 years ago

I don't know what happened, but I've done a backup of the virtual machine before doing the repo sync, so we can continue with it (xtest works succesfully).

Edit: I've just run repo sync again and this is the output:

issue

pascal-brand38 commented 8 years ago

I would prefer you start from a brand-new repository, so that it starts from a clean directory (no .repo, ...)

ghost commented 8 years ago

So It will has to wait a little because office proxy block me git downloads so I have to do it with my home connection...

pascal-brand38 commented 8 years ago

Yes please.

I re-tested from scratch, and this is working fine. I followed https://github.com/jenswi-linaro/lcu14_optee_hello_world/blob/master/README.md to download and compile the hello world (using 32bit normal world user space), and I added in build/qemu.mk the following to include the hello world in the rootfs

diff --git a/qemu.mk b/qemu.mk
index b308b0f..d6ae313 100644
--- a/qemu.mk
+++ b/qemu.mk
@@ -129,10 +129,12 @@ xtest-patch: xtest-patch-common
 filelist-tee: xtest
        @echo "# xtest / optee_test" > $(GEN_ROOTFS_FILELIST)
        @find $(OPTEE_TEST_OUT_PATH) -type f -name "xtest" | sed 's/\(.*\)/file \/bin\/xtest \1 755 0 0/g' >> $(GEN_ROOTFS_FILELIST)
+       @echo "file /bin/hello_world $(ROOT)/optee_hello_world/host/hello_world 755 0 0" >> $(GEN_ROOTFS_FILELIST)
        @echo "# TAs" >> $(GEN_ROOTFS_FILELIST)
        @echo "dir /lib/optee_armtz 755 0 0" >> $(GEN_ROOTFS_FILELIST)
        @find $(OPTEE_TEST_OUT_PATH) -name "*.ta" | \
                sed 's/\(.*\)\/\(.*\)/file \/lib\/optee_armtz\/\2 \1\/\2 444 0 0/g' >> $(GEN_ROOTFS_FILELIST)
+       @echo "file /lib/optee_armtz/8aaaf200-2450-11e4-abe20002a5d5c51b.ta $(ROOT)/optee_hello_world/ta/8aaaf200-2450-11e4-abe20002a5d5c
        @echo "# Secure storage dig" >> $(GEN_ROOTFS_FILELIST)
        @echo "dir /data 755 0 0" >> $(GEN_ROOTFS_FILELIST)
        @echo "dir /data/tee 755 0 0" >> $(GEN_ROOTFS_FILELIST)

I really do not see how we can help more :(

ghost commented 8 years ago

Hi @pascal-brand-st-dev, I've just edited build/qemu.mk like you did and it works succesfully!

I didn't find this step nowhere and it looks like it's essential. Maybe you should add to the tutorials.

So much thank you for your time and sorry for the misunderstood.

Cheers from Spain.