6da042505e
4 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 6da042505e |
feat: add firmware image building to local build script
Add comprehensive firmware building functionality to local-build.sh, replicating the GitHub Actions firmware build workflow. Users can now build complete OpenWrt firmware images with SecuBox pre-installed locally, in addition to building packages. New Features: - New 'build-firmware' command to build complete firmware images - Support for GlobalScale devices (ESPRESSObin, Sheeva64, MOCHAbin) - Device profile definitions with automatic target/subtarget configuration - Automatic OpenWrt source download and caching - Device-specific package configuration (10G for MOCHAbin, WiFi for Ultra) - Firmware configuration with same settings as GitHub Actions workflow: * CONFIG_TARGET_PER_DEVICE_ROOTFS=y for image generation * Explicit PROFILE parameter in make commands * Device profile verification before building - Artifact collection with firmware images, packages, and checksums - Build time tracking and verbose logging - 'clean-all' command to remove OpenWrt source (saves ~20GB) Device Profiles: - espressobin-v7 (mvebu/cortexa53) - espressobin-ultra (mvebu/cortexa53 with WiFi) - sheeva64 (mvebu/cortexa53) - mochabin (mvebu/cortexa72 with 10G networking) - x86-64 (x86/64 generic PC) Usage: ./secubox-tools/local-build.sh build-firmware mochabin ./secubox-tools/local-build.sh build-firmware espressobin-v7 Output: Firmware images placed in build/firmware/<device>/ - *.img.gz, *sysupgrade.bin, *factory.bin files - SHA256SUMS checksums - BUILD_INFO.txt with build details - packages/ directory with SecuBox .ipk files Documentation: - Updated README.md with firmware building examples - Added device profiles and environment variables - Added example workflows for firmware building - Distinguished between package building (SDK) and firmware building (full source) Technical Details: - Uses full OpenWrt source (not SDK) for firmware builds - Configures feeds identically to GitHub Actions workflow - Includes same configuration fixes for image generation - Verifies device profile selection before lengthy build - Supports parallel and single-threaded builds with automatic retry - Downloads and caches OpenWrt source for reuse 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
|||
| c739104bca |
feat: add local build tool that replicates GitHub Actions workflows
- Add local-build.sh: comprehensive local build system
- Validates packages (Makefiles, JSON, JavaScript, shell scripts)
- Downloads and caches OpenWrt SDK
- Builds .ipk packages locally
- Supports multiple architectures (x86-64, ARM, MIPS)
- Collects artifacts with SHA256 checksums
- Update CLAUDE.md with local build documentation
- Add Local Build section with usage examples
- Update Development Workflow to include local testing
- List supported architectures and environment variables
- Update secubox-tools/README.md
- Add comprehensive local-build.sh documentation
- Update workflow examples to include local building
- Add dependencies and installation instructions
Benefits:
- Test builds locally before CI/CD
- Faster development iteration
- Reduced GitHub Actions usage
- Offline development support
Usage:
./secubox-tools/local-build.sh validate
./secubox-tools/local-build.sh build
./secubox-tools/local-build.sh build luci-app-<name>
./secubox-tools/local-build.sh build --arch <arch>
./secubox-tools/local-build.sh full
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|||
| 4caf3c14bd |
feat: add module generation validation and pre-push hooks
Comprehensive validation tooling for SecuBox module generation and git workflow. New Tools: ----------- 1. validate-module-generation.sh - Deep validation of single module during/after generation - Checks 9 categories: Makefile, RPCD, ACL, Menu, JS Views, UCI, Permissions, Security, Docs - Validates RPCD naming (luci.* prefix) vs JavaScript ubus objects - Validates menu paths vs actual view file locations - Cross-checks RPC methods between JavaScript and RPCD - Security scans for hardcoded credentials and dangerous commands - Exit codes: 0=pass, 1=critical errors 2. pre-push-validation.sh - Git pre-push hook that blocks push if critical errors found - Validates all modules before allowing remote push - Detects modified modules and runs comprehensive checks - Prevents deployment of broken modules - Can be bypassed with --no-verify (not recommended) 3. install-git-hooks.sh - One-command installation of git hooks - Creates symlink from .git/hooks/pre-push to pre-push-validation.sh - Enables automatic validation before every push Documentation: -------------- 4. VALIDATION-GUIDE.md - Complete guide to validation workflow - Critical naming convention rules with examples - Module generation checklist (5 phases) - Common validation errors and fixes - Best practices and troubleshooting - CI/CD integration examples Updated: -------- 5. secubox-tools/README.md - Added descriptions for new validation tools - Added recommended workflows for module generation and modification - Organized tools into categories (Validation, Maintenance) Key Validation Rules Enforced: ------------------------------- ✓ RPCD script name MUST match ubus object name (exact match with luci. prefix) Example: object: 'luci.cdn-cache' → file: luci.cdn-cache ✓ Menu paths MUST match view file locations (prevent HTTP 404) Example: "path": "cdn-cache/overview" → view/cdn-cache/overview.js ✓ All ubus objects MUST use luci.* prefix ✅ 'luci.cdn-cache' ❌ 'cdn-cache' ✓ ACL permissions MUST cover all RPCD methods ✓ JavaScript RPC method calls MUST exist in RPCD implementation ✓ RPCD scripts MUST be executable (chmod +x) ✓ All JSON files MUST have valid syntax ✓ Security: No hardcoded credentials or dangerous commands Benefits: --------- - Prevents RPC errors (-32000: Object not found) - Prevents HTTP 404 errors (view files not found) - Catches naming mismatches before deployment - Ensures ACL permissions are complete - Enforces consistent naming conventions - Blocks broken modules from being pushed - Provides detailed error messages with fix suggestions Usage: ------ # Validate new/modified module: ./secubox-tools/validate-module-generation.sh luci-app-cdn-cache # Install git hooks (one-time): ./secubox-tools/install-git-hooks.sh # After installation, validation runs automatically: git push # Pre-push validation blocks if errors found # Manual pre-push validation: ./secubox-tools/pre-push-validation.sh See VALIDATION-GUIDE.md for complete documentation and workflows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
|||
| 92f3318729 |
feat: add comprehensive module validation tooling
Add validate-modules.sh script that validates critical naming conventions and module structure to prevent common RPC and HTTP 404 errors. New validation checks: - RPCD script names must match ubus object names (luci.* prefix) - Menu paths must match view file locations - View files must have corresponding menu entries - RPCD scripts must be executable - JSON files must have valid syntax - ubus objects must follow naming convention Updated CLAUDE.md documentation with: - Critical naming conventions section with examples - Common error patterns and solutions - Updated development workflow to include validation - Enhanced troubleshooting guide for RPC and 404 errors - Updated package structure diagram with correct RPCD naming Added secubox-tools/README.md: - Detailed usage instructions for validation script - Common fixes for naming issues - CI/CD integration examples - Quick reference for critical naming rules This tooling prevents deployment of modules with naming mismatches that cause runtime errors like: - RPC call failed with error -32000: Object not found - HTTP error 404 while loading view files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |