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

29 lines
1.2 KiB
PowerShell

# Переходник для KRD 18 (ia32): kernel k-x86 + initrd.xz + subdir.
$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 all_video efi_gop efi_uga video_bochs video_cirrus'
$cfg = @(
'set timeout=0',
'set default=0',
'insmod all_video',
'set gfxmode=1024x768x32,1024x768,auto',
'set gfxpayload=keep',
'search --no-floppy --file --set=k18 /efi/Paravis/KRD/k-x86',
'if [ -z "$k18" ]; then',
' echo "KRD18 not found"',
' sleep 5',
'else',
' linux ($k18)/efi/Paravis/KRD/k-x86 net.ifnames=0 lang=ru dostartx subdir=/efi/Paravis/KRD/data',
' initrd ($k18)/efi/Paravis/KRD/initrd.xz',
' boot',
'fi'
) -join "`n"
$cfgPath = Join-Path $env:TEMP 'krd18.cfg'
[IO.File]::WriteAllText($cfgPath, $cfg, (New-Object System.Text.UTF8Encoding($false)))
$o = Join-Path $out 'krd18.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
' krd18.efi: {0:N0} байт' -f (Get-Item $o).Length