Skip to content

refactor: migrate package management from opkg to apk#1654

Draft
m-dilorenzi wants to merge 34 commits into
nethsecurity-8.8from
opkg_dismiss_8.8
Draft

refactor: migrate package management from opkg to apk#1654
m-dilorenzi wants to merge 34 commits into
nethsecurity-8.8from
opkg_dismiss_8.8

Conversation

@m-dilorenzi
Copy link
Copy Markdown
Collaborator

This pull request migrates the package management system from opkg to apk across the codebase. It updates scripts, configuration files, and documentation to use apk commands instead of opkg.

Core Package Management Migration:

  • All scripts and utilities now use apk for package installation, updates, and queries instead of opkg, including in ns.update, ns-restore-extra-packages, update-packages, and related system scripts. This includes changes to command syntax, output parsing, and error handling.

  • All references to package repositories and configuration files are updated from opkg paths and formats to apk equivalents, such as moving from /etc/opkg/distfeeds.conf to /etc/apk/repositories.d/distfeeds.list.

Adblock and Dependency Updates:

  • The adblock package and scripts have been updated to remove the opkg dependency, use apk for package checks, and update user-facing instructions accordingly.

Network Helper Scripts:

  • NAT helper discovery scripts now use apk info -L and related parsing instead of opkg files to enumerate kernel modules.

API and System Information:

  • The API controllers and inventory scripts now query package versions and information using apk commands, updating both implementation and output parsing.

Documentation and User Guidance:

  • All user guidance, comments, and documentation have been updated to refer to apk instead of opkg for package management operations.

@m-dilorenzi m-dilorenzi self-assigned this May 8, 2026
@Tbaile Tbaile mentioned this pull request May 11, 2026
26 tasks
@Tbaile Tbaile force-pushed the nethsecurity-8.8 branch from bec5c03 to 12597d6 Compare May 12, 2026 14:10
…lity

Implement two key improvements to package restoration after system upgrades:

1. Resilient retry mechanism: Script now tracks installation failures and
   exits with code 1 when packages fail to install. The procd respawn policy
   (respawn 300 30 10) will automatically retry on the next boot, accounting
   for WAN initialization delays and transient network failures.

2. Reliable output reporting: Only report "Restored package: X" when the
   package installation actually succeeds (apk exit code 0). Failed
   installations are reported separately, and the service is not disabled
   until all packages are successfully restored. This relies on apk's
   reliable exit codes instead of opkg's unreliable behavior.

The service now remains enabled after failures, allowing the procd respawn
mechanism to retry on subsequent boots until all packages are restored.

Closes #1606
Assisted-by: Copilot:claude-haiku-4.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants