在Makefile 中,install 时做权限的限制,举例如下
xxxxxxxxxx
define Package/helloworld/install
$(INSTALL_DIR) $(1)/sbin
install -m0705 $(PKG_BUILD_DIR)/helloworld $(1)/sbin/
endef
如上的 -m0705 表示,User权限为7, Group权限为0, Other 权限为5
编译生成的ipk 包安装到设备中,检查应用权限与配置的权限一致,如下
x
root@T-30:20:/tmp# ls -l /sbin/helloworld
-rwx---r-x 1 root root 4139 Nov 9 22:07 /sbin/helloworld