From 633965934ac74eb73fbb1ac7cf9365777197db47 Mon Sep 17 00:00:00 2001 From: tigro Date: Sat, 29 Jul 2023 15:34:37 +0200 Subject: [PATCH 3/8] Translate live image bootloader to Russian --- .../live/config_files/aarch64/grub2-efi.cfg | 13 +++++--- 80-rhel/live/config_files/x86/grub2-efi.cfg | 11 +++++-- 80-rhel/live/efi.tmpl | 6 ++++ 80-rhel/live/x86.tmpl | 30 ++++++++++++++++++- 80-rhel/x86.tmpl | 2 +- 5 files changed, 53 insertions(+), 9 deletions(-) diff --git a/80-rhel/live/config_files/aarch64/grub2-efi.cfg b/80-rhel/live/config_files/aarch64/grub2-efi.cfg index c874547..c5db696 100644 --- a/80-rhel/live/config_files/aarch64/grub2-efi.cfg +++ b/80-rhel/live/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,16 +31,16 @@ set timeout=60 search --no-floppy --set=root -l '@ISOLABEL@' ### BEGIN /etc/grub.d/10_linux ### -menuentry 'Start @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@ @EXTRA@ rd.live.image quiet rhgb initrd @INITRDPATH@ } -menuentry 'Test this media & start @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@ @EXTRA@ rd.live.image rd.live.check quiet 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@ @EXTRA@ rd.live.image nomodeset quiet rhgb initrd @INITRDPATH@ } diff --git a/80-rhel/live/config_files/x86/grub2-efi.cfg b/80-rhel/live/config_files/x86/grub2-efi.cfg index 3906958..3ca2687 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,7 +25,7 @@ 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 rhgb initrdefi @INITRDPATH@ } @@ -28,8 +33,8 @@ menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class g 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 'Проверить носитель и запустить @PRODUCT@ @VERSION@@FLAVOR@ -->' { + menuentry 'Запустить @PRODUCT@ @VERSION@@FLAVOR@ (базовый графический режим)' --class fedora --class gnu-linux --class gnu --class os { linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset quiet rhgb initrdefi @INITRDPATH@ } diff --git a/80-rhel/live/efi.tmpl b/80-rhel/live/efi.tmpl index 813f91e..50f95e6 100644 --- a/80-rhel/live/efi.tmpl +++ b/80-rhel/live/efi.tmpl @@ -35,7 +35,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 cf4dad4..c88d657 100644 --- a/80-rhel/live/x86.tmpl +++ b/80-rhel/live/x86.tmpl @@ -28,6 +28,7 @@ mkdir ${LIVEDIR} install ${runtime_img} ${LIVEDIR}/squashfs.img treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + ## install kernels mkdir ${KERNELDIR} %for kernel in kernels: @@ -47,15 +48,42 @@ mkdir ${KERNELDIR} ## configure grub2 config file mkdir ${GRUB2DIR} +## add a console font with Russian (cp866) encoding support +install ${configdir}/cp866-8x16.psf ${GRUB2DIR} 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 == 'MSVSphere GNOME': +replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +replace @FLAVOR@ ' GNOME' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +%endif +%if product.name == 'MSVSphere Cinnamon': +replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +replace @FLAVOR@ ' Cinnamon' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +%endif +%if product.name == 'MSVSphere KDE': +replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +replace @FLAVOR@ ' KDE' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +%endif +%if product.name == 'MSVSphere XFCE': +replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +replace @FLAVOR@ ' XFCE' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +%endif +%if product.name == 'MSVSphere ARM': +replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +replace @FLAVOR@ ' АРМ' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg +%else: +replace @PRODUCT@ '${product.name}' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg +replace @FLAVOR@ '' ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg +%endif +replace @PRODUCT@ '${product.name}' ${GRUB2DIR}/grub.conf replace @KERNELPATH@ /${KERNELDIR}/vmlinuz ${GRUB2DIR}/grub.cfg replace @INITRDPATH@ /${KERNELDIR}/initrd.img ${GRUB2DIR}/grub.cfg replace @ISOLABEL@ '${isolabel}' ${GRUB2DIR}/grub.cfg replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUB2DIR}/grub.cfg replace @EXTRA@ '${extra_boot_args}' ${GRUB2DIR}/grub.cfg +## convert BIOS bootloader configs to cp866 encoding +iconv 'cp866' ${GRUB2DIR}/isolinux.cfg ${GRUB2DIR}/*.msg ## WHeeeeeeee, EFI. <% efiargs=""; efigraft=""; efiarch32=None; efiarch64=None %> diff --git a/80-rhel/x86.tmpl b/80-rhel/x86.tmpl index dcc1d20..608d8ed 100644 --- a/80-rhel/x86.tmpl +++ b/80-rhel/x86.tmpl @@ -57,7 +57,7 @@ mkdir ${KERNELDIR} mkdir ${GRUB2DIR} install ${configdir}/grub2-bios.cfg ${GRUB2DIR}/grub.cfg replace @VERSION@ ${product.version} ${GRUB2DIR}/grub.cfg -%if product.name == 'MSVSphere': +%if product.name in ("MSVSphere", "MSVSphere Server"): replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.cfg %else: replace @PRODUCT@ '${product.name}' ${GRUB2DIR}/grub.cfg -- 2.43.5