You are not logged in.

#1 2022-07-02 18:37:11

TechXero
Member
Registered: 2022-05-20
Posts: 29

GRUB Theme in Live ISO

Hey there...

I am a Distro Maintainer, and latest archiso added Grub as boot, I was wondering if I want to use a theme on that UEFI Grub how to do so.. I already set one for future system just want to set the same for booting my ISO... I saw the grub.cfg in grub folder in releng.. I want to make it use my theme for my Distro...

Thanks...

Offline

#2 2022-07-02 19:20:31

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: GRUB Theme in Live ISO

Add a line to grub.cfg using the background_image command.


Jin, Jîyan, Azadî

Offline

#3 2022-07-02 19:22:54

TechXero
Member
Registered: 2022-05-20
Posts: 29

Re: GRUB Theme in Live ISO

Thing is theme is made of Fonts and wallpaper and colors etc full theme

Offline

#4 2022-07-02 19:33:25

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: GRUB Theme in Live ISO

The font can also be specified with loadfont. The official profile already does this for unicode.pf2: https://gitlab.archlinux.org/archlinux/ … ub.cfg#L10

See https://www.gnu.org/software/grub/manua … ile-format for the relevant upstream documentation on theming.


Jin, Jîyan, Azadî

Offline

#5 2022-07-02 19:40:38

TechXero
Member
Registered: 2022-05-20
Posts: 29

Re: GRUB Theme in Live ISO

This is my theme
https://github.com/xerolinux/default-gr … in/XeroKDE

I want to load it on ISO boot.. It's installed on my system. Installed grub.cfg

insmod gfxmenu
loadfont ($root)/boot/grub/themes/XeroKDE/terminus-12.pf2
loadfont ($root)/boot/grub/themes/XeroKDE/terminus-14.pf2
loadfont ($root)/boot/grub/themes/XeroKDE/terminus-16.pf2
loadfont ($root)/boot/grub/themes/XeroKDE/terminus-18.pf2
loadfont ($root)/boot/grub/themes/XeroKDE/ubuntu_regular_17.pf2
loadfont ($root)/boot/grub/themes/XeroKDE/ubuntu_regular_20.pf2
insmod png
set theme=($root)/boot/grub/themes/XeroKDE/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5

Offline

#6 2022-07-02 19:44:36

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: GRUB Theme in Live ISO

Your configuration relies on grub-mkconfig but for the ISO you will have to edit grub.cfg directly. Use your current grub.cfg as a reference, it shouldn't be too hard.


Jin, Jîyan, Azadî

Offline

#7 2022-07-02 19:55:16

TechXero
Member
Registered: 2022-05-20
Posts: 29

Re: GRUB Theme in Live ISO

I dunno where to put the files on the ISO for grub.cfg to pick the theme.txt up.. I tried copy pasting that part into ISO grub.cfg and put files on boot/.... did not work, put them elsewhere changes location in cfg still did not work

Offline

#8 2022-07-03 00:11:52

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: GRUB Theme in Live ISO

Put them under archiso/configs/releng/grub/fonts/ then add the lines to archiso/configs/releng/grub/grub.cfg with this format:

loadfont "${prefix}/fonts/whatever.pf2"

Replace whatever with the actual font name.

Disclaimer: untested.


Jin, Jîyan, Azadî

Offline

#9 2022-07-03 06:24:32

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: GRUB Theme in Live ISO

${prefix} is (memdisk)/boot/grub, you want ${cmdpath}, which is (cd0)/EFI/BOOT, instead.

Not that that would work anyway, since only grub.cfg is copied to /EFI/BOOT/. See archiso#185.
Someone should probably fix that.

Last edited by nl6720 (2022-07-17 15:19:12)

Offline

#10 2022-07-03 09:51:47

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: GRUB Theme in Live ISO

^ Interesting :-)

@OP: something like this might work:

--- /usr/local/bin/mkarchiso
+++ /usr/local/bin/mkarchiso
@@ -605,6 +605,16 @@ _make_bootmode_uefi-ia32.grub.eltorito()
     # Copy GRUB configuration files
     install -m 0644 -- "${work_dir}/grub.cfg" "${isofs_dir}/EFI/BOOT/grub.cfg"
 
+    # Copy GRUB theme
+    if [[ -d "${work_dir}/fonts" ]]; then
+        install -d -m 0755 -- "${isofs_dir}/EFI/BOOT/fonts"
+        install -D -m 0644 -- "${work_dir}/fonts/*.pf2" "${isofs_dir}/EFI/BOOT/fonts"
+    fi
+    if [[ -d "${work_dir}/background" ]]; then
+        install -d -m 0755 -- "${isofs_dir}/EFI/BOOT/background"
+        install -D -m 0644 -- "${work_dir}/background/*" "${isofs_dir}/EFI/BOOT/background"
+    fi
+
     # edk2-shell based UEFI shell
     if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" ]]; then
         install -m 0644 -- "${pacstrap_dir}/usr/share/edk2-shell/ia32/Shell_Full.efi" \

So save that as hack.patch, place the fonts (which should have the .pf2 suffix) in archiso/configs/releng/grub/fonts/ and the background image in archiso/confgs/releng/grub/background/ then copy mkarchiso to /usr/local/bin/ and apply the patch:

# cp /usr{,/local}/bin/mkarchiso
# patch -p1 /usr/local/bin/mkarchiso -i hack.patch

Disclaimer: also untested.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB