Initial source release
No files matched your search
@@ -0,0 +1,267 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build the Paravis GRUB theme + menus from the PSD designs (monospace menu font)."""
|
||||
import os, subprocess
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from psd_tools import PSDImage
|
||||
|
||||
ROOT = '/path/to/pf/ParavisGrub'
|
||||
THEMES = os.path.join(ROOT, 'theme')
|
||||
P1 = '($p1)'
|
||||
SYS = '/efi/Paravis'
|
||||
BASE = P1 + SYS + '/Boot/grub2'
|
||||
BOOTMGR = P1 + SYS + '/Boot/mgr/UEFI/bootx64.efi'
|
||||
|
||||
SCREENS = {
|
||||
'main': '/path/to/pf/PSD/UEFI/x64/main/main.psd',
|
||||
'strelec': '/path/to/pf/PSD/UEFI/x64/Strelec/Strelec.psd',
|
||||
'utilits': '/path/to/pf/PSD/UEFI/x64/Utilits/Utilits.psd',
|
||||
'msdart': '/path/to/pf/PSD/UEFI/x64/MSDaRT/MSDaRT.psd',
|
||||
'linux': '/path/to/pf/PSD/UEFI/x64/Linux/Unix.psd',
|
||||
}
|
||||
|
||||
HEADERS = {'главное меню', 'win pe strelec', 'меню утилит', 'меню msdart',
|
||||
'меню linux', 'paravis flash', '© paravis.ru'}
|
||||
DROP_PIXELS = {'shape and color', 'shape and color copy 2', 'shape and color copy 3'}
|
||||
|
||||
TARGET_W = int(os.environ.get('THEME_W', '1024'))
|
||||
TARGET_H = int(os.environ.get('THEME_H', '768'))
|
||||
SCALE = TARGET_W / 1024.0
|
||||
|
||||
FONT_TTF = '/path/to/pf/ParavisGrub/jb.ttf'
|
||||
FONT_SIZE = max(10, round(18 * SCALE))
|
||||
FONT_NAME = 'Paravis'
|
||||
|
||||
LEFT = round(248 * SCALE)
|
||||
WIDTH = round(544 * SCALE)
|
||||
ITEM_H = round(38 * SCALE)
|
||||
SPACING = max(1, round(3 * SCALE))
|
||||
TOP = round(105 * SCALE)
|
||||
|
||||
# ---------------------------------------------------------------- psd
|
||||
def render_bg(psd_path, out_png):
|
||||
psd = PSDImage.open(psd_path)
|
||||
|
||||
def walk(layer):
|
||||
for ch in layer:
|
||||
nm = (ch.name or '').strip().lower()
|
||||
if ch.kind == 'group':
|
||||
walk(ch)
|
||||
elif ch.kind == 'type':
|
||||
if nm not in HEADERS:
|
||||
ch.visible = False
|
||||
elif ch.kind == 'pixel' and nm in DROP_PIXELS:
|
||||
ch.visible = False
|
||||
|
||||
for layer in psd:
|
||||
nm = (layer.name or '')
|
||||
if nm.startswith('ТЕКСТ_БЕЗ_ОБВОДКИ') or nm.startswith('ВЫДЕЛЕНЫЕ'):
|
||||
layer.visible = False
|
||||
else:
|
||||
walk(layer)
|
||||
|
||||
img = psd.composite().convert('RGB')
|
||||
if (img.width, img.height) != (TARGET_W, TARGET_H):
|
||||
img = img.resize((TARGET_W, TARGET_H), Image.LANCZOS)
|
||||
img.save(out_png)
|
||||
return img
|
||||
|
||||
|
||||
def render_sel(src_png, out_dir):
|
||||
bar = Image.open(src_png).convert('RGBA')
|
||||
if SCALE != 1.0:
|
||||
bar = bar.resize((round(bar.width * SCALE), round(bar.height * SCALE)), Image.LANCZOS)
|
||||
W, H = bar.size
|
||||
bar.crop((0, 0, round(28 * SCALE), H)).save(os.path.join(out_dir, 'sel_w.png'))
|
||||
bar.crop((W - round(84 * SCALE), 0, W, H)).save(os.path.join(out_dir, 'sel_e.png'))
|
||||
bar.crop((W // 2, 0, W // 2 + 1, H)).resize((4, H)).save(os.path.join(out_dir, 'sel_c.png'))
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- menus
|
||||
def winboot(wim):
|
||||
return ['ntboot --testmode=no --efi=%s %s/%s' % (BOOTMGR, P1 + SYS, wim)]
|
||||
|
||||
|
||||
BACK = ['configfile %s' % (BASE + '/grub.cfg')]
|
||||
|
||||
def acr_img(image, kernel, *initrds, params='force_modules=usbhid quiet lang=RU_ru'):
|
||||
"""Boot an Acronis component stored as a single image in Utilities/."""
|
||||
return [
|
||||
'loopback -d acr',
|
||||
'loopback acr %s/Utilities/%s' % (P1 + SYS, image),
|
||||
'linux (acr)/%s %s' % (kernel, params),
|
||||
'initrd ' + ' '.join('(acr)/%s' % i for i in initrds),
|
||||
]
|
||||
|
||||
MENUS = {
|
||||
'main': [
|
||||
('Super Grub2 (поиск и запуск ОС)', '1', ['chainloader %s/super/x64.efi' % (P1 + SYS + '/Boot')]),
|
||||
('Поиск и запуск Windows 7-11', '2', [
|
||||
'set win=',
|
||||
'search --no-floppy --file --set=win /EFI/Microsoft/Boot/bootmgfw.efi',
|
||||
'if [ -z "$win" ]; then', ' echo "Windows не найден"', ' sleep 3',
|
||||
'else', ' chainloader ($win)/EFI/Microsoft/Boot/bootmgfw.efi', 'fi']),
|
||||
('Установка Windows 7, 10, 11 x64', '3', winboot('Boot/ws64.wim')),
|
||||
('Ventoy (ISO-образы)', '4', [
|
||||
'set vtoy=',
|
||||
'search --no-floppy --file --set=vtoy /ventoy/vtoyjump64.exe',
|
||||
'if [ -z "$vtoy" ]; then', ' echo "Раздел VTOYEFI не найден"', ' sleep 3',
|
||||
'else', ' chainloader ($vtoy)/EFI/BOOT/fbx64.efi', 'fi']),
|
||||
('Kaspersky Rescue Disk 24', '5', [
|
||||
'linux %s/KRD/live/vmlinuz boot=live components live-media-path=%s/KRD/live locales=ru_RU.UTF-8' % (P1 + SYS, SYS),
|
||||
'initrd %s/KRD/live/initrd.img' % (P1 + SYS)]),
|
||||
None,
|
||||
('Windows 10, 11 PE Sergei Strelec', '6', ['configfile %s/menu/strelec.cfg' % BASE]),
|
||||
('Утилиты для диагностики', '7', ['configfile %s/menu/utilits.cfg' % BASE]),
|
||||
('Восстановление Windows MSDaRT', '8', ['configfile %s/menu/msdart.cfg' % BASE]),
|
||||
('Запуск / Установка Linux', '9', ['configfile %s/menu/linux.cfg' % BASE]),
|
||||
None,
|
||||
('Перезагрузка', 'R', ['reboot']),
|
||||
('Выключение', 'S', ['halt']),
|
||||
],
|
||||
'strelec': [
|
||||
('Windows 11 PE x64', '1', winboot('Strelec/strelec11x64.wim')),
|
||||
('Windows 10 PE x64', '2', winboot('Strelec/strelec10x64.wim')),
|
||||
None,
|
||||
('Возврат в главное меню', '3', BACK),
|
||||
],
|
||||
'utilits': [
|
||||
('Paragon Hard Disk Manager', '1', [
|
||||
'linux %s/Utilities/PHDM.krn root=/dev/ram0 splash=silent vga=0x314 language=ru_RU.UTF-8' % (P1 + SYS),
|
||||
'initrd %s/Utilities/PHDM.fs' % (P1 + SYS)]),
|
||||
('Acronis Disk Director 12.5', '2',
|
||||
acr_img('ADD', 'dat6.dat', 'dat7.dat', 'dat8.dat', params='quiet')),
|
||||
('Acronis Backup Advanced', '3',
|
||||
acr_img('ABA', 'abr64ker.dat', 'abr64ram.dat', 'dat8.dat',
|
||||
params='product=bootagent media_for_windows quiet')),
|
||||
('Memtest86+ 9.10', '4', ['chainloader %s/apps/memtest86p.efi' % BASE]),
|
||||
None,
|
||||
('Возврат в главное меню', '5', BACK),
|
||||
],
|
||||
'msdart': [
|
||||
('MSDaRT для Windows 11 x64', '1', winboot('MSDaRT/ERD11.WIM')),
|
||||
('MSDaRT для Windows 10 x64', '2', winboot('MSDaRT/ERD10X64.wim')),
|
||||
('MSDaRT для Windows 7 x64', '3', winboot('MSDaRT/ERD7X64.wim')),
|
||||
None,
|
||||
('Возврат в главное меню', '4', BACK),
|
||||
],
|
||||
'linux': [
|
||||
('Запуск Linux Mint x64', '1', [
|
||||
'linux %s/Linux/x64/vmlinuz boot=casper ignore_uuid live-media-path=%s/Linux/x64/ '
|
||||
'locale=ru_RU.UTF-8 console-setup/layoutcode=ru quiet splash --' % (P1 + SYS, SYS),
|
||||
'initrd %s/Linux/x64/initrd.lz' % (P1 + SYS)]),
|
||||
('Установка Linux Mint x64', '2', [
|
||||
'linux %s/Linux/x64/vmlinuz boot=casper ignore_uuid live-media-path=%s/Linux/x64/ '
|
||||
'locale=ru_RU.UTF-8 console-setup/layoutcode=ru only-ubiquity quiet splash --' % (P1 + SYS, SYS),
|
||||
'initrd %s/Linux/x64/initrd.lz' % (P1 + SYS)]),
|
||||
None,
|
||||
('Возврат в главное меню', '3', BACK),
|
||||
],
|
||||
}
|
||||
|
||||
ALL_LABELS = [lbl for rows in MENUS.values() for row in rows if row for lbl in [row[0]]]
|
||||
COL = max(len(x) for x in ALL_LABELS) + 3
|
||||
|
||||
|
||||
def theme_txt(rows, top, timeout_label=False):
|
||||
height = rows * (ITEM_H + SPACING)
|
||||
extra = ''
|
||||
if timeout_label:
|
||||
extra = '''
|
||||
+ label {
|
||||
id = "__timeout__"
|
||||
text = "Автозагрузка через %%d с"
|
||||
align = "right"
|
||||
left = %d
|
||||
width = %d
|
||||
top = %d
|
||||
font = "%s Regular %d"
|
||||
color = "#2b3a55"
|
||||
}
|
||||
''' % (round(560 * SCALE), round(424 * SCALE), round(722 * SCALE), FONT_NAME, FONT_SIZE)
|
||||
return f'''# Paravis Flash - GRUB2 theme
|
||||
desktop-image: "background.png"
|
||||
desktop-color: "#e9e9e9"
|
||||
desktop-image-scale-method: "stretch"
|
||||
title-text: ""
|
||||
terminal-font: "Unifont Regular 16"
|
||||
|
||||
+ boot_menu {{
|
||||
left = {LEFT}
|
||||
top = {top}
|
||||
width = {WIDTH}
|
||||
height = {TARGET_H}
|
||||
item_font = "{FONT_NAME} Regular {FONT_SIZE}"
|
||||
item_color = "#2b3a55"
|
||||
selected_item_color = "#ffffff"
|
||||
item_height = {ITEM_H}
|
||||
item_spacing = {SPACING}
|
||||
item_padding = {round(10 * SCALE)}
|
||||
item_icon_space = 0
|
||||
icon_width = 0
|
||||
icon_height = 0
|
||||
selected_item_pixmap_style = "sel_*.png"
|
||||
scrollbar = false
|
||||
}}
|
||||
{extra}'''
|
||||
|
||||
|
||||
def main():
|
||||
subprocess.run(['grub-mkfont', '-s', str(FONT_SIZE), '--no-hinting',
|
||||
'-n', FONT_NAME, '-o', os.path.join(THEMES, 'paravis.pf2'), FONT_TTF],
|
||||
check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
print('font: paravis.pf2 (%s %d, column %d chars)' % (FONT_NAME, FONT_SIZE, COL))
|
||||
|
||||
for name, psd in SCREENS.items():
|
||||
d = os.path.join(THEMES, name)
|
||||
os.makedirs(d, exist_ok=True)
|
||||
bg = render_bg(psd, os.path.join(d, 'background.png'))
|
||||
render_sel(os.path.join(THEMES, 'main', 'sel_bar.png'), d)
|
||||
|
||||
rows = MENUS[name]
|
||||
top = TOP + ((13 - len(rows)) * (ITEM_H + SPACING)) // 2
|
||||
open(os.path.join(d, 'theme.txt'), 'w', encoding='utf-8').write(theme_txt(len(rows), top, timeout_label=(name == 'main')))
|
||||
|
||||
out = ['set timeout=%s' % (30 if name == 'main' else -1),
|
||||
'set default=%s' % (1 if name == 'main' else 0),
|
||||
'set p1=$root', '',
|
||||
'insmod all_video', 'insmod gfxterm', 'insmod gfxmenu',
|
||||
'set gfxmode=%s' % ('1024x768,auto' if TARGET_W == 1024 else '%dx%d,1024x768,auto' % (TARGET_W, TARGET_H)), 'terminal_output gfxterm',
|
||||
'loadfont %s/theme/paravis.pf2' % BASE,
|
||||
'set theme=%s/theme/%s/theme.txt' % (BASE, name),
|
||||
'export theme', '']
|
||||
for item in rows:
|
||||
if item is None:
|
||||
out += ['menuentry " " {', ' set sep=1', '}']
|
||||
else:
|
||||
label, tag, body = item
|
||||
text = label.ljust(COL) + '(%s)' % tag
|
||||
out.append('menuentry "%s" --hotkey=%s {' % (text, tag.lower()))
|
||||
out += [' ' + b for b in body]
|
||||
out.append('}')
|
||||
out.append('')
|
||||
|
||||
path = os.path.join(ROOT, 'grub.cfg') if name == 'main' else os.path.join(ROOT, 'menu', name + '.cfg')
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
open(path, 'w', encoding='utf-8', newline='\n').write('\n'.join(out).rstrip() + '\n')
|
||||
print('menu:', os.path.basename(path), '(%d rows, top=%d)' % (len(rows), top))
|
||||
|
||||
# ---- preview (monospace => exactly like GRUB)
|
||||
img = bg.copy().convert('RGBA')
|
||||
dr = ImageDraw.Draw(img)
|
||||
bar = Image.open(os.path.join(THEMES, 'main', 'sel_bar.png')).convert('RGBA').resize((WIDTH, ITEM_H))
|
||||
f = ImageFont.truetype(FONT_TTF, FONT_SIZE)
|
||||
for i, item in enumerate(rows):
|
||||
y = top + i * (ITEM_H + SPACING)
|
||||
if item is None:
|
||||
continue
|
||||
label, tag, _ = item
|
||||
if i == 0:
|
||||
img.alpha_composite(bar, (LEFT, y))
|
||||
color = (255, 255, 255) if i == 0 else (43, 58, 85)
|
||||
dr.text((LEFT + 26, y + ITEM_H / 2), label.ljust(COL) + '(%s)' % tag,
|
||||
font=f, fill=color, anchor='lm')
|
||||
img.convert('RGB').save(os.path.join(d, 'preview.png'))
|
||||
|
||||
|
||||
main()
|
||||
@@ -0,0 +1,165 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Generate Paravis GRUB2 menu files.
|
||||
|
||||
Layout:
|
||||
grub.cfg main menu (timeout 30, default = item 2)
|
||||
menu/strelec.cfg submenus (no timeout)
|
||||
menu/utilits.cfg
|
||||
menu/msdart.cfg
|
||||
menu/linux.cfg
|
||||
apps/ chained EFI binaries (not generated, must be copied here)
|
||||
|
||||
Paths used inside *kernel command lines* must not carry a device prefix.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
OUT = sys.argv[1] if len(sys.argv) > 1 else "."
|
||||
|
||||
P1 = "($p1)"
|
||||
SYS = "/efi/Paravis"
|
||||
BASE = P1 + SYS + "/Boot/grub2"
|
||||
BOOTMGR = P1 + SYS + "/Boot/mgr/UEFI/bootx64.efi"
|
||||
CFG_MAIN = BASE + "/grub.cfg"
|
||||
|
||||
|
||||
def pad(label, tag, width):
|
||||
return label + " " * max(2, width - len(label) + 2) + tag
|
||||
|
||||
|
||||
def entry(label, tag, hotkey, body, width):
|
||||
lines = ['menuentry "%s" --hotkey=%s {' % (pad(label, tag, width), hotkey)]
|
||||
lines += [" " + b for b in body]
|
||||
lines.append("}")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def write(name, text):
|
||||
path = os.path.join(OUT, name)
|
||||
os.makedirs(os.path.dirname(path) or ".", exist_ok=True)
|
||||
with open(path, "w", encoding="utf-8", newline="\n") as f:
|
||||
f.write(text)
|
||||
|
||||
|
||||
def check_apps(names):
|
||||
"""app files are not generated: report ones missing from OUT/apps."""
|
||||
missing = [n for n in names if not os.path.isfile(os.path.join(OUT, "apps", n))]
|
||||
for name in missing:
|
||||
print("WARNING: apps/%s not found, its menu entry will fail" % name, file=sys.stderr)
|
||||
return not missing
|
||||
|
||||
|
||||
def winboot(wim):
|
||||
return ["ntboot --testmode=no --efi=%s %s/%s" % (BOOTMGR, P1 + SYS, wim)]
|
||||
|
||||
|
||||
BACK = ["configfile %s" % CFG_MAIN]
|
||||
|
||||
HEADER_GFX = """insmod all_video
|
||||
insmod gfxterm
|
||||
insmod font
|
||||
set gfxmode=1024x768,800x600,auto
|
||||
if loadfont ($p1)/efi/Paravis/Boot/grub2/paravis-mono.pf2 ; then
|
||||
terminal_output gfxterm
|
||||
fi
|
||||
"""
|
||||
|
||||
# ---------------------------------------------------------------- submenus
|
||||
SUB = {
|
||||
"strelec": ("Windows 10, 11 PE Sergei Strelec", [
|
||||
("Windows 11 PE x64", winboot("Strelec/strelec11x64.wim")),
|
||||
("Windows 10 PE x64", winboot("Strelec/strelec10x64.wim")),
|
||||
("Возврат в главное меню", BACK),
|
||||
]),
|
||||
"utilits": ("Утилиты для диагностики", [
|
||||
("Paragon Hard Disk Manager", [
|
||||
"linux %s/Utilities/PHDM.krn root=/dev/ram0 splash=silent vga=0x314 language=ru_RU.UTF-8" % (P1 + SYS),
|
||||
"initrd %s/Utilities/PHDM.fs" % (P1 + SYS),
|
||||
]),
|
||||
("Acronis Disk Director Home", [
|
||||
"map --type=cd %s/Utilities/ADD (0xff)" % (P1 + SYS),
|
||||
"chainloader (0xff)",
|
||||
]),
|
||||
("Acronis Backup Advanced", [
|
||||
"map --type=cd %s/Utilities/ABA (0xff)" % (P1 + SYS),
|
||||
"chainloader (0xff)",
|
||||
]),
|
||||
("Memtest86+ 9.10", ["chainloader %s/apps/memtest86p.efi" % BASE]),
|
||||
("Возврат в главное меню", BACK),
|
||||
]),
|
||||
"msdart": ("Восстановление Windows MSDaRT", [
|
||||
("MSDaRT для Windows 11 x64", winboot("MSDaRT/ERD11.WIM")),
|
||||
("MSDaRT для Windows 10 x64", winboot("MSDaRT/ERD10X64.wim")),
|
||||
("MSDaRT для Windows 7 x64", winboot("MSDaRT/ERD7X64.wim")),
|
||||
("Возврат в главное меню", BACK),
|
||||
]),
|
||||
"linux": ("Запуск / Установка Linux", [
|
||||
("Запуск Linux Mint x64", [
|
||||
"linux %s/Linux/x64/vmlinuz boot=casper ignore_uuid live-media-path=%s/Linux/x64/ "
|
||||
"locale=ru_RU.UTF-8 console-setup/layoutcode=ru quiet splash --" % (P1 + SYS, SYS),
|
||||
"initrd %s/Linux/x64/initrd.lz" % (P1 + SYS),
|
||||
]),
|
||||
("Установка Linux Mint x64", [
|
||||
"linux %s/Linux/x64/vmlinuz boot=casper ignore_uuid live-media-path=%s/Linux/x64/ "
|
||||
"locale=ru_RU.UTF-8 console-setup/layoutcode=ru only-ubiquity quiet splash --" % (P1 + SYS, SYS),
|
||||
"initrd %s/Linux/x64/initrd.lz" % (P1 + SYS),
|
||||
]),
|
||||
("Возврат в главное меню", BACK),
|
||||
]),
|
||||
}
|
||||
|
||||
for key, (title, items) in SUB.items():
|
||||
width = max(len(i[0]) for i in items)
|
||||
body = ["set timeout=-1", ""]
|
||||
for idx, (label, cmds) in enumerate(items, start=1):
|
||||
body.append(entry(label, "(%d)" % idx, str(idx), cmds, width))
|
||||
body.append("")
|
||||
write("menu/%s.cfg" % key, "\n".join(body).rstrip() + "\n")
|
||||
|
||||
# -------------------------------------------------------------- main menu
|
||||
MAIN = [
|
||||
("Super Grub2 (поиск и запуск ОС)", "1",
|
||||
["chainloader %s/super/x64.efi" % (P1 + SYS + "/Boot")]),
|
||||
("Поиск и запуск Windows 7-11", "2", [
|
||||
"set win=",
|
||||
"search --no-floppy --file --set=win /EFI/Microsoft/Boot/bootmgfw.efi",
|
||||
'if [ -z "$win" ]; then',
|
||||
' echo "Windows не найден"',
|
||||
" sleep 3",
|
||||
"else",
|
||||
" chainloader ($win)/EFI/Microsoft/Boot/bootmgfw.efi",
|
||||
"fi",
|
||||
]),
|
||||
("Установка Windows 7, 10, 11 x64", "3", winboot("Boot/ws64.wim")),
|
||||
("Ventoy (ISO-образы)", "4", [
|
||||
"set vtoy=",
|
||||
"search --no-floppy --file --set=vtoy /ventoy/vtoyjump64.exe",
|
||||
'if [ -z "$vtoy" ]; then',
|
||||
' echo "Раздел VTOYEFI не найден"',
|
||||
" sleep 3",
|
||||
"else",
|
||||
" chainloader ($vtoy)/EFI/BOOT/fbx64.efi",
|
||||
"fi",
|
||||
]),
|
||||
("Kaspersky Rescue Disk 18", "5", [
|
||||
"linux %s/KRD/k-x86_64 net.ifnames=0 lang=ru dostartx subdir=%s/KRD/data" % (P1 + SYS, SYS),
|
||||
"initrd %s/KRD/initrd.xz" % (P1 + SYS),
|
||||
]),
|
||||
]
|
||||
|
||||
for idx, (key, _t) in enumerate(SUB.items(), start=6):
|
||||
MAIN.append((SUB[key][0], str(idx), ["configfile %s/menu/%s.cfg" % (BASE, key)]))
|
||||
|
||||
MAIN.append(("Перезагрузка", "R", ["reboot"]))
|
||||
MAIN.append(("Выключение", "S", ["halt"]))
|
||||
|
||||
width = max(len(m[0]) for m in MAIN)
|
||||
out = ["set timeout=30", "set default=1", "set p1=$root", "", HEADER_GFX]
|
||||
for label, tag, cmds in MAIN:
|
||||
out.append(entry(label, "(%s)" % tag, tag.lower(), cmds, width))
|
||||
out.append("")
|
||||
write("grub.cfg", "\n".join(out).rstrip() + "\n")
|
||||
ok = check_apps(["memtest86p.efi"])
|
||||
print("written to", OUT)
|
||||
sys.exit(0 if ok else 1)
|
||||
@@ -0,0 +1,77 @@
|
||||
set timeout=30
|
||||
set default=1
|
||||
set p1=$root
|
||||
|
||||
insmod all_video
|
||||
insmod gfxterm
|
||||
insmod gfxmenu
|
||||
set gfxmode=1024x768,auto
|
||||
terminal_output gfxterm
|
||||
loadfont ($p1)/efi/Paravis/Boot/grub2/theme/paravis.pf2
|
||||
set theme=($p1)/efi/Paravis/Boot/grub2/theme/main/theme_uefi.txt
|
||||
export theme
|
||||
|
||||
menuentry "Super Grub2 (поиск и запуск ОС) (1)" --hotkey=1 {
|
||||
chainloader ($p1)/efi/Paravis/Boot/super/x64.efi
|
||||
}
|
||||
|
||||
menuentry "Поиск и запуск Windows 7-11 (2)" --hotkey=2 {
|
||||
set win=
|
||||
search --no-floppy --file --set=win /EFI/Microsoft/Boot/bootmgfw.efi
|
||||
if [ -z "$win" ]; then
|
||||
echo "Windows не найден"
|
||||
else
|
||||
chainloader ($win)/EFI/Microsoft/Boot/bootmgfw.efi
|
||||
fi
|
||||
}
|
||||
|
||||
menuentry "Установка Windows 7, 10, 11 x64 (3)" --hotkey=3 {
|
||||
ntboot --testmode=no --efi=($p1)/efi/Paravis/Boot/mgr/UEFI/bootx64.efi ($p1)/efi/Paravis/Boot/ws64.wim
|
||||
}
|
||||
|
||||
menuentry "Ventoy (ISO-образы) (4)" --hotkey=4 {
|
||||
set vtoy=
|
||||
search --no-floppy --file --set=vtoy /ventoy/vtoyjump64.exe
|
||||
if [ -z "$vtoy" ]; then
|
||||
echo "Раздел VTOYEFI не найден"
|
||||
else
|
||||
chainloader ($vtoy)/EFI/BOOT/fbx64.efi
|
||||
fi
|
||||
}
|
||||
|
||||
menuentry "Kaspersky Rescue Disk 24 (5)" --hotkey=5 {
|
||||
linux ($p1)/efi/Paravis/KRD/live/vmlinuz boot=live components live-media-path=/efi/Paravis/KRD/live locales=ru_RU.UTF-8
|
||||
initrd ($p1)/efi/Paravis/KRD/live/initrd.img
|
||||
}
|
||||
|
||||
menuentry " " {
|
||||
set sep=1
|
||||
}
|
||||
|
||||
menuentry "Windows 10, 11 PE Sergei Strelec (Q)" --hotkey=q {
|
||||
configfile ($p1)/efi/Paravis/Boot/grub2/menu/strelec.cfg
|
||||
}
|
||||
|
||||
menuentry "Утилиты для диагностики (W)" --hotkey=w {
|
||||
configfile ($p1)/efi/Paravis/Boot/grub2/menu/utilits.cfg
|
||||
}
|
||||
|
||||
menuentry "Восстановление Windows MSDaRT (E)" --hotkey=e {
|
||||
configfile ($p1)/efi/Paravis/Boot/grub2/menu/msdart.cfg
|
||||
}
|
||||
|
||||
menuentry "Запуск / Установка Linux (T)" --hotkey=t {
|
||||
configfile ($p1)/efi/Paravis/Boot/grub2/menu/linux.cfg
|
||||
}
|
||||
|
||||
menuentry " " {
|
||||
set sep=1
|
||||
}
|
||||
|
||||
menuentry "Перезагрузка (R)" --hotkey=r {
|
||||
reboot
|
||||
}
|
||||
|
||||
menuentry "Выключение (S)" --hotkey=s {
|
||||
halt
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
# Калибровка: картинки выделения высотой 40 px (вместо 54).
|
||||
# Если GRUB выводит их 1:1 — полосы будут ровно по 3 px, без ступенек.
|
||||
# sel_c — цветные полосы (линейка), sel_w/sel_e — сплошная полоса, чтобы форма не мешала замеру.
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
$out = 'C:\PF\ParavisGrub\theme-fix-2026-10-31\calib'
|
||||
New-Item -ItemType Directory -Force $out | Out-Null
|
||||
|
||||
$colors = @(
|
||||
[System.Drawing.Color]::FromArgb(255,255,0,0),
|
||||
[System.Drawing.Color]::FromArgb(255,0,160,0),
|
||||
[System.Drawing.Color]::FromArgb(255,0,0,255),
|
||||
[System.Drawing.Color]::FromArgb(255,255,200,0),
|
||||
[System.Drawing.Color]::FromArgb(255,255,0,255)
|
||||
)
|
||||
$base = [System.Drawing.Color]::FromArgb(255,44,53,82)
|
||||
$h = 40
|
||||
$top = 6
|
||||
$bot = 33
|
||||
|
||||
function New-Img($name, $w, $stripes) {
|
||||
$bmp = New-Object System.Drawing.Bitmap $w, $h, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
|
||||
$g = [System.Drawing.Graphics]::FromImage($bmp)
|
||||
$g.Clear([System.Drawing.Color]::FromArgb(0, 0, 0, 0))
|
||||
$g.Dispose()
|
||||
for ($y = $top; $y -le $bot; $y++) {
|
||||
$c = $base
|
||||
if ($stripes) { $c = $colors[[int][math]::Floor(($y - $top) / 3) % 5] }
|
||||
for ($x = 0; $x -lt $w; $x++) { $bmp.SetPixel($x, $y, $c) }
|
||||
}
|
||||
$bmp.Save((Join-Path $out $name), [System.Drawing.Imaging.ImageFormat]::Png)
|
||||
$bmp.Dispose()
|
||||
}
|
||||
|
||||
New-Img 'sel_w.png' 28 $false
|
||||
New-Img 'sel_c.png' 4 $true
|
||||
New-Img 'sel_e.png' 84 $false
|
||||
'готово: ' + $out
|
||||
@@ -0,0 +1,29 @@
|
||||
# Диагностика масштаба выделения: полосы разного цвета через каждые 3 строки.
|
||||
# Размер остаётся 4x54, непрозрачная часть — строки 12..41 (как в оригинале).
|
||||
# По снимку меню определим, как строки картинки ложатся в пиксели экрана.
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
$out = 'C:\PF\ParavisGrub\theme-fix-2026-10-31\diag'
|
||||
New-Item -ItemType Directory -Force $out | Out-Null
|
||||
|
||||
$colors = @(
|
||||
[System.Drawing.Color]::FromArgb(255,255,0,0), # красный
|
||||
[System.Drawing.Color]::FromArgb(255,0,160,0), # зелёный
|
||||
[System.Drawing.Color]::FromArgb(255,0,0,255), # синий
|
||||
[System.Drawing.Color]::FromArgb(255,255,200,0), # жёлтый
|
||||
[System.Drawing.Color]::FromArgb(255,255,0,255) # пурпурный
|
||||
)
|
||||
|
||||
$bmp = New-Object System.Drawing.Bitmap 4, 54, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
|
||||
$g = [System.Drawing.Graphics]::FromImage($bmp)
|
||||
$g.Clear([System.Drawing.Color]::FromArgb(0, 0, 0, 0))
|
||||
$g.Dispose()
|
||||
|
||||
for ($y = 12; $y -le 41; $y++) {
|
||||
$idx = [int][math]::Floor(($y - 12) / 3) % 5
|
||||
for ($x = 0; $x -lt 4; $x++) { $bmp.SetPixel($x, $y, $colors[$idx]) }
|
||||
}
|
||||
$bmp.Save((Join-Path $out 'sel_c.png'), [System.Drawing.Imaging.ImageFormat]::Png)
|
||||
$bmp.Dispose()
|
||||
'линейка: ' + (Join-Path $out 'sel_c.png')
|
||||
@@ -0,0 +1,36 @@
|
||||
# Перерисовка картинок выделения (sel_w/sel_c/sel_e) для BIOS-меню GRUB2.
|
||||
# Что делает:
|
||||
# 1) торцы прямые (без «капсулы» и без декора) — убирает лесенку по краям;
|
||||
# 2) низ полосы продлён: строки 12..44 вместо 12..41 (в меню это +2 px снизу).
|
||||
# Размеры файлов не меняются: sel_w 28x54, sel_c 4x54, sel_e 84x54.
|
||||
# Результат пишется в каталог $out, файлы на флешку копируются отдельно.
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
$out = 'C:\PF\ParavisGrub\theme-fix-2026-10-31\main'
|
||||
$top = 12 # первая непрозрачная строка
|
||||
$bot = 44 # последняя непрозрачная строка (было 41)
|
||||
$col = [System.Drawing.Color]::FromArgb(255, 44, 53, 82)
|
||||
|
||||
New-Item -ItemType Directory -Force $out | Out-Null
|
||||
|
||||
function Make($name, $w, $h) {
|
||||
$bmp = New-Object System.Drawing.Bitmap $w, $h, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
|
||||
$g = [System.Drawing.Graphics]::FromImage($bmp)
|
||||
$g.Clear([System.Drawing.Color]::FromArgb(0, 0, 0, 0))
|
||||
$g.Dispose()
|
||||
for ($x = 0; $x -lt $w; $x++) {
|
||||
for ($y = $top; $y -le $bot; $y++) { $bmp.SetPixel($x, $y, $col) }
|
||||
}
|
||||
$p = Join-Path $out $name
|
||||
$bmp.Save($p, [System.Drawing.Imaging.ImageFormat]::Png)
|
||||
$bmp.Dispose()
|
||||
$i = Get-Item $p
|
||||
" {0,-10} {1}x{2} {3} байт" -f $name, $w, $h, $i.Length
|
||||
}
|
||||
|
||||
'--- новые картинки:'
|
||||
Make 'sel_w.png' 28 54
|
||||
Make 'sel_c.png' 4 54
|
||||
Make 'sel_e.png' 84 54
|
||||
"каталог: $out"
|
||||
@@ -0,0 +1,26 @@
|
||||
# Тест: выделение одной картинкой (band.png) вместо трёх частей sel_w/sel_c/sel_e.
|
||||
# Размер 544x40 (ширина меню, высота 1:1 как в калибровке), полоса строки 6..33.
|
||||
# Цель — проверить, будет ли верхний край ровным по всей длине.
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
$out = 'C:\PF\ParavisGrub\theme-fix-2026-10-31\single'
|
||||
New-Item -ItemType Directory -Force $out | Out-Null
|
||||
|
||||
$w = 544; $h = 40; $top = 6; $bot = 33
|
||||
$col = [System.Drawing.Color]::FromArgb(255, 44, 53, 82)
|
||||
|
||||
$bmp = New-Object System.Drawing.Bitmap $w, $h, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
|
||||
$g = [System.Drawing.Graphics]::FromImage($bmp)
|
||||
$g.Clear([System.Drawing.Color]::FromArgb(0, 0, 0, 0))
|
||||
$g.Dispose()
|
||||
for ($x = 0; $x -lt $w; $x++) { for ($y = $top; $y -le $bot; $y++) { $bmp.SetPixel($x, $y, $col) } }
|
||||
$bmp.Save((Join-Path $out 'band.png'), [System.Drawing.Imaging.ImageFormat]::Png)
|
||||
$bmp.Dispose()
|
||||
|
||||
# theme.txt на основе текущего, только строка с pixmap
|
||||
$theme = Get-Content 'C:\PF\flash-backup-2026-10-31\01-PARAVIS-F\efi\Paravis\Boot\grub2\theme\main\theme.txt' -Encoding UTF8
|
||||
$theme = $theme -replace 'selected_item_pixmap_style = "sel_\*\.png"', 'selected_item_pixmap_style = "band.png"'
|
||||
$theme | Out-File (Join-Path $out 'theme.txt') -Encoding UTF8
|
||||
'готово: ' + $out
|
||||
(Select-String -Path (Join-Path $out 'theme.txt') -Pattern 'pixmap')
|
||||
@@ -0,0 +1,26 @@
|
||||
set timeout=-1
|
||||
set default=0
|
||||
set p1=$root
|
||||
|
||||
insmod all_video
|
||||
insmod gfxterm
|
||||
insmod gfxmenu
|
||||
set gfxmode=1024x768,auto
|
||||
terminal_output gfxterm
|
||||
loadfont ($p1)/efi/Paravis/Boot/grub2/theme/paravis.pf2
|
||||
set theme=($p1)/efi/Paravis/Boot/grub2/theme/linux/theme.txt
|
||||
export theme
|
||||
|
||||
menuentry "Запуск Linux Mint x64 (1)" --hotkey=1 {
|
||||
linux ($p1)/efi/Paravis/Linux/x64/vmlinuz boot=casper ignore_uuid live-media-path=/efi/Paravis/Linux/x64/ locale=ru_RU.UTF-8 console-setup/layoutcode=ru quiet splash --
|
||||
initrd ($p1)/efi/Paravis/Linux/x64/initrd.lz
|
||||
}
|
||||
|
||||
menuentry "Установка Linux Mint x64 (2)" --hotkey=2 {
|
||||
linux ($p1)/efi/Paravis/Linux/x64/vmlinuz boot=casper ignore_uuid live-media-path=/efi/Paravis/Linux/x64/ locale=ru_RU.UTF-8 console-setup/layoutcode=ru only-ubiquity quiet splash --
|
||||
initrd ($p1)/efi/Paravis/Linux/x64/initrd.lz
|
||||
}
|
||||
|
||||
menuentry "Возврат в главное меню (3)" --hotkey=3 {
|
||||
configfile ($p1)/efi/Paravis/Boot/grub2/grub.cfg
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
set timeout=-1
|
||||
set default=0
|
||||
set p1=$root
|
||||
|
||||
insmod all_video
|
||||
insmod gfxterm
|
||||
insmod gfxmenu
|
||||
set gfxmode=1024x768,auto
|
||||
terminal_output gfxterm
|
||||
loadfont ($p1)/efi/Paravis/Boot/grub2/theme/paravis.pf2
|
||||
set theme=($p1)/efi/Paravis/Boot/grub2/theme/msdart/theme.txt
|
||||
export theme
|
||||
|
||||
menuentry "MSDaRT для Windows 11 x64 (1)" --hotkey=1 {
|
||||
ntboot --testmode=no --efi=($p1)/efi/Paravis/Boot/mgr/UEFI/bootx64.efi ($p1)/efi/Paravis/MSDaRT/ERD11.WIM
|
||||
}
|
||||
|
||||
menuentry "MSDaRT для Windows 10 x64 (2)" --hotkey=2 {
|
||||
ntboot --testmode=no --efi=($p1)/efi/Paravis/Boot/mgr/UEFI/bootx64.efi ($p1)/efi/Paravis/MSDaRT/ERD10X64.wim
|
||||
}
|
||||
|
||||
menuentry "MSDaRT для Windows 7 x64 (3)" --hotkey=3 {
|
||||
ntboot --testmode=no --efi=($p1)/efi/Paravis/Boot/mgr/UEFI/bootx64.efi ($p1)/efi/Paravis/MSDaRT/ERD7X64.wim
|
||||
}
|
||||
|
||||
menuentry "Возврат в главное меню (4)" --hotkey=4 {
|
||||
configfile ($p1)/efi/Paravis/Boot/grub2/grub.cfg
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
set timeout=-1
|
||||
set default=0
|
||||
set p1=$root
|
||||
|
||||
insmod all_video
|
||||
insmod gfxterm
|
||||
insmod gfxmenu
|
||||
set gfxmode=1024x768,auto
|
||||
terminal_output gfxterm
|
||||
loadfont ($p1)/efi/Paravis/Boot/grub2/theme/paravis.pf2
|
||||
set theme=($p1)/efi/Paravis/Boot/grub2/theme/strelec/theme.txt
|
||||
export theme
|
||||
|
||||
menuentry "Windows 11 PE x64 (1)" --hotkey=1 {
|
||||
ntboot --testmode=no --efi=($p1)/efi/Paravis/Boot/mgr/UEFI/bootx64.efi ($p1)/efi/Paravis/Strelec/strelec11x64.wim
|
||||
}
|
||||
|
||||
menuentry "Windows 10 PE x64 (2)" --hotkey=2 {
|
||||
ntboot --testmode=no --efi=($p1)/efi/Paravis/Boot/mgr/UEFI/bootx64.efi ($p1)/efi/Paravis/Strelec/strelec10x64.wim
|
||||
}
|
||||
|
||||
menuentry "Возврат в главное меню (3)" --hotkey=3 {
|
||||
configfile ($p1)/efi/Paravis/Boot/grub2/grub.cfg
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
set timeout=-1
|
||||
set default=0
|
||||
set p1=$root
|
||||
|
||||
insmod all_video
|
||||
insmod gfxterm
|
||||
insmod gfxmenu
|
||||
set gfxmode=1024x768,auto
|
||||
terminal_output gfxterm
|
||||
loadfont ($p1)/efi/Paravis/Boot/grub2/theme/paravis.pf2
|
||||
set theme=($p1)/efi/Paravis/Boot/grub2/theme/utilits/theme.txt
|
||||
export theme
|
||||
|
||||
menuentry "Paragon Hard Disk Manager (1)" --hotkey=1 {
|
||||
linux ($p1)/efi/Paravis/Utilities/PHDM.krn root=/dev/ram0 splash=silent vga=0x314 language=ru_RU.UTF-8
|
||||
initrd ($p1)/efi/Paravis/Utilities/PHDM.fs
|
||||
}
|
||||
|
||||
menuentry "Acronis Disk Director 12.5 (2)" --hotkey=2 {
|
||||
loopback -d acr
|
||||
loopback acr ($p1)/efi/Paravis/Utilities/ADD
|
||||
linux (acr)/dat6.dat quiet
|
||||
initrd (acr)/dat7.dat (acr)/dat8.dat
|
||||
}
|
||||
|
||||
menuentry "Acronis Backup Advanced (3)" --hotkey=3 {
|
||||
loopback -d acr
|
||||
loopback acr ($p1)/efi/Paravis/Utilities/ABA
|
||||
linux (acr)/abr64ker.dat product=bootagent media_for_windows quiet
|
||||
initrd (acr)/abr64ram.dat (acr)/dat8.dat
|
||||
}
|
||||
|
||||
menuentry "Memtest86+ 9.10 (4)" --hotkey=4 {
|
||||
chainloader ($p1)/efi/Paravis/Boot/grub2/apps/memtest86p.efi
|
||||
}
|
||||
|
||||
menuentry "Возврат в главное меню (5)" --hotkey=5 {
|
||||
configfile ($p1)/efi/Paravis/Boot/grub2/grub.cfg
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# Возврат исходных картинок выделения на флешку (откат моей правки).
|
||||
# Источник: C:\PF\ParavisGrub\theme-fix-2026-10-31\before\sel_*.png
|
||||
# Полный цикл: остановить ВМ -> диск online -> копировать -> диск offline -> запустить ВМ.
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$vmrun = 'C:\Program Files\VMware\VMware Workstation\vmrun.exe'
|
||||
$vmx = 'D:\Paravis\Documents\Virtual Machines\Windows 10\Windows 10.vmx'
|
||||
$src = 'C:\PF\ParavisGrub\theme-fix-2026-10-31\before'
|
||||
$dst = 'F:\efi\Paravis\Boot\grub2\theme\main'
|
||||
|
||||
$sp = Join-Path $env:TEMP 'pf-disk.txt'
|
||||
|
||||
if (Get-Process -Name vmware-vmx -ErrorAction SilentlyContinue) {
|
||||
& $vmrun -T ws stop $vmx hard | Out-Null
|
||||
for ($i = 0; $i -lt 30; $i++) {
|
||||
if (-not (Get-Process -Name vmware-vmx -ErrorAction SilentlyContinue)) { break }
|
||||
Start-Sleep -Seconds 1
|
||||
}
|
||||
}
|
||||
|
||||
"select disk 2`r`nonline disk`r`nexit`r`n" | Set-Content $sp -Encoding ASCII
|
||||
diskpart.exe /s $sp | Out-Null
|
||||
|
||||
Copy-Item (Join-Path $src 'sel_w.png'), (Join-Path $src 'sel_c.png'), (Join-Path $src 'sel_e.png') $dst -Force
|
||||
Get-ChildItem (Join-Path $dst 'sel_*.png') | ForEach-Object { " {0} {1} байт {2}" -f $_.Name, $_.Length, $_.LastWriteTime.ToString('dd.MM HH:mm:ss') }
|
||||
|
||||
"select disk 2`r`noffline disk`r`nexit`r`n" | Set-Content $sp -Encoding ASCII
|
||||
diskpart.exe /s $sp | Out-Null
|
||||
|
||||
& $vmrun -T ws start $vmx gui | Out-Null
|
||||
'флешка offline, ВМ запущена'
|
||||
|
After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 213 B |
|
After Width: | Height: | Size: 169 B |
|
After Width: | Height: | Size: 178 B |
|
After Width: | Height: | Size: 133 B |
|
After Width: | Height: | Size: 230 B |
|
After Width: | Height: | Size: 169 B |
|
After Width: | Height: | Size: 299 B |
@@ -0,0 +1,35 @@
|
||||
# Paravis Flash - GRUB2 theme
|
||||
desktop-image: "background.png"
|
||||
desktop-color: "#e9e9e9"
|
||||
desktop-image-scale-method: "stretch"
|
||||
title-text: ""
|
||||
terminal-font: "Unifont Regular 16"
|
||||
|
||||
+ boot_menu {
|
||||
left = 248
|
||||
top = 105
|
||||
width = 544
|
||||
height = 768
|
||||
item_font = "Paravis Regular 18"
|
||||
item_color = "#2b3a55"
|
||||
selected_item_color = "#ffffff"
|
||||
item_height = 38
|
||||
item_spacing = 3
|
||||
item_padding = 10
|
||||
item_icon_space = 0
|
||||
icon_width = 0
|
||||
icon_height = 0
|
||||
selected_item_pixmap_style = "band.png"
|
||||
scrollbar = false
|
||||
}
|
||||
|
||||
+ label {
|
||||
id = "__timeout__"
|
||||
text = "Автозагрузка через %d с"
|
||||
align = "right"
|
||||
left = 560
|
||||
width = 424
|
||||
top = 722
|
||||
font = "Paravis Regular 18"
|
||||
color = "#2b3a55"
|
||||
}
|
||||