What's new

Entware [SOLUTION] Cross-Compile Nyx (Tor Command-Line Monitor) Entware Package via Debian Live DVD

  • 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!

garycnew

Senior Member
NOTE: After finally being convinced by the Entware & OpenWRT Developers that neither Build Environment was meant to be Compiled Natively on a Router (Neutered C Libraries), I decided to pursue this Cross-Compile Nyx (Tor Command-Line Monitor) Entware Package via Debian Live DVD solution; which, is presumably a bit slower, but ultimately successful. It wasn't too terrible after finding the right cross-compiling platform and combining a few different build references.

Requirements/Assumptions:

Cross-Compiling Host Machine:
1. Plenty of Physical Memory (RAM)
2. Debian Live (Testing) DVD
3. Flash Drive >= 32GB (Preferably USB 3.0/3.1)

Nyx (Tor Command-Line Monitor) Installation Machine:
1. An Asuswrt-Merlin Compatible Router (i.e., Asus RT-AC66U)
2. Asuswrt-Merlin Compatible Firmware (i.e., 384.19)
3. Formated JFFS Partition and Enabled JFFS Custom Scripts and Configs
4. Entware installed on USB 3.0 Interface Device via Asuswrt-Merlin Terminal Menu (AMTM) with Swap File created

NOTE: Not sure if it matters... At the time of this writing, Debian Bullseye (Testing) Live DVD contained the same package versions as the current Entware repository, opposed to the Debian Buster (Stable) Live DVD, so we opted to use the Debian Bullseye (Testing) Live DVD.

### Download & Burn Debian Live (Testing) DVD ###
Code:
$ curl -L -O -C - http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/weekly-live-builds/amd64/iso-hybrid/debian-live-testing-amd64-gnome+nonfree.iso

### Boot Debian Live (Testing) DVD on the Cross-Compiling Host Machine ###
Our Cross-Compiling Host Machine required the [F12] key to be pressed during boot to enter into the Boot Menu and select the Debian Live (Testing) DVD. Make sure you setup and have Internet access on the Cross-Compiling Host Machine.

### Open Terminal ###

### Mount Flash Drive (Repeat after each DVD Boot) ###
Code:
$ mount /dev/sdb1 /media/user/SanDiskSDCZ
$ cd /media/user/SanDiskSDCZ/

### Download & Install Build System (Repeat after each DVD Boot) ###
Code:
$ sudo apt-get update
$ sudo apt-get install git-core build-essential libssl-dev libncurses5-dev unzip gawk zlib1g-dev
$ sudo apt-get install python2 wget

### Clone, Setup, & Make Entware Build Env ###
Code:
$ git clone https://github.com/Entware/Entware.git
$ cd Entware

# Update OpenWRT Feeds
$ ./scripts/feeds update -a

# Symlink Packages (Repeat after each DVD Boot)
$ make package/symlinks

# Copy the config specific to your Architecture and Kernel versions
$ cp configs/armv7-2.6.config .config

$ make tools/install && make toolchain/install && make target/compile
or
#$ make -j1 V=sc tools/install
#$ make -j1 V=sc toolchain/install
#$ make -j1 V=sc target/compile

### Download, Prepare, & Compile Test Package from OpenWRT Feed ###
Code:
#$ ./scripts/feeds install screen
or
$ make -j1 V=sc package/screen/download
$ make -j1 V=sc package/screen/check
$ find package/ -iname "*screen*"
package/feeds/packages/screen

$ make -j1 V=sc package/screen/prepare
$ make -j1 V=sc package/screen/compile
#$ make -j1 V=sc package/screen/install
#$ make package/index

$ find bin/ -iname "*screen*"
bin/targets/armv7-2.6/generic-glibc/packages/screen_4.8.0-2_armv7-2.6.ipk

### Download & Prepare OpenWRT Feed Package modified for Entware (When Available) ###
Code:
#$ ./scripts/feeds install nyx
or
$ make -j1 V=sc package/feeds/packages/nyx/download
$ make -j1 V=sc package/feeds/packages/nyxcheck
$ find package/ -iname "*nyx*"
package/feeds/packages/nyx

### It is unnecessary to edit the Makefile as Entware & PYPI take care of the configuration for us ###

### Select nyx for [M]odular inclusion under the SECTION => CATEGORY => SUBMENU of menuconfig ###
Code:
$ make menuconfig
define Package/nyx
  SECTION:=admin
  CATEGORY:=Administration
  URL:=https://nyx.torproject.org/
  TITLE:=Terminal status monitor for Tor
  DEPENDS:=+python3 +python3-stem
endef

### Compile OpenWRT Feed Package modified for Entware ###
Code:
$ make -j1 V=sc package/feeds/packages/nyx/prepare
$ make -j1 V=sc package/feeds/packages/nyx/compile
#$ make -j1 V=sc package/feeds/packages/nyx/install
#$ make package/index

