<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/ DTD/wml_1.1.xml">

<wml>
<head>
<meta http-equiv="cache-control" content="max-age=180,private" />
</head>
<card title="制作ipk软件安装包">
<p>
作者:<a href="index.php?action=showuser&amp;userid=1&amp;hash=">admin</a><br />时间:2011-03-19 14:48<br />分类:<a href="index.php?action=list&amp;cid=3&amp;hash=">电脑技术</a><br />内容:
制作ipk软件安装包



opkg install  http://openwrt.8800.org:82/ipktool_1.0_all.ipk   #安装打包工具

 打包命令
sh /bin/ipkg-build  /mnt/nwan/ /mnt

/mnt/nwan是要打包的目录

 /mnt 是打包后ipk存放目录

要打包的目录包含CONTROL 目录

CONTROL文件夹下的文件意义
 preinst        - 包的预安装测试，在真的包解压之前执行）
 postinst       - 真实安装(在程序文件解压之后执行). 
prerm           - 预卸载(在删除安装文件之前执行). 
postrm         - 卸载(在安装文件被删除后执行). 
conffiles       - 列出软件包的配置文件，在升级包的过程中不会被覆盖掉。 一个ipk包当然要包括程序的所有文件了，

 

把要打包的文件安路径放到/mnt/nwan下

目录结构

root@OpenWrt:/mnt# ls \nwan
CONTROL  etc      lib      usr

root@OpenWrt:/mnt/nwan# find  -name &quot;*&quot;
./etc
./etc/hotplug.d
./etc/hotplug.d/iface
./etc/hotplug.d/iface/09-route
./etc/config
./etc/config/nwan
./etc/init.d
./etc/init.d/nwan
./lib
./lib/uci
./lib/uci/schema
./lib/uci/schema/default
./lib/uci/schema/default/nwan
./lib/nwan
./lib/nwan/flag
./lib/nwan/telecom.rsc
./lib/nwan/unicom.rsc
./lib/nwan/mobile.rsc
./lib/nwan/other.rsc
./lib/nwan/nwan-ping
./lib/nwan/wan_uptime
./lib/nwan/nwan.sh
./usr
./usr/lib
./usr/lib/lua
./usr/lib/lua/luci
./usr/lib/lua/luci/i18n
./usr/lib/lua/luci/i18n/nwan.zh-cn.lmo
./usr/lib/lua/luci/model
./usr/lib/lua/luci/model/cbi
./usr/lib/lua/luci/model/cbi/nwan
./usr/lib/lua/luci/model/cbi/nwan/nwanmini.lua
./usr/lib/lua/luci/model/cbi/nwan/nwan.lua
./usr/lib/lua/luci/controller
./usr/lib/lua/luci/controller/nwan.lua
./CONTROL
./CONTROL/control
./CONTROL/postinst
./CONTROL/postrm

 

 

 

root@OpenWrt:/# sh /bin/ipkg-build  /mnt/nwan/ /mnt
find: unrecognized: -uid
BusyBox v1.15.3 (2010-11-11 23:54:31 PST) multi-call binary

Usage: find [PATH...] [EXPRESSION]

Search for files. The default PATH is the current directory,
default EXPRESSION is '-print'

EXPRESSION may consist of:
        -follow         Dereference symlinks
        -xdev           Don't descend directories on other filesystems
        -maxdepth N     Descend at most N levels. -maxdepth 0 applies
                        tests/actions to command line arguments only
        -mindepth N     Do not act on first N levels
        -name PATTERN   File name (w/o directory name) matches PATTERN
        -iname PATTERN  Case insensitive -name
        -path PATTERN   Path matches PATTERN
        -regex PATTERN  Path matches regex PATTERN
        -type X         File type is X (X is one of: f,d,l,b,c,...)
        -perm NNN       Permissions match any of (+NNN), all of (-NNN),
                        or exactly (NNN)
        -user NAME      File is owned by user NAME (numeric user ID allowed)
        -group NAME     File belongs to group NAME (numeric group ID allowed)
        -depth          Process directory name after traversing it
        -size N[bck]    File size is N (c:bytes,k:kbytes,b:512 bytes(def.)).
                        +/-N: file size is bigger/smaller than N
        -print          Print (default and assumed)
        -print0         Delimit output with null characters rather than
                        newlines
        -exec CMD ARG ; Run CMD with all instances of {} replaced by the
                        matching files
        -prune          Stop traversing current subtree
        (EXPR)          Group an expression

Packaged contents of /mnt/nwan/ into /mnt/nwan_1.0_all.ipk
root@OpenWrt:/#


</p><p>
<a href="index.php?action=login&amp;hash=">立即登陆发表评论</a><br />
</p>
<p><a href="index.php?action=list&amp;hash=">返回日志列表</a><br /><a href="index.php?action=index&amp;hash=">返回主页</a></p>
</card>
</wml>
