- Complete Particle-OS rebranding from uBlue-OS - Professional installation system with standardized paths - Self-initialization system with --init and --reset commands - Enhanced error messages and dependency checking - Comprehensive testing infrastructure - All source scriptlets updated with runtime improvements - Clean codebase with redundant files moved to archive - Complete documentation suite
86 lines
No EOL
4.1 KiB
PowerShell
86 lines
No EOL
4.1 KiB
PowerShell
# Fix apt-layer source scriptlets - Update all uBlue-OS references to Particle-OS
|
|
# This script updates all source scriptlets to use Particle-OS naming and paths
|
|
|
|
Write-Host "=== Fixing apt-layer source scriptlets ===" -ForegroundColor Blue
|
|
Write-Host "Updating all uBlue-OS references to Particle-OS..." -ForegroundColor Blue
|
|
|
|
# Function to update a file
|
|
function Update-File {
|
|
param(
|
|
[string]$FilePath
|
|
)
|
|
|
|
Write-Host "Updating: $FilePath" -ForegroundColor Blue
|
|
|
|
if (Test-Path $FilePath) {
|
|
# Create backup
|
|
Copy-Item $FilePath "$FilePath.backup"
|
|
|
|
# Read file content
|
|
$content = Get-Content $FilePath -Raw
|
|
|
|
# Apply replacements
|
|
$content = $content -replace '/var/log/ubuntu-ublue', '/var/log/particle-os'
|
|
$content = $content -replace '/etc/ubuntu-ublue', '/usr/local/etc/particle-os'
|
|
$content = $content -replace 'ubuntu-ublue/base', 'particle-os/base'
|
|
$content = $content -replace 'ubuntu-ublue/gaming', 'particle-os/gaming'
|
|
$content = $content -replace 'ubuntu-ublue/dev', 'particle-os/dev'
|
|
$content = $content -replace 'ubuntu-ublue-layers', 'particle-os-layers'
|
|
$content = $content -replace 'ubuntu-ublue-rg', 'particle-os-rg'
|
|
$content = $content -replace 'UBLUE_CONFIG_DIR', 'PARTICLE_CONFIG_DIR'
|
|
$content = $content -replace 'UBLUE_LOG_DIR', 'PARTICLE_LOG_DIR'
|
|
$content = $content -replace 'UBLUE_ROOT', 'PARTICLE_ROOT'
|
|
$content = $content -replace 'UBLUE_TEMP_DIR', 'PARTICLE_TEMP_DIR'
|
|
$content = $content -replace 'UBLUE_BUILD_DIR', 'PARTICLE_BUILD_DIR'
|
|
$content = $content -replace 'UBLUE_SQUASHFS_COMPRESSION', 'PARTICLE_SQUASHFS_COMPRESSION'
|
|
$content = $content -replace 'UBLUE_SQUASHFS_BLOCK_SIZE', 'PARTICLE_SQUASHFS_BLOCK_SIZE'
|
|
$content = $content -replace 'UBLUE_LIVE_OVERLAY_DIR', 'PARTICLE_LIVE_OVERLAY_DIR'
|
|
$content = $content -replace 'UBLUE_LIVE_UPPER_DIR', 'PARTICLE_LIVE_UPPER_DIR'
|
|
$content = $content -replace 'UBLUE_LIVE_WORK_DIR', 'PARTICLE_LIVE_WORK_DIR'
|
|
$content = $content -replace 'disk_ublue', 'disk_particle'
|
|
$content = $content -replace 'ublue_total', 'particle_total'
|
|
$content = $content -replace 'ublue_used', 'particle_used'
|
|
$content = $content -replace 'ublue_avail', 'particle_avail'
|
|
$content = $content -replace 'ublue_perc', 'particle_perc'
|
|
|
|
# Write updated content back to file
|
|
Set-Content $FilePath $content -NoNewline
|
|
|
|
Write-Host "✓ Updated: $FilePath" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "⚠️ File not found: $FilePath" -ForegroundColor Yellow
|
|
}
|
|
}
|
|
|
|
# List of files to update
|
|
$scriptlets = @(
|
|
"src/apt-layer/scriptlets/05-live-overlay.sh"
|
|
"src/apt-layer/scriptlets/07-bootloader.sh"
|
|
"src/apt-layer/scriptlets/08-advanced-package-management.sh"
|
|
"src/apt-layer/scriptlets/09-atomic-deployment.sh"
|
|
"src/apt-layer/scriptlets/11-layer-signing.sh"
|
|
"src/apt-layer/scriptlets/12-audit-reporting.sh"
|
|
"src/apt-layer/scriptlets/13-security-scanning.sh"
|
|
"src/apt-layer/scriptlets/14-admin-utilities.sh"
|
|
"src/apt-layer/scriptlets/19-cloud-integration.sh"
|
|
"src/apt-layer/scriptlets/99-main.sh"
|
|
)
|
|
|
|
# Update each file
|
|
foreach ($file in $scriptlets) {
|
|
Update-File $file
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Fix Complete ===" -ForegroundColor Green
|
|
Write-Host "All apt-layer source scriptlets have been updated:" -ForegroundColor White
|
|
Write-Host " - Changed uBlue-OS paths to Particle-OS paths" -ForegroundColor White
|
|
Write-Host " - Updated variable names from UBLUE_ to PARTICLE_" -ForegroundColor White
|
|
Write-Host " - Updated example commands to use particle-os naming" -ForegroundColor White
|
|
Write-Host " - Backup files created with .backup extension" -ForegroundColor White
|
|
Write-Host ""
|
|
Write-Host "Next steps:" -ForegroundColor Yellow
|
|
Write-Host "1. Copy updated source files to VM" -ForegroundColor White
|
|
Write-Host "2. Recompile apt-layer: cd src/apt-layer; ./compile.sh" -ForegroundColor White
|
|
Write-Host "3. Test the compiled version" -ForegroundColor White
|
|
Write-Host "4. Install to VM if working correctly" -ForegroundColor White |