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/0004-Translate-live-image-b...

217 lines
8.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

From 67333eef8ab5dc1f1af01061fdc6a14d2413aa89 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Fri, 22 Dec 2023 16:42:33 +0300
Subject: [PATCH 4/7] Translate live image bootloader to Russian
---
80-rhel/live/config_files/x86/grub2-efi.cfg | 13 ++++++---
80-rhel/live/config_files/x86/isolinux.cfg | 27 ++++++++++---------
80-rhel/live/efi.tmpl | 6 +++++
80-rhel/live/x86.tmpl | 30 ++++++++++++++++++++-
80-rhel/x86.tmpl | 2 +-
5 files changed, 59 insertions(+), 19 deletions(-)
diff --git a/80-rhel/live/config_files/x86/grub2-efi.cfg b/80-rhel/live/config_files/x86/grub2-efi.cfg
index 2e24b15..4dc2fb2 100644
--- a/80-rhel/live/config_files/x86/grub2-efi.cfg
+++ b/80-rhel/live/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,16 +25,16 @@ set timeout=60
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
-menuentry 'Start @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@ @EXTRA@ rd.live.image quiet
initrdefi @INITRDPATH@
}
-menuentry 'Test this media & start @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@ @EXTRA@ rd.live.image rd.live.check quiet
initrdefi @INITRDPATH@
}
-submenu 'Troubleshooting -->' {
- menuentry 'Start @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@ @EXTRA@ rd.live.image nomodeset quiet
initrdefi @INITRDPATH@
}
diff --git a/80-rhel/live/config_files/x86/isolinux.cfg b/80-rhel/live/config_files/x86/isolinux.cfg
index bc36bb9..a2253ca 100644
--- a/80-rhel/live/config_files/x86/isolinux.cfg
+++ b/80-rhel/live/config_files/x86/isolinux.cfg
@@ -8,7 +8,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 +53,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 ^Start @PRODUCT@ @VERSION@
+ menu label ^1. Запустить @PRODUCT@ @VERSION@@FLAVOR@
kernel vmlinuz
append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image quiet
label check
- menu label Test this ^media & start @PRODUCT@ @VERSION@
+ menu label ^2. Проверить носитель и запустить @PRODUCT@ @VERSION@@FLAVOR@
menu default
kernel vmlinuz
append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
@@ -72,12 +72,13 @@ 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 Start @PRODUCT@ @VERSION@ in ^basic graphics mode
+ menu label ^3. Запустить @PRODUCT@ @VERSION@FLAVOR@ в базовом графическом режиме
text help
Try this option out if you're having trouble starting
@PRODUCT@ @VERSION@.
@@ -86,25 +87,25 @@ label vesa
append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image nomodeset quiet
label memtest
- menu label Run a ^memory test
+ menu label ^4. Запустить тест оперативной памяти
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 ^5. Загрузка с локального диска
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/live/efi.tmpl b/80-rhel/live/efi.tmpl
index 572e07d..fa18025 100644
--- a/80-rhel/live/efi.tmpl
+++ b/80-rhel/live/efi.tmpl
@@ -39,7 +39,13 @@ ${make_efiboot("images/efiboot.img")}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif
install ${configdir}/grub2-efi.cfg ${eficonf}
+ %if product.name == 'MSVSphere ARM':
+ replace @PRODUCT@ 'МСВСфера' ${eficonf}
+ replace @FLAVOR@ ' АРМ' ${eficonf}
+ %else:
replace @PRODUCT@ '${product.name}' ${eficonf}
+ replace @FLAVOR@ '' ${eficonf}
+ %endif
replace @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
diff --git a/80-rhel/live/x86.tmpl b/80-rhel/live/x86.tmpl
index 4d46043..6209734 100644
--- a/80-rhel/live/x86.tmpl
+++ b/80-rhel/live/x86.tmpl
@@ -43,13 +43,41 @@ 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 GNOME':
+replace @PRODUCT@ 'МСВСфера' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+replace @FLAVOR@ ' GNOME' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%endif
+%if product.name == 'MSVSphere Cinnamon':
+replace @PRODUCT@ 'МСВСфера' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+replace @FLAVOR@ ' Cinnamon' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%endif
+%if product.name == 'MSVSphere KDE':
+replace @PRODUCT@ 'МСВСфера' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+replace @FLAVOR@ ' KDE' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%endif
+%if product.name == 'MSVSphere XFCE':
+replace @PRODUCT@ 'МСВСфера' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+replace @FLAVOR@ ' XFCE' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%endif
+%if product.name == 'MSVSphere ARM':
+replace @PRODUCT@ 'МСВСфера' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+replace @FLAVOR@ ' АРМ' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%else:
+replace @PRODUCT@ '${product.name}' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+replace @FLAVOR@ '' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
+%endif
+replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
replace @EXTRA@ '${extra_boot_args}' ${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:
diff --git a/80-rhel/x86.tmpl b/80-rhel/x86.tmpl
index d5782c5..91fd965 100644
--- a/80-rhel/x86.tmpl
+++ b/80-rhel/x86.tmpl
@@ -56,7 +56,7 @@ install ${configdir}/cp866-8x16.psf ${BOOTDIR}
## configure bootloader
replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
-%if product.name == 'MSVSphere':
+%if product.name in ("MSVSphere", "MSVSphere Server"):
replace @PRODUCT@ 'МСВСфера' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
%else:
replace @PRODUCT@ '${product.name}' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
--
2.43.0