You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lorax-templates-rhel/SOURCES/0003-Translate-installation...

256 lines
10 KiB

From d6e9b1e138fb12a4c29e381ac6c358a196e7c5d8 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Fri, 22 Dec 2023 16:29:51 +0300
Subject: [PATCH 3/7] Translate installation image bootloader to Russian
---
80-rhel/config_files/x86/grub2-efi.cfg | 15 ++++++----
80-rhel/config_files/x86/isolinux.cfg | 40 +++++++++++++++-----------
80-rhel/efi.tmpl | 7 +++++
80-rhel/x86.tmpl | 23 +++++++++++++--
4 files changed, 61 insertions(+), 24 deletions(-)
diff --git a/80-rhel/config_files/x86/grub2-efi.cfg b/80-rhel/config_files/x86/grub2-efi.cfg
index 8c9adad..5a7b61f 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@@FLAVOR@ (текстовый установщик)' --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 'Восстановление установленной системы @PRODUCT@' --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 1b3fae2..698695a 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,49 +74,53 @@ label check
menu separator # insert an empty line
# utilities submenu
-menu begin ^Troubleshooting
- menu title Troubleshooting
+menu begin Устранение неполадок
+ menu title Устранение неполадок
+ menu label ^3. Устранение неполадок
label vesa
menu indent count 5
- menu label Install @PRODUCT@ @VERSION@ in ^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. Восстановление установленной системы @PRODUCT@
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
label memtest
- menu label Run a ^memory test
+ menu label ^3. Запустить тест оперативной памяти
text help
- If your system is having issues, a problem with your
- system's memory may be the cause. Use this utility to
- see if the memory is working correctly.
+ Проблемы со стабильностью операционной системы могут
+ быть вызваны неисправностью оперативной памяти. Эта
+ утилита позволяет проверить корректность работы ОЗУ.
endtext
kernel memtest
menu separator # insert an empty line
label local
- menu label Boot from ^local drive
+ menu label ^4. Загрузка с локального диска
localboot 0xffff
menu separator # insert an empty line
menu separator # insert an empty line
label returntomain
- menu label Return to ^main menu
+ menu label ^0. Вернуться в главное меню
menu exit
menu end
diff --git a/80-rhel/efi.tmpl b/80-rhel/efi.tmpl
index d73d2d7..22bd0ba 100644
--- a/80-rhel/efi.tmpl
+++ b/80-rhel/efi.tmpl
@@ -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 boot/efi/EFI/*/fonts/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")}
@@ -39,7 +41,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 1b0a940..d5782c5 100644
--- a/80-rhel/x86.tmpl
+++ b/80-rhel/x86.tmpl
@@ -25,6 +25,14 @@ from os.path import basename
udfargs = "-allow-limited-size"
else:
udfargs = ""
+
+ # define an MSVSphere-specific image flavor constant
+ if product.variant in ("Minimal", "Server"):
+ FLAVOR=" Сервер"
+ elif product.variant == "BaseOS":
+ FLAVOR=" ОС"
+ else:
+ FLAVOR=""
%>
mkdir images
@@ -43,12 +51,23 @@ install ${configdir}/boot.msg ${BOOTDIR}
install ${configdir}/grub.conf ${BOOTDIR}
install usr/share/anaconda/boot/syslinux-splash.png ${BOOTDIR}/splash.png
install boot/memtest* ${BOOTDIR}/memtest
+## add a console font with Russian (cp866) encoding support
+install ${configdir}/cp866-8x16.psf ${BOOTDIR}
## configure bootloader
replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
-replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%if product.name == 'MSVSphere':
+replace @PRODUCT@ 'МСВСфера' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%else:
+replace @PRODUCT@ '${product.name}' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%endif
+replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf
+replace @FLAVOR@ '${FLAVOR}' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
+## convert BIOS bootloader configs to cp866 encoding
+iconv 'cp866' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
@@ -93,7 +112,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<% efihybrid = "--uefi --mac" if domacboot else "--uefi" %>
- <%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.43.0