为啥 自己拷贝到单板的程序没有权限运行,将bin 目录下 运来版本可执行程序拷贝 到其它目录没有权限运行 ? Khadas VIM1

为啥 自己拷贝到单板的程序没有权限运行,将bin 目录下 运来版本可执行程序拷贝 到其它目录没有权限运行 ?
console:/storage/6386-08FD #
console:/storage/6386-08FD # cd ldl
console:/storage/6386-08FD/ldl # ls
testchello
console:/storage/6386-08FD/ldl # ls -l
total 32
-rwxrwx–x 1 root sdcard_rw 8144 2020-10-04 06:59 testchello
console:/storage/6386-08FD/ldl # whoami
root
console:/storage/6386-08FD/ldl # ./testchello
/system/bin/sh: ./testchello: can’t execute: Permission denied
126|console:/storage/6386-08FD/ldl # pwd
/storage/6386-08FD/ldl

在linux中,它是这样工作的,
如果我记得正确的话,chmod是基于文件的位置的,则需要使用chmod添加权限以获取访问权限。 因此,更改文件位置将还原权限

更改位置是指? 我编译的程序 无论是放到 TF 卡还是 到单板自带EMMC 都没有权限运行;
我是root 用户,chmod 也没有没有用

@ljp940531 你使用的是什么固件? 你的应用是实现哪些功能的

板子 默认的android 9 还没搞懂怎么换,想先看看应用程序如何换,结果没有权限

console:/ #
console:/ # cat /proc/version
Linux version 4.9.113 (terry@Server) (gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02) ) #9 SMP PREEMPT Sat Mar 14 11:36:27 CST 2020

Load bl33 from eMMC, src: 0x0004c200, des: 0x01000000, size: 0x00081800, part: 0
NOTICE: BL3-1: v1.0(release):53f813e
NOTICE: BL3-1: Built : 15:51:23, May 22 2019
[BL31]: GXL CPU setup!
NOTICE: BL3-1: GXL normal boot!
NOTICE: BL3-1: BL33 decompress pass
mpu_config_enable:system pre init ok
dmc sec lock
[Image: gxl_v1.1.3390-6ac5299 2019-09-26 14:09:24 luan.yuan@droid15-sz]
OPS=0x85
21 0e 85 00 76 98 a1 3f a5 d4 20 e7 06 6d c7 91
[0.521214 Inits done]
secure task start!
high task start!

@ljp940531 关于安卓的问题 @terry @goenjoy 会协助你

可执行文件不要放到TF或者内部存储区域,你要移动到data目录下

移到data 好像不报权限问题,格式不认识,但是 同toybox 格式啊 ,toybox 依赖库不一样,
console:/data/aa #
console:/data/aa # file /system/bin/toybox
/system/bin/toybox: ELF shared object, 32-bit LSB arm, dynamic (/system/bin/linker), for Android 28, BuildID=a12e8f6848b019e0c46970234524d07d, stripped
console:/data/aa #
console:/data/aa # file testchello
testchello: ELF shared object, 32-bit LSB arm, dynamic (/lib/ld-linux-armhf.so.3), BuildID=f1eba1f78d1d868bbd140ce9c24cc18534cf9a87, not stripped
console:/data/aa # pwd
/data/aa
console:/data/aa # ./testchello
sh: ./testchello: No such file or directory

linux环境编译出来的文件,在android上不一定能用的,需要很多的链接库的,你的执行文件,最好是用android环境编译出来的

了解了, 谢谢 thanks ----- !