iPKG包制作(ipkg-build)

部署运行你感兴趣的模型镜像

Maybe this information is of use to someone, so I'll write it down. Maybe it has been mentioned elsewhere already, but you'll have to forgive me then. Better an abundance of information than a shortage, eh?

- Download the latest version of the iPKG tools from ftp://ftp.handhelds.org/packages/ipkg-utils/ (version 1.7 seems to be the latest);
- untar the archive, cd into the just untarred directory, and type 'make install' (make sure you're root);
- open /usr/local/bin/ipkg-build, find the line where it says "outer=ar" (line 159 in version 1.7), and change "ar" into "tar";

That sets up your build environment. From here on it's pretty straightforward. To create a package copy everything you want in it into a directory, in the directorystructure it needs to be on the target device. Also, you need to create a control file with some meta data about the package, and it has to live in the CONTROL directory. e.g. Say I have a binary, foo, and I need it to be available as /bin/foo on the target device. The  procedure would be something like this:

Code:
mkdir -p /tmp/foo/bin
cp foo /tmp/foo/bin
mkdir -p /tmp/foo/CONTROL
cat >/tmp/foo/CONTROL/control <<EOF
Package: foo
Version: 0.1
Architecture: mipsel
Maintainer: foo bar <foo@bar.com>
Section: base
Priority: optional
Description: This package provides foo, which does nothing.
Source: http://foo.bar/foo
EOF
ipkg-build -o root -g root /tmp/foo /tmp

The result will be a package /tmp/foo-0.1_mipsel.ipk, which is ready to install on a standard openwrt distribution.

If modifying your ipkg environment is not an option, there's the possibility to modify your openwrt installation.
A standard ipkg-build produces packages which are basically two tarballs put together with "ar". In a standard openwrt, busybox is compiled without support for "ar", so to use standard iPKG packages in openwrt this has to be compiled back in. Modify buildroot/sources/busybox.config to include "CONFIG_AR=y" (line 39). Then modify buildroot/build_mipsel/root/bin/ipkg to use "ar" for extracting ipkg files (line 729, change "tar" into "ar -p", just like 2 lines below it). Possibly also a symlink has to be made to busybox for ar, so while you're in buildroot/build_mipsel/root/bin/ anyway, type "ln -s busybox ar". Rebuild your openwrt image, and it *should* support standard iPKG packages now...well, except for the ones which were already created for openwrt :-)

Chicken, egg, time to make a decision on whether or not to support standard iPKGs?

That's all for now, more to follow as I progress. Happy packaging.

------------------------------------------------------------------------
openwrt包操作
------------------------------------------------------------------------
如果是下载到的*.ipk,则:
White Russian版本,请使用ipkg命令安装。
ipkg install  软件包名称
对于Kamikaze以及backfire版本,请使用opkg命令安装
opkg install  软件包名称

------------------------------------------------------------------------ ipkg-build
------------------------------------------------------------------------
mkdir -p /tmp/foo/bin
cp foo /tmp/foo/bin
mkdir -p /tmp/foo/CONTROL
cat >/tmp/foo/CONTROL/control <<EOF
Package: foo
Version: 0.1
Architecture: mips   <uname -a 可以查看到linux的类型:mips/others>
Maintainer: foo bar <foo@bar.com>
Section: base
Priority: optional
Description: This package provides foo, which does nothing.
Source: http://foo.bar/foo
EOF
ipkg-build -o root -g root /tmp/foo /tmp
------------------------------------------------------------------------ 测试实例
------------------------------------------------------------------------
../testme/
../testme/CONTROL/  control文件。
../testme/..other   包文件。

kevin@debian:~/test$ ./ipkg-build testme
kevin@debian:~/test$ ls

hellokevin-1.0.0.ipk  ipkg-build  ipkgmake  op  testme  testme_1.0.0_mips.ipk


原博文地址:http://blog.chinaunix.net/uid-22605471-id-1772170.html


您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

cho -e "# disable sysrq menu\nkernel.sysrq = 0" >> /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/etc/sysctl.conf touch /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/CONTROL/conffiles for conffile in /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/etc/config/*; do if [ -f "$conffile" ]; then grep "${conffile##/home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files}" /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/CONTROL/conffiles || echo "${conffile##/home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files}" >> /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/CONTROL/conffiles; fi done echo "::respawn:/sbin/getty 115200 ttyAMA0" >> /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/etc/inittab; sed -i 's/date -u -s 2013.01.01-00:00:00/date -u -s "2013.01.01"-00:00:00/g' /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/etc/init.d/boot; /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/scripts/sgc-addgroup.sh /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_24
03-25
if [ -f "/home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/linux-4.19.294-5.04L.04/bcm963xx/version.make" ]; then mkdir -p /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/lib/modules; cp /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/linux-4.19.294-5.04L.04/bcm963xx/version.make /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/lib/modules/RELEASE; fi mkdir -p /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/opt; mkdir -p /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/opt/filesystem1; mkdir -p /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/opt/filesystem1/rootfs; mkdir -p /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/opt/filesystem1/overlay; mkdir -p /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/opt/rootufs; mkdir -p /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipkg-sagemcom/base-files/opt/squashfs; echo "#!/bin/sh" > /home/g574023/Desktop/code/BP_EXTENDER_SZN_FIBER_2410214/shz_380B-njj/fw-scos/openwrt/build_dir/linux-sagemcom_380B-generic/base-files/ipk
03-25
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值