base之ipkg

ipkg主页: http://handhelds.org/moin/moin.cgi/Ipkg

 

1.

ipkg的软件包管理信息存储在/usr/lib/ipkg目录。

ipkg

    --alternatives

    --info

    --lists

    --status

 

2.关于"Post Install Scripts"

To add a post-installation script to a package, add a pkg_postinst_PACKAGENAME() function to the .bb file where PACKAGENAME is the name of the package to attach the postinst script to. A post-installation function has the following structure:

The script defined in the post installation function gets called when the rootfs is made. If the script succeeds, the package is marked as installed. If the script fails, the package is marked as unpacked and the script will be executed again on the first boot of the image.

Sometimes it is necessary that the execution of a post-installation script is delayed until the first boot, because the script needs to be executed on the device itself. To delay script execution until boot time, the post-installation function should have the following structure:

The structure above delays execution until first boot because the D variable points to the 'image' directory when the rootfs is being made at build time but is unset when executed on the first boot.

 

同时,在"/etc/rcS.d/S98configure"文件中有这么几行:

参考usage: ipkg [options...] sub-command [arguments...]

where sub-command is one of:

configure [<pkg>]              Configure unpacked packages --重新执行post-installation script

 

综上,在ipkg软件包管理目录的status文件中会记录每个软件包的状态,由此可实现两阶段的"Post Install Scripts"。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
OpenWRT采用ipk包的形式安装软件。ipk包类似于Windows下的安装包,用户可以通过简单的命令将ipk包安装到OpenWRT系统中。这种安装方式非常方便。 在OpenWRT中,ipkg是一种轻量级的软件包管理工具。用户可以使用opkg命令来管理和安装ipk包。通常,用户可以从OpenWRT官方网站下载ipk包,也可以自己创建ipk包进行安装。 常用的opkg命令包括: - `opkg update`:更新软件包列表 - `opkg install <package>`:安装指定的ipk包 - `opkg remove <package>`:卸载指定的软件包 - `opkg list-installed`:列出已安装的软件包 - `opkg list-upgradable`:列出可升级的软件包 通过opkg命令,用户可以方便地安装和管理OpenWRT系统中的软件包。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Openwrt:创建编译IPK软件包](https://blog.csdn.net/qq_28812525/article/details/103935816)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [OpenWrt开发入门培训视频.zip](https://download.csdn.net/download/m0_60797416/81742575)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值