triffid/pia-wg

jq was compiled without ONIGURUMA regex libary

Woogz-git opened this issue · 2 comments

Trying run this on OpenWRT but getting the below error:

root@GL-MT1300:~/pia-wg# ./pia-wg.sh
Generating new private key`
Setting default location: any
Setting default wireguard interface name: pia
Cannot read '/pia-wg/pia-wg.conf', generating a default one
Please enter your privateinternetaccess.com username: XXXXXXX
./pia-wg.sh: line 122: /pia-wg/pia-wg.conf: No such file or directory
Config saved
jq: error (at /var/cache/pia-wg/data_new.json:1): jq was compiled without ONIGURUMA regex libary. match/test/sub and related functions are not available.
Location not found!
Options are:
./pia-wg.sh: line 206: column: command not found
Please edit /pia-wg/pia-wg.conf and change your desired location, then try again

Here's the steps I've taken so far

opkg update
opkg install git-http
opkg install ca-bundle
opkg install libmbedtls12
opkg install coreutils-realpath
opkg install nano
opkg install coreutils-shuf
opkg install oniguruma5
git clone http://github.com/triffid/pia-wg.git
cd pia-wg
nano pia-config.sh
change "CONFIG="/etc/pia-wg/pia-wg.conf" to "CONFIG="/root/pia-wg/pia-wg.conf"
./pia-wg.sh

I have ONIGURUMA installed so not sure why it's giving me that error.

the pia-wg folder is in /root/

While that is an obstacle for running the script on OpenWRT, it's not actually an issue with the script itself - you might have to report this to OpenWRT so they can package jq and its libraries properly.

In the meantime, you could try to specify an exact location (in your /etc/pia-wg/pia-wg.conf) so the script doesn't fall back to regex match.

column not found is an odd one, does OpenWRT not offer util-linux? You could probably just remove column invocations from the script, all it does is prettify the server list output. I guess I should test for its availability before trying to use it

@Woogz-git

Here are my steps to compile a version of jq compatible with OpenWRT. I did this code build on my LinkSys WRT3200ACM.

This builds a jq version that includes the "Qniguruma" libraries.

REF: https://github.com/stedolan/jq
$ opkg install libtool-bin autoconf automake python3-dev
$ pip3 install --upgrade setuptools
$ rm -rf /tmp/jq*
$ cd /tmp
$ git clone https://github.com/stedolan/jq.git
$ cd jq*
$ git submodule update --init
$ autoreconf -fi
$ ./configure --with-oniguruma=builtin --disable-maintainer-mode
$ make LDFLAGS=-all-static
$ mv /usr/bin/jq /usr/bin/jq.bak
$ cp -rf /tmp/jq/jq /usr/bin/jq
$ jq