[SOLVED] Need help building Turris OS for Omnia

I am trying to get toolchain working on my machine, but without vagrant I cannot compile it since the code of many tools is incompatible with the recent glibc versions. Using vagrant, however I faced the issue with cloning from git.openwrt.org:

fatal: unable to access ‘git.openwrt.org Git - project/libubox.git/summary’: gnutls_handshake() failed: Error in the push function.

I tried to follow a solution described in [SOLVED] Cant build turris-os - #5 by hurzhurz - Turris Omnia - Turris forum, but it just changed an error message to another one:

OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to git.openwrt.org:443

Could someone please help me?

1 Like

Both of your Git clones seem to fail on SSL. Do you have certificates installed on your system?

As I said, that issue happens when I am using vagrant.

What’s your guest VM and distro? You can try updating your “ca-certificates” or similar package on your guest system.

config.vm.box = “fgrehm/trusty64-lxc”

is used in turris-os vagrant config. ca-certificates were updated, however, I updated everything and the error message changed to:

Unknown SSL protocol error in connection to git.lede-project.org:443

when using openssl and remain the same when using gnutls

I decided to go another way and fix incompatibilities with the latest glibc. I have written patches for bison, e2fsprogs, m4, make-ext4fs, mtd-utils, squashfs4, util-linux to make compile on my host system.

Now the build fails because of that:

staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-4.8-linaro_musl-1.1.15_eabi/arm-openwrt-linux-muslgnueabi/bin/ld: cannot find -ltinfo

However, /usr/bin/ld -ltinfo works just fine. I am on something like ubuntu cosmic by the way.

I did another attempt today. Making the sources of Turris OS compiling on the recent distros seems to require a lot of work. Not only glibc causes incompatibility but at least openssl does it too. So I returned to the original way of building it inside of the vagrant container.

  1. I workarounded the issue with SSL on git.openwrt.org by adding proxy to that site into my nginx server. I replaced all mentions of git.openwrt.org and lede-project.org (http, https and git) with the url https://mysite/git.openwrt.org. That let me go further and a bit later compilation stopped with the error ld: cannot find -lpython2.7
  2. I fixed that issue by apt install libpython2.7-dev inside the LXC container.
  3. Now the build fails with the error:

SHELL= flock /openwrt/tmp/.QCA988X-firmware-2-ct-full-community-21.bin.lede.002.flock -c ’ /openwrt/scripts/download.pl “/openwrt/dl” “QCA988X-firmware-2-ct-full-community-21.bin.lede.002” “354b8a116a406ba6521a8bf6165ea2dce76996ab36e7905cd71e772ea240017d” “firmware-2-ct-full-community-21.bin.lede.002” “Index of /downloads”’
–2019-02-09 16:14:43-- https://repo.turris.cz/downloads/firmware-2-ct-full-community-21.bin.lede.002
Resolving repo.turris.cz (repo.turris.cz)… 217.31.192.69, 2001:1488:ac15:ff80::69
Connecting to repo.turris.cz (repo.turris.cz)|217.31.192.69|:443… connected.
HTTP request sent, awaiting response… 404 Not Found
2019-02-09 16:14:43 ERROR 404: Not Found.

Download failed.
–2019-02-09 16:14:43-- https://www.candelatech.com/downloads/firmware-2-ct-full-community-21.bin.lede.002
Resolving www.candelatech.com (www.candelatech.com)… failed: Name or service not known.
wget: unable to resolve host address ‘www.candelatech.com
Download failed.
–2019-02-09 16:15:02-- https://repo.turris.cz/downloads/firmware-2-ct-full-community-21.bin.lede.002
Resolving repo.turris.cz (repo.turris.cz)… 217.31.192.69, 2001:1488:ac15:ff80::69
Connecting to repo.turris.cz (repo.turris.cz)|217.31.192.69|:443… connected.
HTTP request sent, awaiting response… 404 Not Found
2019-02-09 16:15:02 ERROR 404: Not Found.

Download failed.
–2019-02-09 16:15:02-- http://sources.lede-project.org/firmware-2-ct-full-community-21.bin.lede.002
Resolving sources.lede-project.org (sources.lede-project.org)… 148.251.78.235, 2a01:4f8:202:43ea::3
Connecting to sources.lede-project.org (sources.lede-project.org)|148.251.78.235|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2019-02-09 16:15:02 ERROR 404: Not Found.

