ni / nilrt

Tools to build NI Linux RT distribution.
MIT License
80 stars 69 forks source link

scripts: add host_deploy_ipks script #267

Closed amstewart closed 8 months ago

amstewart commented 8 months ago

Add a developer script which automates the process of hosting an OE build's deploy/IPKs tree on the network, which makes it faster to test out IPK changes on real hardware and VMs.

[0] usr0:dev$ ./host_deploy_ipks -h
usage: host_deploy_ipks [-h] [--verbose] [--version] [-b [BIND]] [-e] [-p [PORT]] [--suppress-opkg-conf] [root]

Host an OE IPK deploy tree on an HTTP server.

positional arguments:
  root                  The root path for the feed server. (Default=${PWD})

options:
  -h, --help            show this help message and exit
  --verbose, -v         Increase the verbosity of script output. Specify once for verbose output, specify twice for debug.
  --version, -V         Print his script's version information and exit.
  -b [BIND], --bind [BIND]
                        The host address to which the feed server should bind. (Default=0.0.0.0)
  -e, --host-empty      If asserted, host IPK feeds that contain no packages.
  -p [PORT], --port [PORT]
                        The port number over which the feed server will host. (Default=8080)
  --suppress-opkg-conf  If enabled, do not print an opkg conf script.

Invocations look like:

[0] usr0:dev$ ./host_deploy_ipks -v ../../build/tmp-glibc/deploy/ipk/
INFO:host_deploy_ipks:Searching ../../build/tmp-glibc/deploy/ipk for IPK feeds.
INFO:host_deploy_ipks:Found IPK feed: ../../build/tmp-glibc/deploy/ipk
WARNING:host_deploy_ipks:Skipping empty index: ../../build/tmp-glibc/deploy/ipk/Packages
INFO:host_deploy_ipks:Found IPK feed: ../../build/tmp-glibc/deploy/ipk/all
INFO:host_deploy_ipks:Found IPK feed: ../../build/tmp-glibc/deploy/ipk/core2-64
INFO:host_deploy_ipks:Found IPK feed: ../../build/tmp-glibc/deploy/ipk/x64
INFO:host_deploy_ipks:Created temporary feed directory: /tmp/host_deploy_ipks.or54aurp
=== Copy+Paste to setup opkg config ===
cat >/etc/opkg/dev.conf <<-EOF
src  all  http://41d17:8080/all  [trusted=yes]
src  x64  http://41d17:8080/x64  [trusted=yes]
src  core2-64  http://41d17:8080/core2-64  [trusted=yes]
EOF
===
Serving IPKs on 0.0.0.0:8080 ...

After which, you can copy-paste the snippet into a target's shell and install opkg packages to your contentment. (Provided your dev machine's hostname is resolvable from the target.)

Send ^C to stop the feed server.

Testing