CONTROL文件夹下的文件意义
preinst        - shell script,在ipk包开始安装前执行;
postinst       - shell script,在ipk包安装后执行; 
prerm           - 在ipk包 remove前执行; 
postrm         - 在ipk包 remove后执行; 

 

例如,在openwrt中要加入一个test-hello包,在test-hello.ipk安装前,需要执行特定的操作,那么就需要用到preinst。

那么,怎么加入指定的脚本呢?

需要在Makefile中加入如下内容(仅是示例)

define Package/$(PKG_NAME)/preinst

#!/bin/sh

echo "test-hello preinst"

exit 0

endef

 

注意:如果脚本执行完毕要取消安装过程,直接让它返回false,即preinst 中exit 1。

相关文章:

  • 2021-11-21
  • 2021-11-21
  • 2021-11-21
  • 2021-08-13
  • 2021-08-02
  • 2021-08-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2021-12-11
  • 2022-01-12
  • 2021-08-27
  • 2021-11-21
相关资源
相似解决方案