.ipk
本质是tar.gz
格式的压缩包, 按照某种规范格式(类似.deb包
)进行 …
前言
.ipk
本质是tar.gz
格式的压缩包, 按照某种规范格式(类似.deb包
)进行压缩而成的。
- 当我们对它的内容进行操作时候所使用的用户即是它安装后所拥有的用户和权限(
sudo chown root:root -R .
)。
- 已经存在的文件并不能进行替换, 切记。
文件介绍
1 2 3 4
| . ├── control.tar.gz ├── data.tar.gz └── debian-binary
|
control.tar.gz 内容
1 2 3 4
| . ├── control ├── postinst └── postrm
|
control
此处举个栗子
1 2 3 4 5 6 7
| Package: IPKName Version: 1 Section: net Priority: optional Architecture: ar71xx Maintainer: hocgin <[email protected]> Description: my first ipk
|
postinst 安装脚本
因为前言的3
原因, 当我们需要对已存在文件进行修改时, 只能使用写入的方式进行修改。
例如:
1 2
| #!/bin/sh echo "installed done" > /tmp/ipk.log
|
postinst 卸载脚本
自己约的X🤣。。
例如:
1 2
| #!/bin/sh rm -rf /tmp/ipk.log
|
打包~
1
| sudo tar -czf control.tar.gz *
|
data.tar.gz
此处完全是根据你要增加的脚本按根目录进行存放的。
例如:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| . ├── bin │ ├── ss-redir │ └── ss-tunnel ├── data.tar.gz ├── etc │ ├── dnsmasq.d │ │ ├── address.conf │ │ ├── dns.conf │ │ ├── ipset.conf │ │ ├── option.conf │ │ └── server.conf │ ├── pdnsd.conf │ └── shadowsock.json ├── root │ ├── addDnsmasq.sh │ └── changeService.sh └── usr └── sbin └── pdnsd
|
打包~
1
| sudo tar -czf data.tar.gz *
|
最后
将三个文件放在一起进行打包
1
| sudo tar -czf mIPK.ipk *
|