Files
flash-build/build-krd32-text.ps1
2026-11-13 07:52:38 +03:00

27 lines
1.1 KiB
PowerShell

# Вариант KRD-переходника с явным текстовым payload (для 32-битной EFI).
$ErrorActionPreference = 'Stop'
$grub = 'C:\PF\grub2-a1ive\grub'
$out = 'C:\PF\KRD\images'
$mods = 'normal search search_fs_file chain part_msdos part_gpt fat ntfs exfat configfile echo test linux video'
$cfg = @(
'set timeout=0',
'set default=0',
'set gfxpayload=text',
'search --no-floppy --file --set=krd /efi/Paravis/KRD/live/vmlinuz',
'if [ -z "$krd" ]; then',
' echo "KRD not found"',
' sleep 5',
'else',
' linux ($krd)/efi/Paravis/KRD/live/vmlinuz boot=live components live-media-path=/efi/Paravis/KRD/live locales=ru_RU.UTF-8',
' initrd ($krd)/efi/Paravis/KRD/live/initrd.img',
' boot',
'fi'
) -join "`n"
$cfgPath = Join-Path $env:TEMP 'krd32t.cfg'
[IO.File]::WriteAllText($cfgPath, $cfg, (New-Object System.Text.UTF8Encoding($false)))
$o = Join-Path $out 'krd32.efi'
& "$grub\grub-mkstandalone.exe" "--directory=$grub\i386-efi" -O i386-efi -o $o "--modules=$mods" "boot/grub/grub.cfg=$cfgPath" 2>&1 | Select-Object -First 5
' krd32.efi: {0:N0} байт' -f (Get-Item $o).Length