livecd-tools/0013-ROSA-theme-and-config-of-bootloaders.patch
2021-06-27 22:39:45 +03:00

293 lines
12 KiB
Diff

From 567e52c49bcdc5ebd4a3c2c0d91ec0f7168af1e9 Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Thu, 28 May 2020 14:40:47 +0300
Subject: [PATCH] ROSA theme and config of bootloaders
* ROSA theme for syslinux
* ROSA theme for grub2
* add start up in basic graphics mode without plymouth
* move booting from local drive to end of menu and make it not default
Based on:
* livecd-tools-21.1.efi.grub.cfg.patch
* livecd-tools-21.1.urpmi.patch
---
imgcreate/live.py | 135 ++++++++++++++++++++++++++--------------------
1 file changed, 76 insertions(+), 59 deletions(-)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index cf66f50..d49aded 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -439,12 +439,12 @@ class x86LiveImageCreator(LiveImageCreatorBase):
def __copy_syslinux_background(self, isodest):
background_path = self._instroot + \
- "/usr/share/anaconda/boot/syslinux-vesa-splash.jpg"
+ "/usr/share/gfxboot/themes/Rosa-EE/splash.jpg"
if not os.path.exists(background_path):
- # fallback to F13 location
+ # fallback to default Fedora/RH location
background_path = self._instroot + \
- "/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg"
+ "/usr/share/anaconda/boot/syslinux-vesa-splash.jpg"
if not os.path.exists(background_path):
return False
@@ -500,28 +500,25 @@ timeout %(timeout)d
menu background %(background)s
menu autoboot Starting %(title)s in # second{,s}. Press any key to interrupt.
-menu clear
+#menu clear
menu title %(title)s
-menu vshift 8
-menu rows 18
-menu margin 8
+#menu vshift 8
+#menu rows 18
+#menu margin 8
#menu hidden
-menu helpmsgrow 15
-menu tabmsgrow 13
-
-menu color border * #00000000 #00000000 none
-menu color sel 0 #ffffffff #00000000 none
-menu color title 0 #ff7ba3d0 #00000000 none
-menu color tabmsg 0 #ff3a6496 #00000000 none
-menu color unsel 0 #84b8ffff #00000000 none
-menu color hotsel 0 #84b8ffff #00000000 none
-menu color hotkey 0 #ffffffff #00000000 none
-menu color help 0 #ffffffff #00000000 none
-menu color scrollbar 0 #ffffffff #ff355594 none
-menu color timeout 0 #ffffffff #00000000 none
-menu color timeout_msg 0 #ffffffff #00000000 none
-menu color cmdmark 0 #84b8ffff #00000000 none
-menu color cmdline 0 #ffffffff #00000000 none
+#menu helpmsgrow 15
+#menu tabmsgrow 13
+
+menu color border 0 #ffffffff #00000000
+menu color sel 7 #ffffffff #ff000000
+menu color title 0 #ffffffff #00000000
+menu color tabmsg 0 #ffffffff #00000000
+menu color unsel 0 #ffffffff #00000000
+menu color hotsel 0 #ff000000 #ffffffff
+menu color hotkey 7 #ffffffff #ff000000
+menu color timeout_msg 0 #ffffffff #00000000
+menu color timeout 0 #ffffffff #00000000
+menu color cmdline 0 #ffffffff #00000000
menu tabmsg Press Tab for full configuration options on menu items.
menu separator
@@ -602,7 +599,7 @@ menu separator
liveargs = kern_opts,
long = "Start " + long + " in ^basic graphics mode.",
short = "basic" + index,
- extra = "nomodeset",
+ extra = "nomodeset xdriver=vesa nokmsboot plymouth.enable=0",
help = "Try this option out if you're having trouble starting.",
index = index))
@@ -726,8 +723,10 @@ menu end
# XXX gcdia32.efi does not exist yet in ROSA
("/boot/efi/EFI/*/gcdia32.efi", "/EFI/BOOT/grubia32.efi", False),
("/boot/grub2/fonts/unicode.pf2", "/EFI/BOOT/fonts/", True),
+ ("/boot/grub2/themes/rosa/*", "/EFI/BOOT/themes/rosa/", True),
]
makedirs(isodir+"/EFI/BOOT/fonts/")
+ makedirs(isodir+"/EFI/BOOT/themes/rosa/")
for src, dest, required in files:
src_glob = glob.glob(self._instroot+src)
if not src_glob:
@@ -741,28 +740,38 @@ menu end
def __get_basic_efi_config(self, **args):
return """
-set default="1"
+set default="0"
function load_video {
insmod efi_gop
insmod efi_uga
- insmod video_bochs
- insmod video_cirrus
- insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
+insmod part_msdos
insmod ext2
+insmod iso9660
+
+set gfxmode=1024x768,1024x600,800x600,640x480
+insmod gfxterm
+insmod gettext
+terminal_output gfxterm
+insmod gfxmenu
+loadfont /EFI/BOOT/themes/rosa/dejavu_sans_bold_14.pf2
+loadfont /EFI/BOOT/themes/rosa/dejavu_sans_mono_11.pf2
+loadfont /EFI/BOOT/themes/rosa/terminal_font_11.pf2
+insmod png
+set theme=/EFI/BOOT/themes/rosa/theme.txt
+export theme
+background_image -m stretch /EFI/BOOT/themes/rosa/terminal_background.png
set timeout=%(timeout)d
-### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '%(isolabel)s'
-### BEGIN /etc/grub.d/10_linux ###
""" %args
def __get_efi_image_stanza(self, **args):
@@ -770,7 +779,7 @@ search --no-floppy --set=root -l '%(isolabel)s'
args["rootlabel"] = "live:LABEL=%(fslabel)s" % args
else:
args["rootlabel"] = "CDLABEL=%(fslabel)s" % args
- return """menuentry '%(long)s' --class fedora --class gnu-linux --class gnu --class os {
+ return """menuentry '%(long)s' --class rosa --class gnu-linux --class gnu --class os {
linuxefi /isolinux/vmlinuz%(index)s root=%(rootlabel)s %(liveargs)s %(extra)s
initrdefi /isolinux/initrd%(index)s.img
}
@@ -788,25 +797,24 @@ search --no-floppy --set=root -l '%(isolabel)s'
# we don't support xen kernels
if os.path.exists("%s/EFI/BOOT/xen%d.gz" %(isodir, index)):
continue
+
cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
liveargs = kernel_options,
long = "Start " + self.product,
- extra = "", index = index)
+ extra = "rhgb splash=silent logo.nologo", index = index)
+ cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
+ liveargs = kernel_options,
+ long = "Start " + self.product + " in basic graphics mode",
+ extra = "nomodeset plymouth.enable=0", index = index)
if checkisomd5:
cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
liveargs = kernel_options,
long = "Test this media & start " + self.product,
extra = "rd.live.check",
index = index)
- cfg += """
-submenu 'Troubleshooting -->' {
-"""
- cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
- liveargs = kernel_options,
- long = "Start " + self.product + " in basic graphics mode",
- extra = "nomodeset", index = index)
-
- cfg+= """}
+ cfg += """menuentry 'Boot from local drive' {
+ reboot
+}
"""
break
@@ -837,8 +845,6 @@ submenu 'Troubleshooting -->' {
# add macboot data
subprocess.call(["mkefiboot", "-a", isodir + "/EFI/BOOT",
isodir + "/isolinux/macboot.img", "-l", self.product,
- "-n", "/usr/share/pixmaps/bootloader/fedora-media.vol",
- "-i", "/usr/share/pixmaps/bootloader/fedora.icns",
"-p", self.product])
def _configure_bootloader(self, isodir):
@@ -1108,8 +1114,10 @@ class aarch64LiveImageCreator(LiveImageCreatorBase):
files = [("/boot/efi/EFI/*/shim%s.efi" % (self.efiarch.lower(),), "/EFI/BOOT/BOOT%s.EFI" % (self.efiarch,), True),
("/usr/share/grub2-efi/grubcd.efi", "/EFI/BOOT/grub%s.efi" % (self.efiarch.lower(),), True),
("/boot/grub2/fonts/unicode.pf2", "/EFI/BOOT/fonts/", True),
+ ("/boot/grub2/themes/rosa/*", "/EFI/BOOT/themes/rosa/", True),
]
makedirs(isodir+"/EFI/BOOT/fonts/")
+ makedirs(isodir+"/EFI/BOOT/themes/rosa/")
for src, dest, required in files:
src_glob = glob.glob(self._instroot+src)
if not src_glob:
@@ -1121,29 +1129,40 @@ class aarch64LiveImageCreator(LiveImageCreatorBase):
return fail
def __get_basic_efi_config(self, **args):
+ # code is uselessly (?) duplicated, https://github.com/livecd-tools/livecd-tools/issues/195
return """
-set default="1"
+set default="0"
function load_video {
insmod efi_gop
insmod efi_uga
- insmod video_bochs
- insmod video_cirrus
- insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
+insmod part_msdos
insmod ext2
+insmod iso9660
+
+set gfxmode=1024x768,1024x600,800x600,640x480
+insmod gfxterm
+insmod gettext
+terminal_output gfxterm
+insmod gfxmenu
+loadfont /EFI/BOOT/themes/rosa/dejavu_sans_bold_14.pf2
+loadfont /EFI/BOOT/themes/rosa/dejavu_sans_mono_11.pf2
+loadfont /EFI/BOOT/themes/rosa/terminal_font_11.pf2
+insmod png
+set theme=/EFI/BOOT/themes/rosa/theme.txt
+export theme
+background_image -m stretch /EFI/BOOT/themes/rosa/terminal_background.png
set timeout=%(timeout)d
-### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '%(isolabel)s'
-### BEGIN /etc/grub.d/10_linux ###
""" %args
def __get_efi_image_stanza(self, **args):
@@ -1168,22 +1187,20 @@ search --no-floppy --set=root -l '%(isolabel)s'
cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
liveargs = kernel_options,
long = "Start " + self.product,
- extra = "", index = index)
+ extra = "rhgb splash=silent logo.nologo", index = index)
+ cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
+ liveargs = kernel_options,
+ long = "Start " + self.product + " in basic graphics mode",
+ extra = "nomodeset plymouth.enable=0", index = index)
if checkisomd5:
cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
liveargs = kernel_options,
long = "Test this media & start " + self.product,
extra = "rd.live.check",
index = index)
- cfg += """
-submenu 'Troubleshooting -->' {
-"""
- cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
- liveargs = kernel_options,
- long = "Start " + self.product + " in basic graphics mode",
- extra = "nomodeset", index = index)
-
- cfg+= """}
+ cfg += """menuentry 'Boot from local drive' {
+ reboot
+}
"""
break
--
2.31.1