Build a binary package without SDK?

Hi, I'm trying to package a binary program. It does not need to be compiled. Is there a simpler way to create ipk without setting up the SDK environment? I tried to use opkg-build script from opkg-utils. However, when I install the ipk, it shows

Collected errors:
 * pkg_init_from_file: Malformed package file p.ipk.

I find out that the file type is different, openwrt ipk:

[uuu@hhh ddd]% file adb-enablemodem_2017-03-05-1_aarch64_cortex-a53.ipk
adb-enablemodem_2017-03-05-1_aarch64_cortex-a53.ipk: gzip compressed data, from Unix, original size modulo 2^32 10240

ipk created by opkg-build:

[uuu@hhh ddd]% file p.ipk 
p.ipk: Debian binary package (format 2.0), with control.tar.gz, data compression gz

Hi, I'm trying to package a binary program, the developers provides the programs for multiple targets.. Is it possible to write a Makefile to create multiple ipks for different targets? Are there any examples for this? Thanks.

MODERATOR NOTE: These two posts appear to be very closely related. To ensure that the answers don't become bifrucated between two or more threads, I have merged them into this one.

1 Like

Hello,
I had the same issue using the opkg-build tool from this repo:

after running the command opkg-build , you get the ipk file. Here is what you need to do then:

ar x <malformed package>.ipk
tar czf <proper package>.ipk control.tar.gz data.tar.gz debian-binary

You can then test the file type:

# file adguardhome-wrapper_1.0-1_all_new.ipk
<proper package>.ipk: gzip compressed data, from Unix, original size modulo 2^32 10240

You can then install your ipk file. I tested that to force some postinst operations after installing a package and that worked fine :slight_smile:

ok, looking at the official yocto project git repo, there is a more "built in" way of doing.
https://git.yoctoproject.org/opkg-utils/

Based on the opkg-build tool available with the above link, you need to use the "-c" option to build your package:

opkg-build -c <folder name>

This forces the use of tar instead of ar to build the package