opkg install http:///ipktool.ipk #安裝打包工具 打包命令 sh /bin/ipkg-build /mnt/nwan/ /mnt /mnt/nwan是要打包的目錄 /mnt 是打包後ipk存放目錄 要打包的目錄包含CONTROL 目錄 CONTROL文件夾下的文件意義 preinst - 包的預安裝測試,在真的包解壓之前執行) postinst - 真實安裝(在程序文件解壓之後執行). prerm - 預卸載(在刪除安裝文件之前執行). postrm - 卸載(在安裝文件被刪除後執行). conffiles - 列出軟件包的配置文件,在升級包的過程中不會被覆蓋掉。 一個ipk包當然要包括程序的所有文件了, 把要打包的文件安路徑放到/mnt/nwan下 目錄結構 # ls \nwan CONTROL etc lib usr # find -name "*" ./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 # 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 #
|