OP-TEE / optee_os

Trusted side of the TEE
Other
1.56k stars 1.05k forks source link

question - How do I upload binary? #966

Closed FlynnMa closed 8 years ago

FlynnMa commented 8 years ago

I am using the repo of optee for hikey, without android.

I have found there is miniterm.py under burn-boot folder, I tried to upload a binary file(by command Ctrl+T Ctrl+U), but console dead every time after I started upload. Then I reboot the system, no change on filesystem.

vchong commented 8 years ago

Don't think serial and ssh/scp file transfer are supported. We use a busybox based rootfs, so if you have a usb lan adapter, ftp might work.

Usually we just edit the filelist-tee target in the makefile to add new files to the rootfs, rebuild and reflash so that they're available in the device. You can refer to https://github.com/OP-TEE/build/commit/8519bcf7f51fa613592418227f5db8c6e3af741e for how to do that.

FlynnMa commented 8 years ago

@vchong thanks!

d3zd3z commented 8 years ago

If you don't have lan, you could try enabling 'RX' in the busybox configuration. (you can edit gen_rootfs/generate-cpio-rootfs.sh, and uncomment the make menuconfig line). Once rx is built into the image, use something like 'minicom' to talk to the target (something that supports the x-modem protocol), and running 'rx' on the target should activate that.

jbech-linaro commented 8 years ago

Even if it wouldn't crash, the files wouldn't be saved, since everything is just running from a RAM FS in that configuration. For cases where I've had the need to store things persistently, I've been using pre-built file-systems (Google for "Linaro vivid"), mount those properly instead of just using initramfs based root fs. Some more manual work and that is nothing that we currently have documented. The closest you will get to the behavior you're asking for is the experimental Debian setup which uses the "system" partition for the root fs -> https://github.com/OP-TEE/optee_os#552-debian-based--96boards-rpb-experimental

FlynnMa commented 8 years ago

@d3zd3z,

Thank you, I followed your steps, xmodem works, but I need to type "rx a.bin" before I send from PC side.

d3zd3z commented 8 years ago

I wonder if enabling RX in busybox should just be part of our build? It is useful to be able to send files over. I wish busybox had ry, or rz as well, and the send utilities would be handy as well for pulling things like log files off of the target.

vchong commented 8 years ago

Seems like RX is enabled by default, at least in our builds. Just verified on both hikey and qemu that CONFIG_RX=y and rx is built in gen_rootfs/stage/usr/bin/.