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...

255 lines
10 KiB

From 936994d7fcb092945885e876ba40ecf38bb7831f 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 | 6 +++
80-rhel/live/x86.tmpl | 40 ++++++++++++++++++-
6 files changed, 83 insertions(+), 22 deletions(-)
diff --git a/80-rhel/live/aarch64.tmpl b/80-rhel/live/aarch64.tmpl
index d1a3f87..f8bb655 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..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..30462ec 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.conf
+%endif
+%if product.name == 'MSVSphere Cinnamon':
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.conf
+replace @FLAVOR@ ' Cinnamon' ${GRUB2DIR}/grub.conf
+%endif
+%if product.name == 'MSVSphere KDE':
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.conf
+replace @FLAVOR@ ' KDE' ${GRUB2DIR}/grub.conf
+%endif
+%if product.name == 'MSVSphere XFCE':grub.conf
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.conf
+replace @FLAVOR@ ' XFCE' ${GRUB2DIR}/grub.conf
+%endif
+%if product.name == 'MSVSphere ARM':
+replace @PRODUCT@ 'МСВСфера' ${GRUB2DIR}/grub.conf
+replace @FLAVOR@ ' АРМ' ${GRUB2DIR}/grub.conf
+%else:
+replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf
+replace @FLAVOR@ '' ${BOOTDIR}/grub.conf
+%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
--
2.47.1