What's new

[R7800/Voxel/Entware] How to compile iprange

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

HELLO_wORLD

Very Senior Member
I try to compile iprange: https://github.com/firehol/iprange
I installed Entware, then make, gcc...
No success. I am not familiar with cli *nix compiling...

Is it possible to compile this for R7800 ( @Voxel firmware), and how could I do that? I was not able to find a binary already compiled for armv7l, but there are binaries for FreeBSD armv7 for example.
Since I am no expert in *nix compilation, I don’t know if this iprange is standalone or requires some specific kernels...

iprange is a little utility that is part of FireHOL, and FireHOL is available on openwrt, so I suppose it is possible to compile just iprange (or get an armv7l binary working on R7800 somewhere).

Any ideas?
 
I can't remember which entware packages I installed in the past, so I might miss a few.
Also not sure if all the packages from the 2nd opkg install command are needed.


But this should get you somewhere:
Code:
/opt/bin/opkg install gcc automake
/opt/bin/opkg install busybox ldd make gawk sed
cd /opt/root
git clone https://github.com/firehol/iprange
cd iprange
./autogen.sh
chmod +x install-sh
./configure --prefix=/opt --disable-man
make
make install
(the command "chmod +x install-sh" normally also should not be required, but for some reason in this case install-sh was not executable)

at least it executes on my R7800, but not sure how to further test:

Code:
root@R7800:/$ /opt/bin/iprange --version
iprange 1.0.5_master
Copyright (C) 2015-2017 Costa Tsaousis for FireHOL (Refactored and extended)
Copyright (C) 2004 Paul Townsend (Adapted)
Copyright (C) 2003 Gabriel L. Somlo (Original)

License: GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>.
This program comes with ABSOLUTELY NO WARRANTY; This is free software, and
you are welcome to redistribute it under certain conditions;
See COPYING distributed in the source for details.
 
Last edited:
alternatively, to build the latest stable version:

Code:
/opt/bin/opkg install gcc tar
/opt/bin/opkg install busybox ldd make gawk sed
cd /opt/root
wget https://github.com/firehol/iprange/releases/download/v1.0.4/iprange-1.0.4.tar.bz2
tar -xjvf iprange-1.0.4.tar.bz2 
cd iprange-1.0.4
./configure --prefix=/opt --disable-man
make
make install
 
alternatively, to build the latest stable version:

Code:
/opt/bin/opkg install gcc tar
/opt/bin/opkg install busybox ldd make gawk sed
cd /opt/root
wget https://github.com/firehol/iprange/releases/download/v1.0.4/iprange-1.0.4.tar.bz2
tar -xjvf iprange-1.0.4.tar.bz2
cd iprange-1.0.4
./configure --prefix=/opt --disable-man
make
make install
It does not work for me:
Code:
root@HERMES:/tmp/mnt/sda1/entware/root/iprange-1.0.4$ ./configure --prefix=/opt --disable-man
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/opt/root/iprange-1.0.4':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

And from git, it does not either:
Code:
root@HERMES:/tmp/mnt/sda1/entware/root$ /opt/bin/git clone https://github.com/firehol/iprange
Cloning into 'iprange'...
remote: Enumerating objects: 267, done.
remote: Total 267 (delta 0), reused 0 (delta 0), pack-reused 267
Receiving objects: 100% (267/267), 131.69 KiB | 263.00 KiB/s, done.
Resolving deltas: 100% (137/137), done.
root@HERMES:/tmp/mnt/sda1/entware/root$ cd iprange
root@HERMES:/tmp/mnt/sda1/entware/root/iprange$ ./autogen.sh
./autogen.sh: ./autogen.sh: 2: autoreconf: not found
Seems like scripts in iprange (configure.sh or autogen.sh are not aware to use /opt/).
 
what does your $PATH look like?
it should start with /opt/bin:/opt/sbin, so that it finds the entware binaries

On my R7800 I have added a line into /root/.profile so that it always imports the /opt/etc/profile from entware, when I login via ssh.
(actually I added it into the entware post-mount.sh, so that it also gets re-added after flashing a new firmware, so that is probably why I forgot)
Code:
if [ ! -f /root/.profile ]; then
        echo '. /opt/etc/profile' > /root/.profile
        chown root.root /root/.profile
fi
 
That’s it.
I do not imports the /opt directories in /root/.profile, as Voxel does not mention that in his readme... I thought it was deliberate therefore I avoided to do so.
However, changing autogen-sh, configure and Makefile by adding an export at the beginning worked like a charm, so thank you so much!!

what does your $PATH look like?
it should start with /opt/bin:/opt/sbin, so that it finds the entware binaries

On my R7800 I have added a line into /root/.profile so that it always imports the /opt/etc/profile from entware, when I login via ssh.
(actually I added it into the entware post-mount.sh, so that it also gets re-added after flashing a new firmware, so that is probably why I forgot)
Code:
if [ ! -f /root/.profile ]; then
        echo '. /opt/etc/profile' > /root/.profile
        chown root.root /root/.profile
fi
 
I do not imports the /opt directories in /root/.profile, as Voxel does not mention that in his readme... I thought it was deliberate therefore I avoided to do so.
Well, it was one of the first things I did, because I hated typing the full paths to entware...
And I haven't noticed any strange things. Only in rare case I want to call a stock executable, but then I'll type the full path to that one.

Also, in the changes.log, in the list of changes for 1.0.2.59SF Voxel did mention:
16. /etc/profile default profile is changed (no PATH for /opt/bin:/opt/sbin).
Entware users should set the PATH for Entware in /root/.profile file.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top