How to include a custom ipk in a build


I have an ipk file downloaded from my vpn provider website and I need to include it in my build, is it possible?

1 Like

Not clear what you want to do, but you could add it to your backup archive, and restore it as needed. If you mean adding it to /rom in a buildroot, add it to /buildroot/files/pathto/your.ipk

I mean, Ive downloaded a package (ipk) from github and I would like to add it in my build when I compile it, ie: if luci-app-wireguard.ipk did not exist yet and I would like to add it for myself in my build.....?

Cause when I upload the ipk in LuCi web (software, upload package) when I update my build from master once a week, the the tab disappears in LuCi....I need to upload it again

anyway, with an ipk, I can't add it in menu config as luci-app, right?

Correct. If you have access to the source/Makefile, you can create a local fork that can be incorporated into your buildroot, but with just the compiled .ipk - no.

As a workaround, you could copy the .ipk into ~/buildroot/files/root/your.ipk. It will be populated into /root/your.ipk during the build so you don’t need to DL it again. Then add opkg -d root install yourpackage to etc/rc.local.

did it but still not there after an update

root@OpenWrt:~# ls
root@OpenWrt:~# cd /etc
root@OpenWrt:/etc# cat rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

#echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor; echo performance > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor

opkg -d /root/ install luci-app-tgwireguard_1.0.2-1_all.ipk

exit 0

Follow this section in the wiki

Assuming you use the typical naming conventions for your buildroot host i.e. /home/user/openwrt:

mkdir /home/user/openwrt/files
mkdir /home/user/openwrt/files/root
cp luci-app-tgwireguard_1.0.2-1_all.ipk /home/user/openwrt/files/root/

During your build, the luci-app-tgwireguard_1.0.2-1_all.ipk will be incorporated into your sysupgrade.bin and you will find the .ipk on your router at /root/luci-app-tgwireguard_1.0.2-1_all.ipk

1 Like

yes this is what I did and the file is there in root but this no tab in LuCi, I need to install it again

What happens if you run this on the command line?

root@OpenWrt:~# opkg -d /root/ install luci-app-tgwireguard_1.0.2-1_all.ipk
Collected errors:
 * resolve_pkg_dest_list: Unknown dest name: `/root/'.


My bad

opkg -d root install luci-app-tgwireguard_1.0.2-1_all.ipk

1 Like

I can install it with that command but I just updated my build to see and still not there as a tab...

Did you update /etc/rc.local to reflect the correction?

opkg -d root install luci-app-tgwireguard_1.0.2-1_all.ipk

Yes I did.

OK. Want to fill me in?

Still does not work about having the package installed after update

Works for me.

Details matter. Mind reading is not a skill I possess.

1 Like

thanks anyway for your time

To my knowledge, the -d option in opkg is about the install destination dir, not about the .ipk location.

I would use absolute path.

opkg install /path/to/ipk/ipkname.ipk

1 Like

I agree.

To my understanding the -d option specifies the install destination filesystem set in /etc/opkg/conf, and it expects to find the .ipk in the same filesystem.

i.e. helloworld.ipk resides on 1 of 4 usb partitions.
opkg -d mnt install helloworld will locate/install the helloworld.ipk to /mnt/usr/bin/helloworld

If I instead copy the .ipk to the root fs and run opkg -d root install helloworld it will locate/install the helloworld.ipk to its expected location in /usr/bin/helloworld.

1 Like