$ find bin/ -iname "*nyx*"
bin/targets/armv7-2.6/generic-glibc/packages/nyx_2.1.0-2_armv7-2.6.ipk

### SFTP & SSH Nyx (Tor Command-Line Monitor) Packages & Dependencies to the Installation Machine(s) ###
Code:
$ cd bin/targets/armv7-2.6/generic-glibc/packages/
$ ls
nyx_2.1.0-2_armv7-2.6.ipk
python3-stem_1.8.0-2_armv7-2.6.ipk
$ sftp admin@192.168.0.1
sftp> cd /tmp/mnt/SanDiskSDHC/nyx/
sftp> put nyx_2.1.0-2_armv7-2.6.ipk
sftp> put python3-stem_1.8.0-2_armv7-2.6.ipk

$ ssh admin@192.168.0.1
# cd /tmp/mnt/SanDiskSDHC/
# opkg install ./nyx/*

# opkg list-installed|grep -i nyx
nyx - 2.1.0-2

# opkg files nyx
Package nyx (2.1.0-2) is installed on root and has the following files:
/opt/lib/python3.9/site-packages/nyx-2.1.0-py3.9.egg-info/top_level.txt
/opt/lib/python3.9/site-packages/nyx/curses.pyc
/opt/lib/python3.9/site-packages/nyx-2.1.0-py3.9.egg-info/SOURCES.txt
/opt/lib/python3.9/site-packages/nyx/starter.pyc
/opt/lib/python3.9/site-packages/nyx/panel/config.pyc
/opt/lib/python3.9/site-packages/nyx/arguments.pyc
/opt/lib/python3.9/site-packages/nyx/settings/dedup.cfg
/opt/lib/python3.9/site-packages/nyx/panel/graph.pyc
/opt/lib/python3.9/site-packages/nyx-2.1.0-py3.9.egg-info/dependency_links.txt
/opt/lib/python3.9/site-packages/nyx/panel/__init__.pyc
/opt/lib/python3.9/site-packages/nyx/settings/attributes.cfg
/opt/lib/python3.9/site-packages/nyx/panel/connection.pyc
/opt/lib/python3.9/site-packages/nyx/menu.pyc
/opt/bin/nyx
/opt/lib/python3.9/site-packages/nyx-2.1.0-py3.9.egg-info/entry_points.txt
/opt/lib/python3.9/site-packages/nyx-2.1.0-py3.9.egg-info/PKG-INFO
/opt/lib/python3.9/site-packages/nyx/panel/header.pyc
/opt/lib/python3.9/site-packages/nyx/__init__.pyc
/opt/lib/python3.9/site-packages/nyx/panel/interpreter.pyc
/opt/lib/python3.9/site-packages/nyx/panel/torrc.pyc
/opt/lib/python3.9/site-packages/nyx/tracker.pyc
/opt/lib/python3.9/site-packages/nyx/panel/log.pyc
/opt/lib/python3.9/site-packages/nyx/popups.pyc
/opt/lib/python3.9/site-packages/nyx/log.pyc
/opt/lib/python3.9/site-packages/nyx-2.1.0-py3.9.egg-info/requires.txt

# opkg info nyx
Package: nyx
Version: 2.1.0-2
Depends: libc, libssp, librt, libpthread, python3, python3-stem
Status: install user installed
Architecture: armv7-2.6
Installed-Time: 1628407667

# /opt/bin/nyx -v
nyx version 2.1.0 (released January 12, 2019)

# /opt/bin/nyx -i 9051

### (Optional) Remove Nyx (Tor Command-Line Monitor) & Dependencies ###
Code:
# opkg remove nyx python3-stem python3 python3-decimal python3-lzma liblzma python3-asyncio python3-codecs python3-dbm libdb47 python3-cgitb python3-cgi python3-openssl python3-distutils python3-xml libexpat python3-sqlite3 libsqlite3 python3-gdbm libgdbm python3-readline python3-urllib python3-email python3-multiprocessing python3-logging python3-pydoc python3-ctypes python3-ncurses python3-unittest python3-light libbz2 libffi python3-base libpython3

Congratulations! You've Cross-Compiled an Nyx (Tor Command-Line Monitor) Entware Package via Debian Live (Testing) DVD! The Possibilities are Endless with Good-Times Ahead!

References:
Code:
http://bin.entware.net/armv7sf-k2.6/
http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/weekly-live-builds/amd64/iso-hybrid/
https://packages.debian.org/search?keywords=search
https://oldwiki.archive.openwrt.org/about/toolchain
https://oldwiki.archive.openwrt.org/doc/howto/buildroot.exigence
https://oldwiki.archive.openwrt.org/doc/howto/build.a.package
https://github.com/Entware/Entware/wiki/How-to-add-a-new-package
https://github.com/Entware/Entware-ng/wiki/Using-gcc-%28native-compilation%29
https://nyx.torproject.org/
https://github.com/torproject/nyx
https://pypi.org/project/nyx/
 
Last edited:

Sign Up For SNBForums Daily Digest

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