Download failed.
–2019-02-09 16:15:02-- http://mirror2.openwrt.org/sources/firmware-2-ct-full-community-21.bin.lede.002
Resolving mirror2.openwrt.org (mirror2.openwrt.org)… 46.4.11.11, 2a01:4f8:221:3d45::2
Connecting to mirror2.openwrt.org (mirror2.openwrt.org)|46.4.11.11|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2019-02-09 16:15:03 ERROR 404: Not Found.

Download failed.
–2019-02-09 16:15:03-- http://downloads.openwrt.org/sources/firmware-2-ct-full-community-21.bin.lede.002
Resolving downloads.openwrt.org (downloads.openwrt.org)… 148.251.78.235, 2a01:4f8:202:43ea::2
Connecting to downloads.openwrt.org (downloads.openwrt.org)|148.251.78.235|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: http://sources.openwrt.org/firmware-2-ct-full-community-21.bin.lede.002 [following]
–2019-02-09 16:15:03-- http://sources.openwrt.org/firmware-2-ct-full-community-21.bin.lede.002
Resolving sources.openwrt.org (sources.openwrt.org)… 148.251.78.235, 2a01:4f8:202:43ea::3
Reusing existing connection to downloads.openwrt.org:80.
HTTP request sent, awaiting response… 404 Not Found
2019-02-09 16:15:03 ERROR 404: Not Found.

Download failed.
No more mirrors to try - giving up.
make[3]: *** [/openwrt/dl/QCA988X-firmware-2-ct-full-community-21.bin.lede.002] Error 2
make[3]: Leaving directory /openwrt/package/firmware/ath10k-firmware' make[2]: *** [package/firmware/ath10k-firmware/compile] Error 2 make[2]: Leaving directory /openwrt’
make[1]: *** [/openwrt/staging_dir/target-arm_cortex-a9+vfpv3_musl-1.1.15_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory `/openwrt’
make: *** [world] Error 2

The nginx configuration for proxifying git.openwrt.org is the following:

	location /git.openwrt.org/ {
        proxy_read_timeout      300;
        proxy_connect_timeout   300;
        proxy_redirect          off;
        proxy_set_header        Host                $http_host;
        proxy_set_header        X-Real-IP           $remote_addr;
        proxy_set_header        X-Forwarded-For     $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto   https;
        proxy_set_header        X-Frame-Options     SAMEORIGIN;
        proxy_pass              https://git.openwrt.org/;
    }

I have manually patched turris-os/package/firmware/ath10k-firmware/Makefile and restarted the build and after about two hours (I did it in a single-threaded mode), turris-os/bin-nand/mvebu-musl appeared:
image
package directory contains 1295 .ipk files plus some Packages files
Does that mean that build completed?
I am asking because it ended with that:

Generating index for package ./poppler_0.24.1-1_mvebu.ipk
Generating index for package ./qpdf_6.0.0-1_mvebu.ipk
Signing key has not been configured
make[2]: Leaving directory `/openwrt'
make[1]: Leaving directory `/openwrt'
+ ./scripts/unpack-version.sh bin/mvebu-musl/packages bin/mvebu-musl/
+ '[' -n '' ']'
+ ./scripts/generate_junit.sh
Directory /openwrt/logs doesn't exist!
Skipping junit output
+ '[' '!' -d ./logs ']'
+ '[' '!' -d ./logs ']'
++ git log --format=format:%cD -1
+ COMMIT_DATE='Tue, 18 Dec 2018 11:19:29 +0100'
+ '[' omnia = turris ']'
+ '[' -d ./bin-nand ']'
+ mv ./bin ./bin-nand
+ '[' -d ./tmp ']'
+ rm -rf ./tmp
++ head -n1
++ ls -1d bin-nand/mvebu-musl
+ PUB_BIN_DIR=bin-nand/mvebu-musl
+ '[' -n '' ']'
+ USRLISTS_ARGS=--minimal
+ LIST_BRANCH=
+ '[' -n '' ']'
++ echo ''
++ sed 's|.*/||'
+ LIST_BRANCH=
+ scripts/gen-userlists.sh --model omnia --branch '' --minimal bin-nand/mvebu-musl/lists
Missing --branch option.
vagrant@turris-buildroot:/openwrt$

Yes OpenWRT build completed. The script that failed was for generating userlists (package lists) for Turris OS. That is happening after packages build.

2 Likes