How kwindrem/setuphelper works
Project Type and Purpose
• Type: An embedded‐Linux package manager and installer for Venus OS on Victron GX devices.
• Purpose:
• Automate package install/update (from GitHub or USB)
• Reinstall packages after OS updates
• GUI integration for manual control, conflict resolution, backups/restores
• “Blind” install/uninstall at boot via removable media
• Uses runit services, DBus APIs, QML UI, shell helpers, Python modules
File Structure
• Top‐level components:
• services/PackageManager → runit directory for the PackageManager daemon
• velib_python/… → Python DBus monitor & helper library for interacting with Venus OS services
• FileSets/… → QML pages injected into the system GUI (patch & version-independent sets)
• HelperResources/… → Shared shell functions & hooks for package install/uninstall scripts
• blindInstall/… → Boot-time scripts & rcS.local hooks for “blind” install/uninstall
• Root scripts (PackageManager.py, setup, updatePackage, reinstallMods, makeVelib_python, etc.)
• GitHub workflows (.github/) and version metadata (version, changes, gitHubInfo)
Extract Insights from the README
• Core features (auto-reinstall, auto-update, blind install/uninstall)
• Conflict detection & resolution logic
• Use of HelperResources by third‐party packages
• OS hooks (rcS.local, swupdate-scripts) and DBus interactions
a. OS Foundation
• Venus OS (runit, swupdate-scripts, filesystem at /data, /opt)
• rcS.local
b. SetupHelper Core
1. BlindInstall Module
– blindInstall/rcS.local hooks
– pre-hook.sh, post-hook.sh
2. PackageManager Daemon
– services/PackageManager/run
– PackageManager.py
– Log directory (services/PackageManager/log)
3. GUI Extension
– FileSets/PatchSource QML pages (injected at runtime)
– VersionIndependent QML pages
4. HelperResources Library
– Shell scripts for install/uninstall operations
– Hook points for third-party packages
5. Python DBus API
– velib_python modules (dbusmonitor.py, vedbus.py, ve_utils.py, settingsdevice.py, oldestVersion.py)
c. External Interfaces
– GitHub archives (online update source)
– USB/SD media (offline update/install source)
– Venus OS swupdate for firmware updates
d. Persistent Storage
– /data/SetupHelper (archives, settings backups)
– Settings in com.victronenergy.settings
Relationships & Data Flows
• User clicks in the GUI → QML layer → sends DBus message
• Python DBus monitor (velib_python) receives requests → invokes PackageManager.py
• PackageManager daemon calls HelperResources shell functions → filesystem changes, service restarts
• OS update triggers swupdate-scripts → via runit signals → BlindInstall may reinstall packages
• Manual or scheduled checks fetch tarballs from GitHub or scan USB → hand off to PackageManager
Architectural Patterns & Principles
• Layered architecture: UI (QML) → DBus API (Python) → Service (PackageManager) → Shell Helpers → OS
• Modular Resource Injection: QML pages are patched in via FileSets
• Event‐Driven: DBus for inter‐component messaging, runit for service supervision
• Plugin-style Helpers: third-party packages source HelperResources for consistent install semantics