32 lines
1.4 KiB
PowerShell
32 lines
1.4 KiB
PowerShell
# Переходники KRD с видеомодулями (efi_gop/all_video).
|
|
$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 font gfxterm'
|
|
|
|
$cfg = @(
|
|
'set timeout=0',
|
|
'set default=0',
|
|
'insmod all_video',
|
|
'set gfxmode=1024x768x32,1024x768,auto',
|
|
'set gfxpayload=keep',
|
|
'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"
|
|
|
|
foreach ($arch in @(@('krd32.efi','i386-efi'), @('krd64.efi','x86_64-efi'))) {
|
|
$efi = $arch[0]; $platform = $arch[1]
|
|
$cfgPath = Join-Path $env:TEMP ("$efi.v.cfg")
|
|
[IO.File]::WriteAllText($cfgPath, $cfg, (New-Object System.Text.UTF8Encoding($false)))
|
|
$o = Join-Path $out $efi
|
|
& "$grub\grub-mkstandalone.exe" "--directory=$grub\$platform" -O $platform -o $o "--modules=$mods" "boot/grub/grub.cfg=$cfgPath" 2>&1 | Select-Object -First 5
|
|
' {0}: {1:N0} байт' -f $efi,(Get-Item $o).Length
|
|
}
|