2025-11-05 00:45:21 +00:00
2025-11-05 00:45:21 +00:00
2025-11-05 00:45:21 +00:00
2025-11-05 00:45:21 +00:00
2025-11-04 03:12:53 -08:00
2025-11-05 00:45:21 +00:00
2025-11-05 00:45:21 +00:00
2025-11-05 00:45:21 +00:00

PawletOS-Build

A comprehensive build system for PawletOS with advanced patch management and Android source synchronization capabilities.

Overview

PawletOS-Build provides automated tools for setting up and managing the PawletOS build environment, featuring:

  • Intelligent Patch Management: Advanced patch application with conflict detection and resolution
  • Source Synchronization: Automated Android source sync using repo
  • Build Environment Setup: Streamlined environment configuration for Raspberry Pi builds
  • Robust Error Handling: Graceful fallback mechanisms and detailed error reporting

Features

🔧 Build System (build.py)

The main build script provides comprehensive Android build environment setup with the following capabilities:

  • Source Code Synchronization: Sync Android source code using repo sync with configurable parallel jobs
  • Advanced Patch Application: Intelligent patch system with two modes:
    • Robust Handler: Git-based patch application with conflict analysis and dependency detection
    • Legacy Handler: Traditional patch command fallback for compatibility
  • Flexible Configuration: Customizable source directories, patch levels, and build options
  • Batch Processing: Apply multiple patches with selective filtering and ignore lists

🛠️ Patch Management (scripts/better-patch.py)

Advanced patch handling system featuring:

  • Conflict Analysis: Pre-application analysis of potential patch conflicts
  • Dependency Detection: Automatic detection of patch dependencies and ordering
  • Rollback Capability: Automatic rollback on failure with cleanup
  • Git Integration: Leverages Git's powerful merge capabilities for better conflict resolution
  • Detailed Reporting: Comprehensive patch application reports and statistics

🍓 Raspberry Pi Setup (rpivanilla-ensetup.sh)

Environment setup script for Raspberry Pi vanilla builds:

  • Sets up the RaspberryVanilla build environment
  • Sources necessary build configuration files
  • Provides template for build-specific exports

Usage

Quick Start

  1. Basic patch application:

    python3 build.py --applyPatches
    
  2. Sync source and apply patches:

    python3 build.py --resync --applyPatches
    
  3. Force operations with verbose output:

    python3 build.py --forceResync --forceApplyPatches --verbosePatches
    

Command Line Options

Option Description
--resync Sync source code with repo sync
--forceResync Force sync source code with repo sync --force-sync
--applyPatches Apply patches from patches directory
--forceApplyPatches Force apply patches even if some fail
--patchLevel <n> Patch level for -p option (default: 1)
--sourceDir <path> Source directory (default: current directory)
--patchDir <path> Patch directory (default: patches)
--syncJobs <n> Number of parallel jobs for repo sync
--ignorePatches <files> List of patches to ignore
--useLegacyPatch Use legacy patch command instead of robust handler
--verbosePatches Verbose output for patch application

Advanced Patch Management

The build system includes an intelligent patch handler that provides:

  • Pre-flight Analysis: Analyzes patches before application to detect conflicts
  • Smart Conflict Resolution: Uses Git's three-way merge for better conflict handling
  • Dependency Management: Automatically orders patches based on file dependencies
  • Rollback Protection: Automatic rollback on failure with repository cleanup

Environment Setup

For Raspberry Pi builds, use the provided setup script:

chmod +x rpivanilla-ensetup.sh
./rpivanilla-ensetup.sh

This script will:

  • Navigate to the RaspberryVanilla directory
  • Source the build environment setup
  • Prepare the environment for lunch and build commands

Directory Structure

PawletOS-Build/
├── build.py                 # Main build system script
├── rpivanilla-ensetup.sh   # Raspberry Pi environment setup
├── scripts/
│   └── better-patch.py     # Advanced patch management system
├── patches/                # Patch files directory (created as needed)
└── README.md              # This file

Requirements

  • Python 3.6+
  • Git (recommended for advanced patch features)
  • Android build tools (repo, patch)
  • Bash shell for setup scripts

Contributing

When adding new patches or modifying the build system:

  1. Test patches individually before batch application
  2. Use --verbosePatches for debugging patch issues
  3. Consider patch dependencies when organizing patch files
  4. Update documentation for new features or options

License

See the LICENSE file for licensing information.

S
Description
A repo that has scripts and helpers to build PawletOS
Readme AGPL-3.0 163 KiB
Languages
Python 97.4%
Shell 2.6%