From 675effa97f762b5f2bfc6e7244d2035e4ec3ddd4 Mon Sep 17 00:00:00 2001 From: Eugene Zamriy Date: Wed, 26 Jul 2023 23:51:00 +0300 Subject: [PATCH 2/2] Translate installation image bootloader to Russian --- 80-rhel/aarch64.tmpl | 12 +++++++++- 80-rhel/config_files/aarch64/grub2-efi.cfg | 15 ++++++++---- 80-rhel/config_files/x86/grub2-bios.cfg | 19 +++++++++------ 80-rhel/config_files/x86/grub2-efi.cfg | 15 ++++++++---- 80-rhel/config_files/x86/isolinux.cfg | 28 ++++++++++++---------- 80-rhel/efi.tmpl | 9 ++++++- 80-rhel/x86.tmpl | 23 ++++++++++++++++-- 7 files changed, 88 insertions(+), 33 deletions(-) diff --git a/80-rhel/aarch64.tmpl b/80-rhel/aarch64.tmpl index 14099d6..353436a 100644 --- a/80-rhel/aarch64.tmpl +++ b/80-rhel/aarch64.tmpl @@ -21,6 +21,16 @@ if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: isoargs = "-iso-level 3" else: isoargs = "" + +# define an MSVSphere-specific image flavor constant +if product.variant in ("Minimal", "Server"): + FLAVOR=" Сервер" +elif product.variant == "Certified": + FLAVOR=" Сертифицированная" +elif product.variant == "BaseOS": + FLAVOR=" ОС" +else: + FLAVOR="" %> mkdir images @@ -53,7 +63,7 @@ mkdir ${KERNELDIR} %> treeinfo images-${basearch} ${img|basename} ${img} %endfor - <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/> + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, FLAVOR=FLAVOR"/> %endif # Create optional product.img and updates.img diff --git a/80-rhel/config_files/aarch64/grub2-efi.cfg b/80-rhel/config_files/aarch64/grub2-efi.cfg index 1ce5d33..5dd2002 100644 --- a/80-rhel/config_files/aarch64/grub2-efi.cfg +++ b/80-rhel/config_files/aarch64/grub2-efi.cfg @@ -15,7 +15,12 @@ function load_video { } load_video +insmod gfxterm +set gfxmode=auto set gfxpayload=keep +set lang=ru_RU +terminal_output gfxterm +loadfont unicode insmod gzio insmod part_gpt insmod ext2 @@ -26,20 +31,20 @@ set timeout=60 search --no-floppy --set=root -l '@ISOLABEL@' ### BEGIN /etc/grub.d/10_linux ### -menuentry 'Install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os { +menuentry 'Установить @PRODUCT@ @VERSION@@FLAVOR@' --class red --class gnu-linux --class gnu --class os { linux @KERNELPATH@ @ROOT@ ro initrd @INITRDPATH@ } -menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os { +menuentry 'Проверить носитель и установить @PRODUCT@ @VERSION@@FLAVOR@' --class red --class gnu-linux --class gnu --class os { linux @KERNELPATH@ @ROOT@ rd.live.check initrd @INITRDPATH@ } -submenu 'Troubleshooting -->' { - menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os { +submenu 'Устранение неполадок -->' { + menuentry 'Установить @PRODUCT@ @VERSION@@FLAVOR@ (базовый графический режим)' --class red --class gnu-linux --class gnu --class os { linux @KERNELPATH@ @ROOT@ nomodeset initrd @INITRDPATH@ } - menuentry 'Rescue a @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os { + menuentry 'Восстановление установленной системы' --class red --class gnu-linux --class gnu --class os { linux @KERNELPATH@ @ROOT@ inst.rescue initrd @INITRDPATH@ } diff --git a/80-rhel/config_files/x86/grub2-bios.cfg b/80-rhel/config_files/x86/grub2-bios.cfg index cfca1bf..30dcd9e 100644 --- a/80-rhel/config_files/x86/grub2-bios.cfg +++ b/80-rhel/config_files/x86/grub2-bios.cfg @@ -5,7 +5,12 @@ function load_video { } load_video +insmod gfxterm +set gfxmode=auto set gfxpayload=keep +set lang=ru_RU +terminal_output gfxterm +loadfont unicode insmod gzio insmod part_gpt insmod ext2 @@ -17,27 +22,27 @@ set timeout=60 search --no-floppy --set=root -l '@ISOLABEL@' ### BEGIN /etc/grub.d/10_linux ### -menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { +menuentry 'Установить @PRODUCT@ @VERSION@@FLAVOR@' --class fedora --class gnu-linux --class gnu --class os { linux @KERNELPATH@ @ROOT@ quiet initrd @INITRDPATH@ } -menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { +menuentry 'Проверить носитель и установить @PRODUCT@ @VERSION@@FLAVOR@' --class fedora --class gnu-linux --class gnu --class os { linux @KERNELPATH@ @ROOT@ rd.live.check quiet initrd @INITRDPATH@ } -submenu 'Troubleshooting -->' { - menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os { +submenu 'Устранение неполадок -->' { + menuentry 'Установить @PRODUCT@ @VERSION@ (базовый графический режим)' --class fedora --class gnu-linux --class gnu --class os { linux @KERNELPATH@ @ROOT@ nomodeset quiet initrd @INITRDPATH@ } - menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os { + menuentry 'Восстановление установленной системы' --class fedora --class gnu-linux --class gnu --class os { linux @KERNELPATH@ @ROOT@ inst.rescue quiet initrd @INITRDPATH@ } - menuentry 'Boot first drive' --class fedora --class gnu-linux --class gnu --class os { + menuentry 'Загрузка с первого диска' --class fedora --class gnu-linux --class gnu --class os { chainloader (hd0)+1 } - menuentry 'Boot second drive' --class fedora --class gnu-linux --class gnu --class os { + menuentry 'Загрузка со второго диска' --class fedora --class gnu-linux --class gnu --class os { chainloader (hd1)+1 } } diff --git a/80-rhel/config_files/x86/grub2-efi.cfg b/80-rhel/config_files/x86/grub2-efi.cfg index 8c9adad..b174e48 100644 --- a/80-rhel/config_files/x86/grub2-efi.cfg +++ b/80-rhel/config_files/x86/grub2-efi.cfg @@ -9,7 +9,12 @@ function load_video { } load_video +insmod gfxterm +set gfxmode=auto set gfxpayload=keep +set lang=ru_RU +terminal_output gfxterm +loadfont unicode insmod gzio insmod part_gpt insmod ext2 @@ -20,20 +25,20 @@ set timeout=60 search --no-floppy --set=root -l '@ISOLABEL@' ### BEGIN /etc/grub.d/10_linux ### -menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { +menuentry 'Установить @PRODUCT@ @VERSION@@FLAVOR@' --class fedora --class gnu-linux --class gnu --class os { linuxefi @KERNELPATH@ @ROOT@ quiet initrdefi @INITRDPATH@ } -menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { +menuentry 'Проверить носитель и установить @PRODUCT@ @VERSION@@FLAVOR@' --class fedora --class gnu-linux --class gnu --class os { linuxefi @KERNELPATH@ @ROOT@ rd.live.check quiet initrdefi @INITRDPATH@ } -submenu 'Troubleshooting -->' { - menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os { +submenu 'Устранение неполадок -->' { + menuentry 'Установить @PRODUCT@ @VERSION@ (базовый графический режим)' --class fedora --class gnu-linux --class gnu --class os { linuxefi @KERNELPATH@ @ROOT@ nomodeset quiet initrdefi @INITRDPATH@ } - menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os { + menuentry 'Восстановление установленной системы' --class fedora --class gnu-linux --class gnu --class os { linuxefi @KERNELPATH@ @ROOT@ inst.rescue quiet initrdefi @INITRDPATH@ } diff --git a/80-rhel/config_files/x86/isolinux.cfg b/80-rhel/config_files/x86/isolinux.cfg index 216d36f..3cfdbc2 100644 --- a/80-rhel/config_files/x86/isolinux.cfg +++ b/80-rhel/config_files/x86/isolinux.cfg @@ -1,6 +1,8 @@ default vesamenu.c32 timeout 600 +font cp866-8x16.psf + display boot.msg # Clear the screen when exiting the menu, instead of leaving the menu displayed. @@ -8,7 +10,7 @@ display boot.msg # the menu itself for as long as the screen remains in graphics mode. menu clear menu background splash.png -menu title @PRODUCT@ @VERSION@ +menu title @PRODUCT@ @VERSION@@FLAVOR@ menu vshift 8 menu rows 18 menu margin 8 @@ -53,18 +55,18 @@ menu color cmdline 0 #ffffffff #00000000 none # Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message. -menu tabmsg Press Tab for full configuration options on menu items. +menu tabmsg Нажмите [Tab] для просмотра конфигурации выбранного пункта меню. menu separator # insert an empty line menu separator # insert an empty line label linux - menu label ^Install @PRODUCT@ @VERSION@ + menu label ^1. Установить @PRODUCT@ @VERSION@@FLAVOR@ kernel vmlinuz append initrd=initrd.img @ROOT@ quiet label check - menu label Test this ^media & install @PRODUCT@ @VERSION@ + menu label ^2. Проверить носитель и установить @PRODUCT@ @VERSION@@FLAVOR@ menu default kernel vmlinuz append initrd=initrd.img @ROOT@ rd.live.check quiet @@ -72,25 +74,27 @@ label check menu separator # insert an empty line # utilities submenu -menu begin ^Troubleshooting - menu title Troubleshooting @PRODUCT@ @VERSION@ +menu begin Устранение неполадок + menu title Устранение неполадок label basic menu indent count 5 - menu label Install using ^basic graphics mode + menu label ^1. Установить @PRODUCT@ @VERSION@@FLAVOR@ (базовый графический установщик) text help - Try this option out if you're having trouble installing - @PRODUCT@ @VERSION@. + Попробуйте этот режим если у вас возникают проблемы с + установкой @PRODUCT@ @VERSION@@FLAVOR@. endtext kernel vmlinuz append initrd=initrd.img @ROOT@ nomodeset quiet label rescue menu indent count 5 - menu label ^Rescue a @PRODUCT@ system + menu label ^2. Восстановление установленной системы text help - If the system will not boot, this lets you access files - and edit config files to try to get it booting again. + Если система не загружается, данный режим позволит вам + получить доступ к файловой системе и отредактировать + конфигурационные файлы чтобы восстановить функцию + загрузки системы. endtext kernel vmlinuz append initrd=initrd.img @ROOT@ inst.rescue quiet diff --git a/80-rhel/efi.tmpl b/80-rhel/efi.tmpl index 80600d2..d36aefa 100644 --- a/80-rhel/efi.tmpl +++ b/80-rhel/efi.tmpl @@ -1,4 +1,4 @@ -<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/> +<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel, FLAVOR=''"/> <% EFIBOOTDIR="EFI/BOOT" APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns" @@ -7,6 +7,7 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol" mkdir ${EFIBOOTDIR} mkdir ${EFIBOOTDIR}/fonts/ +mkdir ${EFIBOOTDIR}/locale/ %if efiarch64: install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/ @@ -18,6 +19,7 @@ install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/ install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi %endif install usr/share/grub/unicode.pf2 ${EFIBOOTDIR}/fonts/ +install /usr/share/locale/ru/LC_MESSAGES/grub.mo ${EFIBOOTDIR}/locale/ru.mo ## actually make the EFI images ${make_efiboot("images/efiboot.img")} @@ -35,7 +37,12 @@ ${make_efiboot("images/efiboot.img")} copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR} %endif install ${configdir}/grub2-efi.cfg ${eficonf} + replace @FLAVOR@ '${FLAVOR}' ${eficonf} + %if product.name in ("MSVSphere", "MSVSphere Server"): + replace @PRODUCT@ 'МСВСфера' ${eficonf} + %else: replace @PRODUCT@ '${product.name}' ${eficonf} + %endif replace @VERSION@ ${product.version} ${eficonf} replace @KERNELNAME@ vmlinuz ${eficonf} replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf} diff --git a/80-rhel/x86.tmpl b/80-rhel/x86.tmpl index 3945ce4..b83a484 100644 --- a/80-rhel/x86.tmpl +++ b/80-rhel/x86.tmpl @@ -22,6 +22,16 @@ if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: isoargs = "-iso-level 3" else: isoargs = "" + +# define an MSVSphere-specific image flavor constant +if product.variant in ("Minimal", "Server"): + FLAVOR=" Сервер" +elif product.variant == "Certified": + FLAVOR=" Сертифицированная" +elif product.variant == "BaseOS": + FLAVOR=" ОС" +else: + FLAVOR="" %> mkdir images @@ -42,9 +52,18 @@ mkdir ${KERNELDIR} ## configure grub2 config file mkdir ${GRUB2DIR} +mkdir ${GRUB2DIR}/fonts/ +mkdir ${GRUB2DIR}/locale/ +install usr/share/grub/unicode.pf2 ${GRUB2DIR}/fonts/ +install /usr/share/locale/ru/LC_MESSAGES/grub.mo ${GRUB2DIR}/locale/ru.mo install ${configdir}/grub2-bios.cfg ${GRUB2DIR}/grub.cfg replace @VERSION@ ${product.version} ${GRUB2DIR}/grub.cfg -replace @PRODUCT@ '${product.name}' ${GRUB2DIR}/grub.cfg +%if product.name in ("MSVSphere", "MSVSphere Server"): +replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.cfg +%else: +replace @PRODUCT@ '${product.name}' ${GRUB2DIR}/grub.cfg +%endif +replace @FLAVOR@ '${FLAVOR}' ${GRUB2DIR}/grub.cfg replace @KERNELPATH@ /${KERNELDIR}/vmlinuz ${GRUB2DIR}/grub.cfg replace @INITRDPATH@ /${KERNELDIR}/initrd.img ${GRUB2DIR}/grub.cfg replace @ISOLABEL@ '${isolabel}' ${GRUB2DIR}/grub.cfg @@ -60,7 +79,7 @@ replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${GRUB2DIR}/grub.cfg <% efiarch64 = 'X64' %> %endif %if (efiarch32 or efiarch64): - <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/> + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, FLAVOR=FLAVOR"/> %endif # Create optional product.img and updates.img -- 2.47.1