Appendix: Build an IPK from the TAR Archive
Use this appendix when an opkg-based platform requires a customer-built IPK and cannot use the published OpenWrt IPK unchanged. For a standard OpenWrt integration, retrieve the published IPK instead of rebuilding it from the TAR archive.
ThousandEyes publishes supported OpenWrt IPKs through the signed feed. Use this appendix only when the target package layout, architecture, or integration requires you to own a different IPK. Verify the supplied TAR archive before extracting it, then build, sign, and distribute the customer-owned IPK through your package system.
Before You Start
You need:
An agent TAR archive.
opkg-build, normally supplied byopkg-utilsor a matching OpenWrt SDK, on the build host.The architecture reported by
opkg print-architectureon the target.A decision to package the Agent Updater or agent-only.
Build the package on your build host. Do not build it on a target device.
1. Verifying and Extracting the Source Archive
Use the Agent Updater TAR archive and the detached signature supplied with that exact package.
Keep the downloaded package compressed until you verify its signature. Verification checks the exact bytes of the .tar.gz file.
On the computer where you downloaded the package, create a folder containing only the agent package and its signature.
Open a terminal and change to that folder. You can type
cd, drag the folder into Terminal, and press Return.For example:
cd /Users/<your-username>/Downloads/myagentpackageReplace
MY_AGENT_PACKAGE.tar.gzin the commands below with the complete filename of your downloaded package. Confirm that the package is still gzip-compressed:file MY_AGENT_PACKAGE.tar.gzThe output must include:
gzip compressed dataDownload the Cisco Root CA certificate:
curl -fLO https://www.cisco.com/security/pki/certs/csirca4096.pemVerify the package. Replace both example filenames with the complete filenames you downloaded:
openssl cms -verify -binary \ -CAfile csirca4096.pem \ -in MY_AGENT_PACKAGE.tar.gz.signature \ -inform DER \ -content MY_AGENT_PACKAGE.tar.gz \ -out /dev/nullContinue only when the command reports:
Verification successfulExtract the verified outer package:
tar -xzf MY_AGENT_PACKAGE.tar.gz
Use the agent archive and detached signature supplied for the selected platform and architecture:
Keep the downloaded package compressed until you verify its signature. Verification checks the exact bytes of the .tar.gz file.
On the computer where you downloaded the package, create a folder containing only the agent package and its signature.
Open a terminal and change to that folder. You can type
cd, drag the folder into Terminal, and press Return.For example:
Replace
MY_AGENT_PACKAGE.tar.gzin the commands below with the complete filename of your downloaded package. Confirm that the package is still gzip-compressed:The output must include:
Download the Cisco Root CA certificate:
Verify the package. Replace both example filenames with the complete filenames you downloaded:
Continue only when the command reports:
Extract the verified outer package:
2. Creating the Package Tree
Create the package root:
Extract the Agent Updater archive from the verified outer package. Then copy the Updater tree and adapt the supplied init example:
The default configuration path in this package layout is:
Do not add the agent binary to the same package. The Updater retrieves and verifies approved agent releases at runtime.
After the verification step extracts the agent archive, copy its filesystem tree into
pkgroot/and adapt the suppliedprocdexample:The delivered agent tree is installed at
/opt/samknows/router_agent.
If your platform reads configuration from
/etc, place the configuration file there and use a symlink or package-owned path that matches the platform page.
3. Adding Package Metadata
Create
pkgroot/CONTROL/controland update the following fields as needed:Mark the configuration as an
opkgconffile so a locally updated file is preserved during package upgrades:If you relocate the configuration, record its installed path in
CONTROL/conffilesinstead.Set the following fields:
Versionto the component version plus your packaging revision.Architectureto the compatible value reported byopkg print-architecture.Dependsonly when the final package or startup integration requires a target package that is not already delivered in the verified component tree.
Do not list libraries already supplied in the component tree. The
opensslcommand used to verify the source archive runs on the build host and is not a target package dependency by itself.Do not use
Architecture: allunless the package performs its own compatibility check.
4. Building and Inspecting the IPK
Build the IPK:
Inspect the data archive before installing it:
Install the IPK on a lab device and confirm that the package paths match the configuration and startup unit.
5. Configuring Startup
Use the example in
init_examples/for the platform's init system:procd,systemd, or SysV.Start the component only after WAN connectivity, DNS resolution, and outbound HTTPS access are available.
For example, on an OpenWrt-derived platform:
Run the agent through your platform's packaged init integration. The integration must set the persistent agent directory as its working directory and supervise the process.
Installing the IPK should not silently enable or start the service. Express startup ordering in the image or provisioning configuration where it can be reviewed.
Adding the Configuration Without the Authentication Secret
Add the remaining configuration during the build, or supply it through the target's provisioning process. Do not include the production authentication secret in distributable firmware or packages. Inject it at first boot from your ACS or secret provider.
For a lab package, you can edit the installed configuration and restart the service:
Signing and Publishing
Sign the output through your existing package process. If you publish an opkg feed, sign its index and publish the package checksum. If the IPK is embedded in an image, use the image build's package-signing controls.
For each update:
Verify the new TAR archive.
Rebuild the IPK.
Sign and publish it.
Validate installation with Validate with Self-Test Mode on a lab device.
For OpenWrt, use the published OpenWrt IPK or let OpenWrt feed and ImageBuilder resolve it directly.
Use Plan, Deploy, and Update the Agent for production validation, rollout, and update ownership.
Last updated