31 lines
1.2 KiB
PowerShell
31 lines
1.2 KiB
PowerShell
# Deploy GRUB2 theme + menus to p1.
|
|
$ErrorActionPreference = 'Stop'
|
|
$src = 'C:\PF\ParavisGrub'
|
|
$dst = 'F:\efi\Paravis\Boot\grub2'
|
|
|
|
if (-not (Test-Path 'F:\efi\Paravis\Boot')) { 'p1 not available'; exit 1 }
|
|
|
|
# themes
|
|
Remove-Item "$dst\theme" -Recurse -Force -ErrorAction SilentlyContinue
|
|
New-Item -ItemType Directory -Force "$dst\theme" | Out-Null
|
|
Copy-Item "$src\theme\*" "$dst\theme\" -Recurse -Force
|
|
Remove-Item "$dst\theme\*\preview.png" -Force -ErrorAction SilentlyContinue
|
|
Remove-Item "$dst\theme\main\sel_bar.png" -Force -ErrorAction SilentlyContinue
|
|
|
|
# menus
|
|
Copy-Item "$src\grub.cfg" "$dst\grub.cfg" -Force
|
|
New-Item -ItemType Directory -Force "$dst\menu" | Out-Null
|
|
Copy-Item "$src\menu\*.cfg" "$dst\menu\" -Force
|
|
|
|
'--- tree:'
|
|
Get-ChildItem $dst -Recurse -File | Select-Object @{n='rel';e={$_.FullName.Replace("$dst\",'')}},Length |
|
|
Sort-Object rel | Format-Table -AutoSize
|
|
|
|
'--- syntax:'
|
|
$checker = 'C:\PF\grub2-a1ive\grub\grub-script-check.exe'
|
|
Get-ChildItem "$dst\grub.cfg", "$dst\menu\*.cfg" | ForEach-Object {
|
|
& $checker $_.FullName
|
|
if ($LASTEXITCODE -eq 0) { " OK $($_.Name)" } else { " FAIL $($_.Name)" }
|
|
}
|
|
'--- free on F: {0:N0} MB' -f ((Get-Volume -DriveLetter F).SizeRemaining / 1MB)
|