Opkg not found when building 18.06

Hello -

I am trying to build OpenWRT v18.06 from sources. My development host is Ubuntu 18.04.1 LTS running on macOS under Parallels. I've tried to build for both the Raspberry Pi 3+ target and for the YouHua WR1200JS target, following the instructions (here). In both cases, my build fails the same way trying to access the "opkg" file. Here is a snippet of the relevant build output from the router build:

IPKG_NO_SCRIPT=1 IPKG_INSTROOT=/home/parallels/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips TMPDIR=/home/parallels/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/tmp /home/parallels/openwrt/staging_dir/host/bin/opkg --offline-root /home/parallels/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips --force-postinstall --add-dest root:/ --add-arch all:100 --add-arch mipsel_24kc:200 install \
	/home/parallels/openwrt/bin/targets/ramips/mt7621/packages/base-files_194.1-r7636-8a9b0b95df_mipsel_24kc.ipk /home/parallels/openwrt/bin/targets/ramips/mt7621/packages/kmod-gpio-button-hotplug_4.14.89-2_mipsel_24kc.ipk /home/par.....
...
bash: /home/parallels/openwrt/staging_dir/host/bin/opkg: No such file or directory
package/Makefile:65: recipe for target 'package/install' failed
make[2]: *** [package/install] Error 127
make[2]: Leaving directory '/home/parallels/openwrt'
package/Makefile:104: recipe for target '/home/parallels/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install' failed
make[1]: *** [/home/parallels/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install] Error 2
make[1]: Leaving directory '/home/parallels/openwrt'
/home/parallels/openwrt/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

It is true that I have no "opkg" symbolic link or executable in my ~openwrt/staging_dir/host/bin directory. How does that file/link get created from the OpenWRT build?

In trying to track down the problem, I built opkg-0.3.0 from sources for my host:

cd ~/opkg-0.3.0
./configure
make
make install

When I then try to build OpenWRT, I get the following error:

/home/parallels/openwrt/staging_dir/host/bin/opkg: error while loading shared libraries: libopkg.so.1: cannot open shared object file: No such file or directory
package/Makefile:65: recipe for target 'package/install' failed

I would certainly appreciate any suggestions for resolving this issue.

Regards,
Brian

Im not sure how , but i think your make is somehow resolving to binaries not in the toolchain (ie. picking up standard ubuntu binaries/libs) instead of the buildroot binaries . (Or the toolchain binaries)

I skimmed through that blog and the steps look the same, but there might be something missing - take a look at the openwrt docs:

https://openwrt.org/docs/guide-developer/build-system/install-buildsystem

https://openwrt.org/docs/guide-developer/build-system/use-buildsystem

https://openwrt.org/docs/guide-developer/build-system/start

@Sparks -

Thank you much for the reply. Your theory certainly seemed plausible, especially since I experienced the same build failure for multiple device targets. My build did essentially follow the install/use openwrt docs, so I tried again hosting from a fresh Ubuntu VM. That worked for both build targets. Perhaps there was a conflict with the $PATH or other environment variable settings in my original VM that led to the binary failures.

I also built with IGNORE_ERRORS set to 1. That also might have also contributed to the build failure, since "opkg" appears to be generated late in the build.

For the WR1200JS router target, I was able to build using multiple cores:

IGNORE_ERRORS=1 make V=s -j4

For the Raspberry Pi 3 target, I found that the build only succeeded using one core:

IGNORE_ERRORS=1 make V=s -j1

In both cases I did a "make download" before kicking off the main build.

Regards,
Brian

1 Like

Awesome. Glad to hear you figured it out :+1:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.