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

280 lines
12 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 cb67374dce91624cd4998b17b5faca2aabd2d28c Mon Sep 17 00:00:00 2001
From: tigro <arkadiy.sheyn@softline.com>
Date: Sat, 29 Jul 2023 15:34:37 +0200
Subject: [PATCH 3/3] Translate live image bootloader to Russian
---
80-rhel/live/aarch64.tmpl | 12 +++++-
.../live/config_files/aarch64/grub2-efi.cfg | 13 ++++--
80-rhel/live/config_files/x86/grub2-bios.cfg | 21 +++++-----
80-rhel/live/config_files/x86/grub2-efi.cfg | 13 ++++--
80-rhel/live/efi.tmpl | 8 ++++
80-rhel/live/x86.tmpl | 42 +++++++++++++++++--
6 files changed, 86 insertions(+), 23 deletions(-)
diff --git a/80-rhel/live/aarch64.tmpl b/80-rhel/live/aarch64.tmpl
index d1a3f87..b5eadc0 100644
--- a/80-rhel/live/aarch64.tmpl
+++ b/80-rhel/live/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 ${LIVEDIR}
@@ -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, extra_boot_args=extra_boot_args"/>
+ <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, extra_boot_args=extra_boot_args, FLAVOR=FLAVOR"/>
%endif
# Create optional product.img and updates.img
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-bios.cfg b/80-rhel/live/config_files/x86/grub2-bios.cfg
index 73d0a56..0f805c8 100644
--- a/80-rhel/live/config_files/x86/grub2-bios.cfg
+++ b/80-rhel/live/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,23 +22,17 @@ 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 {
linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet rhgb
initrd @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 {
linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
initrd @INITRDPATH@
}
-submenu 'Troubleshooting -->' {
- menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
- linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset vga=791 quiet rhgb
+submenu 'Устранение неполадок -->' {
+ menuentry 'Запустить @PRODUCT@ @VERSION@@FLAVOR@ (базовый графический режим)' --class fedora --class gnu-linux --class gnu --class os {
+ linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset quiet rhgb
initrd @INITRDPATH@
}
- menuentry 'Boot first drive' --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 {
- chainloader (hd1)+1
- }
}
diff --git a/80-rhel/live/config_files/x86/grub2-efi.cfg b/80-rhel/live/config_files/x86/grub2-efi.cfg
index 3906958..05c846d 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 rhgb
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 rhgb
initrdefi @INITRDPATH@
}
diff --git a/80-rhel/live/efi.tmpl b/80-rhel/live/efi.tmpl
index 813f91e..cfc63ec 100644
--- a/80-rhel/live/efi.tmpl
+++ b/80-rhel/live/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 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,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..48012df 100644
--- a/80-rhel/live/x86.tmpl
+++ b/80-rhel/live/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 ${LIVEDIR}
@@ -47,9 +57,35 @@ 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 == 'MSVSphere GNOME':
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.cfg
+replace @FLAVOR@ ' GNOME' ${GRUB2DIR}/grub.cfg
+%endif
+%if product.name == 'MSVSphere Cinnamon':
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.cfg
+replace @FLAVOR@ ' Cinnamon' ${GRUB2DIR}/grub.cfg
+%endif
+%if product.name == 'MSVSphere KDE':
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.cfg
+replace @FLAVOR@ ' KDE' ${GRUB2DIR}/grub.cfg
+%endif
+%if product.name == 'MSVSphere XFCE':
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.cfg
+replace @FLAVOR@ ' XFCE' ${GRUB2DIR}/grub.cfg
+%endif
+%if product.name == 'MSVSphere ARM':
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.cfg
+replace @FLAVOR@ ' АРМ' ${GRUB2DIR}/grub.cfg
+%else:
+replace @PRODUCT@ '${product.name}' ${GRUB2DIR}/grub.cfg
+replace @FLAVOR@ '' ${GRUB2DIR}/grub.cfg
+%endif
replace @KERNELPATH@ /${KERNELDIR}/vmlinuz ${GRUB2DIR}/grub.cfg
replace @INITRDPATH@ /${KERNELDIR}/initrd.img ${GRUB2DIR}/grub.cfg
replace @ISOLABEL@ '${isolabel}' ${GRUB2DIR}/grub.cfg
@@ -66,7 +102,7 @@ replace @EXTRA@ '${extra_boot_args}' ${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, extra_boot_args=extra_boot_args"/>
+ <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, extra_boot_args=extra_boot_args, FLAVOR=FLAVOR"/>
%endif
# Create optional product.img and updates.img
@@ -80,7 +116,7 @@ replace @EXTRA@ '${extra_boot_args}' ${GRUB2DIR}/grub.cfg
%endfor
# Add the license files
-%for f in glob("usr/share/licenses/*-release-common/*"):
+%for f in glob("/usr/share/sphere-release/EULA"):
install ${f} ${f|basename}
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
%endfor
--
2.47.1