Build error in uboot-tools using turris-build with hbd

I’m trying to use use https://gitlab.labs.nic.cz/turris/turris-build

I’m edited the defaults.sh file and tried changing PUBLISH_BRANCH to hbd, hbk, and hbs and all 3 of them fail while building uboot-tools. The error I see is:

make[3]: Entering directory '/home/dhylands/Raspbian/turris-build/build/package/boot/uboot-tools'
rm -f /home/dhylands/Raspbian/turris-build/build/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-2018.03/.built
touch /home/dhylands/Raspbian/turris-build/build/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-2018.03/.built_check
make -C /home/dhylands/Raspbian/turris-build/build/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-2018.03 CROSS_COMPILE="arm-openwrt-linux-muslgnueabi-" TARGET_CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/home/dhylands/Raspbian/turris-build/build/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-2018.03:u-boot-2018.03 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/dhylands/Raspbian/turris-build/build/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/usr/include" HOSTLDFLAGS= CROSS_BUILD_TOOLS=1 NO_SDL=1 defconfig tools-only envtools
make[4]: Entering directory '/home/dhylands/Raspbian/turris-build/build/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-2018.03'
*** Default configuration is based on 'sandbox_defconfig'
#
# configuration written to .config
#
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  CFG     u-boot.cfg
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  HOSTLD  tools/dumpimage
tools/lib/rsa/rsa-sign.o: In function `rsa_engine_get_priv_key':
rsa-sign.c:(.text+0x78): undefined reference to `ENGINE_get_id'
rsa-sign.c:(.text+0xd0): undefined reference to `ENGINE_load_private_key'
tools/lib/rsa/rsa-sign.o: In function `rsa_engine_init':
rsa-sign.c:(.text+0x40c): undefined reference to `ENGINE_load_builtin_engines'
rsa-sign.c:(.text+0x414): undefined reference to `ENGINE_by_id'
rsa-sign.c:(.text+0x420): undefined reference to `ENGINE_init'
rsa-sign.c:(.text+0x430): undefined reference to `ENGINE_set_default_RSA'
rsa-sign.c:(.text+0x494): undefined reference to `ENGINE_free'
rsa-sign.c:(.text+0x4c4): undefined reference to `ENGINE_finish'
tools/lib/rsa/rsa-sign.o: In function `rsa_sign':
rsa-sign.c:(.text+0x560): undefined reference to `ENGINE_finish'
rsa-sign.c:(.text+0x568): undefined reference to `ENGINE_free'
tools/lib/rsa/rsa-sign.o: In function `rsa_add_verify_data':
rsa-sign.c:(.text+0xbb4): undefined reference to `ENGINE_get_id'
rsa-sign.c:(.text+0xc0c): undefined reference to `ENGINE_load_public_key'
rsa-sign.c:(.text+0xc74): undefined reference to `ENGINE_finish'
rsa-sign.c:(.text+0xc7c): undefined reference to `ENGINE_free'
collect2: error: ld returned 1 exit status
scripts/Makefile.host:108: recipe for target 'tools/dumpimage' failed
make[6]: *** [tools/dumpimage] Error 1
Makefile:1506: recipe for target 'tools-only' failed
make[5]: *** [tools-only] Error 2
Makefile:461: recipe for target '__build_one_by_one' failed
make[4]: *** [__build_one_by_one] Error 2
make[4]: Leaving directory '/home/dhylands/Raspbian/turris-build/build/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-2018.03'
Makefile:94: recipe for target '/home/dhylands/Raspbian/turris-build/build/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-2018.03/.built' failed
make[3]: *** [/home/dhylands/Raspbian/turris-build/build/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-2018.03/.built] Error 2
make[3]: Leaving directory '/home/dhylands/Raspbian/turris-build/build/package/boot/uboot-tools'
time: package/boot/uboot-tools/compile#1.81#0.88#6.60
package/Makefile:107: recipe for target 'package/boot/uboot-tools/compile' failed
make[2]: *** [package/boot/uboot-tools/compile] Error 2
make[2]: Leaving directory '/home/dhylands/Raspbian/turris-build/build'
package/Makefile:103: recipe for target '/home/dhylands/Raspbian/turris-build/build/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.package_compile' failed
make[1]: *** [/home/dhylands/Raspbian/turris-build/build/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/dhylands/Raspbian/turris-build/build'
/home/dhylands/Raspbian/turris-build/build/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

The original commands I ran were:

git clone https://gitlab.labs.nic.cz/turris/turris-build
cd turris-build
edit defauits.sh
mkdir build 
cd build
../compile_pkgs -t omnia -j1

which failed on uboot-tools. I then ran

make -j1 V=s

to get the above more detailed errors

My host system is ubuntu 18.10.

This feels like a configuration issue, but since I’m new to building for the omnia, I’m not sure what settings should be used.

You’re trying to compile branch master in turris-build, which is, in fact, OpenWrt master with also master of OpenWrt packages and our feeds + patches. We have received email notifications from our build system about it as well, however, we haven’t had time to look at it. We will look at today. Once it is fixed, you will need to run git pull and run ./compile-pkgs prepare_tools -t omnia once again.

When it’s fixed, we will let you know.

In the meantime, if you want, you can compile our branch v4.0 (= OpenWrt 18.06.02) from turris-build, known as hbk, hbt and hbs, you need to do git checkout v4.0 and then it should work.

May I know why did you edit file default.sh? It shouldn’t be necessary to edit.
Anyway, could you please use git pull in your turris-build directory and then go to build folder and run ./compile_pkgs -t omnia -e or ./compile_pkgs -t omnia -e prepare_tools? It depends, what exactly do you want to do.

It was basically a misunderstanding on my part. I thought that the way you controlled which build you got was by editing default.sh, but it turns out that the correct way is to checkout the appropriate branch from github. You can then use default.sh to confirm that you’re building what you think you need to.

So I cloned the repository into a new directory (because I had switched to the v4.0 branch in the original repository) and I ran:

mkdir build
cd build
../compile_pkgs -t omnia

which ran for a while and produced:

 make[2] -C feeds/packages/utils/acl compile
 make[2] -C feeds/packages/libs/gnutls compile
make -r package/compile: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
/home/dhylands/turris-build-hbd/build/include/toplevel.mk:216: recipe for target 'package/compile' failed
make: *** [package/compile] Error 1

I did:

make -j1 V=s

and that also eventually failed:

Configuring rpcd-mod-rrdns.
Configuring ppp-mod-pppoe.
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for base-files:
* 	libgcc
* 	libuci
* 	libubus
* 	libjson-c
* 	libubox
* 	libjson-c
* 	libubox
* 	libubus
* 	libuci
* 	libubox
* 	libubus
* 	libubox
* 	libjson-c
* 	libubox
* opkg_install_cmd: Cannot install package base-files.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-ath10k-ct:
* 	kernel (= 4.14.109-1-06f67e14ce4e206c9ce2976e3c34b866.0)
* opkg_install_cmd: Cannot install package kmod-ath10k-ct.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-gpio-button-hotplug:
* 	kernel (= 4.14.109-1-06f67e14ce4e206c9ce2976e3c34b866.0)
....snip....
* opkg_install_cmd: Cannot install package python3-uci.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for socat:
* 	libopenssl
* opkg_install_cmd: Cannot install package socat.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for updater-ng:
* 	liblua
* 	libevent2
* 	libcurl
* opkg_install_cmd: Cannot install package updater-ng.
package/Makefile:65: recipe for target 'package/install' failed
make[2]: *** [package/install] Error 255
make[2]: Leaving directory '/home/dhylands//turris-build-hbd/build'
package/Makefile:104: recipe for target '/home/dhylands//turris-build-hbd/build/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.package_install' failed
make[1]: *** [/home/dhylands//turris-build-hbd/build/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.package_install] Error 2
make[1]: Leaving directory '/home/dhylands//turris-build-hbd/build'
/home/dhylands//turris-build-hbd/build/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

Would you please try it again, but with suggested parameter -e?

I reran with the added -e option and it failed here:

WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-regmap', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-regmap', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-regmap', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-regmap', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-regmap', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-regmap', which does not exist
WARNING: Makefile 'package/feeds/luci/luci-app-cshark/Makefile' has a dependency on 'cshark', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/nfacct/Makefile' has a dependency on 'iptables-mod-nfacct', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/rescue-image/Makefile' has a build dependency on 'uboot-envtools', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/suricata-monitor/Makefile' has a dependency on 'python-bottle', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/turris-netboot/Makefile' has a build dependency on 'openssh-utils', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/turris-netboot/Makefile' has a build dependency on 'openssh-client', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/turris-netboot/Makefile' has a build dependency on 'uboot-envtools', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/turris-translations/Makefile' has a build dependency on 'gettext-tools', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/unbound/Makefile' has a dependency on 'unbound-control', which does not exist
WARNING: Makefile 'package/feeds/turrispackages/unbound/Makefile' has a build dependency on 'libexpat', which does not exist
make[1] package/index
make -r package/index: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
/home/dhylands/turris-build-hbd/build/include/toplevel.mk:216: recipe for target 'package/index' failed
make: *** [package/index] Error 1

I then ran

IGNORE_ERRORS=m make -j1 V=s

and it failed in the same spot as mentioned before:

* opkg_install_cmd: Cannot install package wget.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for knot-dig:
* 	libatomic
* opkg_install_cmd: Cannot install package knot-dig.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for knot-resolver:
* 	libstdcpp
* opkg_install_cmd: Cannot install package knot-resolver.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for libatsha204:
* 	libopenssl
* opkg_install_cmd: Cannot install package libatsha204.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for lighttpd:
* 	libopenssl
* opkg_install_cmd: Cannot install package lighttpd.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for python3-uci:
* 	libuci
* opkg_install_cmd: Cannot install package python3-uci.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for socat:
* 	libopenssl
* opkg_install_cmd: Cannot install package socat.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for updater-ng:
* 	liblua
* 	libevent2
* 	libcurl
* opkg_install_cmd: Cannot install package updater-ng.
package/Makefile:65: recipe for target 'package/install' failed
make[2]: *** [package/install] Error 255
make[2]: Leaving directory '/home/dhylands/turris-build-hbd/build'
package/Makefile:104: recipe for target '/home/dhylands/turris-build-hbd/build/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.package_install' failed
make[1]: *** [/home/dhylands/turris-build-hbd/build/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.package_install] Error 2
make[1]: Leaving directory '/home/dhylands/turris-build-hbd/build'
/home/dhylands/turris-build-hbd/build/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2