Commit ed62966e authored by Anton Midyukov's avatar Anton Midyukov

grub: Added submenu for langs change

parent ea262607
......@@ -4,3 +4,4 @@ insmod minicmd
insmod normal
insmod test
set timeout=@timeout@
if [ ! "$lang" ]; then lang=@LOCALE@; fi
default='linux'
menuentry 'Install @relname@' --hotkey 'i' --id 'linux' {
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@ lang=$lang
initrd@linux_suffix@ @boot_path@/full.cz
}
menuentry 'VNC install @relname@ (edit to set server IP address)' --id 'vncconnect' {
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP lang=$lang
initrd@linux_suffix@ @boot_path@/full.cz
}
menuentry 'VNC install @relname@ (edit to set password and connect here)' --id 'vncpasswd' {
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD lang=$lang
initrd@linux_suffix@ @boot_path@/full.cz
}
menuentry 'LiveCD (no hard disk needed)' --id 'live' {
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts lowmem vga=@bootvga@ @bootargs@
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts lowmem vga=@bootvga@ @bootargs@ lang=$lang
initrd@linux_suffix@ @boot_path@/full.cz
}
......
menuentry 'LiveCD with sessions support' --id 'session' {
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts live_rw vga=@bootvga@ @bootargs@
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts live_rw vga=@bootvga@ @bootargs@ lang=$lang
initrd@linux_suffix@ @boot_path@/full.cz
}
submenu "Change language (press F2)" --hotkey 'f2' {
insmod regexp
for langstr in "ru_RU=Russian" "en_US=English" "pt_BR=Portuguese" "kk_KZ=Kazakh" "uk_UA=Ukrainian"; do
regexp -s 2:langname -s 1:langcode '(.*)=(.*)' "$langstr"
menuentry "${langname}" "$langcode" {
lang="$2"
export lang
configfile ${prefix}/grub.cfg
}
done
menuentry "Return to the Main menu" {
configfile ${prefix}/grub.cfg
}
}
......@@ -19,6 +19,10 @@ ifndef GRUB_DIRECT
GRUB_CFG := $(GRUB_CFG) $(SUBPROFILE_DIRS) defaults fwsetup_efi
endif
ifdef LOCALE
GRUB_CFG := $(GRUB_CFG) lang
endif
DSTDIR := $(BUILDDIR)/stage1/files/boot/grub/.in
DSTCFGS := $(DSTDIR)/*.cfg
......@@ -77,6 +81,12 @@ bootargs: clean
sed -i "s,@bootvga@,$(BOOTVGA)," $(DSTCFGS); \
fi; \
sed -i "s,@bootvga@,,;s,vga= ,," $(DSTCFGS)
@if [ -n "$(LOCALE)" ]; then \
sed -i "s,@LOCALE@,$(LOCALE),g" $(DSTCFGS); \
else \
sed -i "s, lang=.lang,,g" $(DSTCFGS); \
fi; \
sed -i "/lang=@LOCALE@/d" $(DSTCFGS)
clean: copy
@if [ "$(GRUB_UI)" = gfxboot ]; then \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment