hartwork / grub2-theme-preview

:city_sunrise: Preview a full GRUB 2.x theme (or just a background image) using KVM / QEMU
https://pypi.org/project/grub2-theme-preview/
341 stars 11 forks source link

How to use it correctly? #225

Closed odinhaknet closed 1 year ago

odinhaknet commented 1 year ago

I have executed as follows:

  1. As a normal user on my Arch with bspWM: grub2-theme-preview ~/Downloads/Graphite-gtk-theme --grub-cfg ~/Downloads/grub.cfg --debug

  2. As root user: grub2-theme-preview /usr/share/grub/themes/Graphite-gtk-theme --debug

However, they don't work. Could you help me with any ideas please.

hartwork commented 1 year ago

Hi @reichikita-haknet "they don't work" is not a proper bug report. If you provide more details about your environment and how it doesn't work in detail, I may be able to help.

odinhaknet commented 1 year ago

Of course. Basically the error is that nothing happens, it just stays there with those outputs. My specifications: 2023-10-23_124845_866283245

You will see simply in my Arch Linux with the bspWM window manager, first of all download the utility with pipx as follows: pipx install grub2-theme-preview, of course also download the necessary dependencies with pacman (grub2, qemu, ovmf, mtools, xorriso).

Then as a normal user use:

sudo cp /boot/grub/grub.cfg ~/Downloads

sudo chown reichikita:reichikita ~/Downloads/grub.cfg

grub2-theme-preview ~/Downloads/Graphite-gtk-theme --grub-cfg ~/Downloads/grub.cfg --debug

Output normal user:

>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
loadfont $prefix/fonts/unicode.pf2
insmod all_video
insmod gfxterm
insmod png
insmod tga
insmod jpeg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080,auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=es_EC
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_32.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/Graphite/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2
    search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    echo    'Cargando Linux linux...'
    linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
    echo    'Cargando imagen de memoria inicial...'
    initrd  /boot/initramfs-linux.img
}
submenu 'Opciones avanzadas para Arch Linux' $menuentry_id_option 'gnulinux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    menuentry 'Arch Linux, con Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux.img
    }
    menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux-fallback.img
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
    fwsetup --is-supported
    if [ "$?" = 0 ]; then
        menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
            fwsetup
        }
    fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

submenu 'Reboot / Shutdown' --class shutdown {
    menuentry Reboot --class restart { reboot }
    menuentry Shutdown --class shutdown { halt }
}

set default=0
set timeout=30
terminal_output gfxterm
set theme=$prefix/themes/DEMO/theme.txt
>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

INFO: Found OVMF image at '/usr/share/edk2-ovmf/x64/OVMF_CODE.fd'.
INFO: Please give GRUB a moment to show up in QEMU...

I have also done it as root user:

grub2-theme-preview /usr/share/grub/themes/Graphite/ --debug

Output root user:

INFO: Appending to fonts to load: dejavu_sans_12.pf2
INFO: Appending to fonts to load: dejavu_sans_14.pf2
INFO: Appending to fonts to load: dejavu_sans_16.pf2
INFO: Appending to fonts to load: dejavu_sans_24.pf2
INFO: Appending to fonts to load: dejavu_sans_32.pf2
INFO: Appending to fonts to load: dejavu_sans_48.pf2
INFO: Appending to fonts to load: terminus-12.pf2
INFO: Appending to fonts to load: terminus-14.pf2
INFO: Appending to fonts to load: terminus-16.pf2
INFO: Appending to fonts to load: terminus-18.pf2

>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
loadfont $prefix/fonts/unicode.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_12.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_14.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_16.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_24.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_32.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_48.pf2
loadfont $prefix/themes/DEMO/terminus-12.pf2
loadfont $prefix/themes/DEMO/terminus-14.pf2
loadfont $prefix/themes/DEMO/terminus-16.pf2
loadfont $prefix/themes/DEMO/terminus-18.pf2
insmod all_video
insmod gfxterm
insmod png
insmod tga
insmod jpeg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080,auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=es_EC
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_32.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/Graphite/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2
    search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    echo    'Cargando Linux linux...'
    linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
    echo    'Cargando imagen de memoria inicial...'
    initrd  /boot/initramfs-linux.img
}
submenu 'Opciones avanzadas para Arch Linux' $menuentry_id_option 'gnulinux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    menuentry 'Arch Linux, con Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux.img
    }
    menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux-fallback.img
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
    fwsetup --is-supported
    if [ "$?" = 0 ]; then
        menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
            fwsetup
        }
    fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

submenu 'Reboot / Shutdown' --class shutdown {
    menuentry Reboot --class restart { reboot }
    menuentry Shutdown --class shutdown { halt }
}

set default=0
set timeout=30
terminal_output gfxterm
set theme=$prefix/themes/DEMO/theme.txt
>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

INFO: Found OVMF image at '/usr/share/edk2-ovmf/x64/OVMF_CODE.fd'.
INFO: Please give GRUB a moment to show up in QEMU...

I have used the --debug parameter in both cases in order to see any obvious errors but I cannot see any.

I don't think the theme is the problem because it is the one I currently use for GRUB.

hartwork commented 1 year ago

@reichikita-haknet could you add --verbose? That would show the commands being run to create the resue image and also to run QEMU/KVM.

E.g. for me:

$ grub2-theme-preview --verbose /usr/share/grub/themes/steam-big-picture/ |& grep '^# '
# grub-mkrescue --directory=/usr/lib/grub/i386-pc --xorriso xorriso --output /tmp/tmp8wjim43u/grub2_theme_demo.img boot/loader=/boot/loader/ boot/grub/grub.cfg=/tmp/tmp8wjim43u/grub.cfg boot/grub/themes/DEMO/=/usr/share/grub/themes/steam-big-picture
# qemu-system-x86_64 -m 256 -drive file=/tmp/tmp8wjim43u/grub2_theme_demo.img,index=0,media=disk,format=raw -enable-kvm
hartwork commented 1 year ago

@reichikita-haknet PS: You could try passing --display gtk or --display sdl to grub2-theme-preview also. My guess is that your QEMU has neither of these displays enabled? To list the supported QEMU display options in practice:

$ qemu-system-x86_64 -display help
Available display backend types:
none
gtk
sdl
egl-headless
curses
dbus
odinhaknet commented 1 year ago

Now use --verbose.

Output normal user:

>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
loadfont $prefix/fonts/unicode.pf2
insmod all_video
insmod gfxterm
insmod png
insmod tga
insmod jpeg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080,auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=es_EC
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_32.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/Graphite/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2
    search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    echo    'Cargando Linux linux...'
    linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
    echo    'Cargando imagen de memoria inicial...'
    initrd  /boot/initramfs-linux.img
}
submenu 'Opciones avanzadas para Arch Linux' $menuentry_id_option 'gnulinux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    menuentry 'Arch Linux, con Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux.img
    }
    menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux-fallback.img
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
    fwsetup --is-supported
    if [ "$?" = 0 ]; then
        menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
            fwsetup
        }
    fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

submenu 'Reboot / Shutdown' --class shutdown {
    menuentry Reboot --class restart { reboot }
    menuentry Shutdown --class shutdown { halt }
}

set default=0
set timeout=30
terminal_output gfxterm
set theme=$prefix/themes/DEMO/theme.txt
>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

INFO: Found OVMF image at '/usr/share/edk2-ovmf/x64/OVMF_CODE.fd'.
# grub-mkrescue --directory=/usr/lib/grub/x86_64-efi --xorriso xorriso --output /tmp/tmpodrzdqmf/grub2_theme_demo.img boot/grub/grub.cfg=/tmp/tmpodrzdqmf/grub.cfg boot/grub/themes/DEMO/=/home/reichikita/Descargas/Graphite-gtk-theme
xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/tmp/tmpodrzdqmf/grub2_theme_demo.img'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 7835m free
Added to ISO image: directory '/'='/tmp/grub.xe1lWz'
xorriso : UPDATE :     375 files added in 1 seconds
Added to ISO image: file '/boot/grub/grub.cfg'='/tmp/tmpodrzdqmf/grub.cfg'
Added to ISO image: directory '/boot/grub/themes/DEMO'='/home/reichikita/Descargas/Graphite-gtk-theme'
xorriso : UPDATE :    4430 files added in 1 seconds
ISO image produced: 31591 sectors
Written to medium : 31591 sectors at LBA 0
Writing to 'stdio:/tmp/tmpodrzdqmf/grub2_theme_demo.img' completed successfully.

INFO: Please give GRUB a moment to show up in QEMU...
# qemu-system-x86_64 -m 256 -drive file=/tmp/tmpodrzdqmf/grub2_theme_demo.img,index=0,media=disk,format=raw -enable-kvm -drive if=pflash,format=raw,readonly,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd
qemu-system-x86_64: -drive if=pflash,format=raw,readonly,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd: warning: short-form boolean option 'readonly' deprecated
Please use readonly=on instead
VNC server running on ::1:5900

Output root:

INFO: Appending to fonts to load: dejavu_sans_12.pf2
INFO: Appending to fonts to load: dejavu_sans_14.pf2
INFO: Appending to fonts to load: dejavu_sans_16.pf2
INFO: Appending to fonts to load: dejavu_sans_24.pf2
INFO: Appending to fonts to load: dejavu_sans_32.pf2
INFO: Appending to fonts to load: dejavu_sans_48.pf2
INFO: Appending to fonts to load: terminus-12.pf2
INFO: Appending to fonts to load: terminus-14.pf2
INFO: Appending to fonts to load: terminus-16.pf2
INFO: Appending to fonts to load: terminus-18.pf2

>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
loadfont $prefix/fonts/unicode.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_12.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_14.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_16.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_24.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_32.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_48.pf2
loadfont $prefix/themes/DEMO/terminus-12.pf2
loadfont $prefix/themes/DEMO/terminus-14.pf2
loadfont $prefix/themes/DEMO/terminus-16.pf2
loadfont $prefix/themes/DEMO/terminus-18.pf2
insmod all_video
insmod gfxterm
insmod png
insmod tga
insmod jpeg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080,auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=es_EC
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_32.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/Graphite/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2
    search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    echo    'Cargando Linux linux...'
    linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
    echo    'Cargando imagen de memoria inicial...'
    initrd  /boot/initramfs-linux.img
}
submenu 'Opciones avanzadas para Arch Linux' $menuentry_id_option 'gnulinux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    menuentry 'Arch Linux, con Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux.img
    }
    menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux-fallback.img
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
[root@archlinux reichikita]# grub2-theme-preview /usr/share/grub/themes/Graphite/ --debug --verbose
INFO: Appending to fonts to load: dejavu_sans_12.pf2
INFO: Appending to fonts to load: dejavu_sans_14.pf2
INFO: Appending to fonts to load: dejavu_sans_16.pf2
INFO: Appending to fonts to load: dejavu_sans_24.pf2
INFO: Appending to fonts to load: dejavu_sans_32.pf2
INFO: Appending to fonts to load: dejavu_sans_48.pf2
INFO: Appending to fonts to load: terminus-12.pf2
INFO: Appending to fonts to load: terminus-14.pf2
INFO: Appending to fonts to load: terminus-16.pf2
INFO: Appending to fonts to load: terminus-18.pf2

>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
loadfont $prefix/fonts/unicode.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_12.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_14.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_16.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_24.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_32.pf2
loadfont $prefix/themes/DEMO/dejavu_sans_48.pf2
loadfont $prefix/themes/DEMO/terminus-12.pf2
loadfont $prefix/themes/DEMO/terminus-14.pf2
loadfont $prefix/themes/DEMO/terminus-16.pf2
loadfont $prefix/themes/DEMO/terminus-18.pf2
insmod all_video
insmod gfxterm
insmod png
insmod tga
insmod jpeg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080,auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=es_EC
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_32.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/Graphite/terminus-18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/Graphite/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2
    search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
    echo    'Cargando Linux linux...'
    linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
    echo    'Cargando imagen de memoria inicial...'
    initrd  /boot/initramfs-linux.img
}
submenu 'Opciones avanzadas para Arch Linux' $menuentry_id_option 'gnulinux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
    menuentry 'Arch Linux, con Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux.img
    }
    menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-9e76f644-0390-44c7-8e38-600afdb4bb57' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 9e76f644-0390-44c7-8e38-600afdb4bb57
        echo    'Cargando Linux linux...'
        linux   /boot/vmlinuz-linux root=UUID=9e76f644-0390-44c7-8e38-600afdb4bb57 rw  loglevel=3 quiet
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/initramfs-linux-fallback.img
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
    fwsetup --is-supported
    if [ "$?" = 0 ]; then
        menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
            fwsetup
        }
    fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

submenu 'Reboot / Shutdown' --class shutdown {
    menuentry Reboot --class restart { reboot }
    menuentry Shutdown --class shutdown { halt }
}

set default=0
set timeout=30
terminal_output gfxterm
set theme=$prefix/themes/DEMO/theme.txt
>>> grub.cfg <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

INFO: Found OVMF image at '/usr/share/edk2-ovmf/x64/OVMF_CODE.fd'.
# grub-mkrescue --directory=/usr/lib/grub/x86_64-efi --xorriso xorriso --output /tmp/tmphle7z6s3/grub2_theme_demo.img boot/grub/grub.cfg=/tmp/tmphle7z6s3/grub.cfg boot/grub/themes/DEMO/=/usr/share/grub/themes/Graphite
xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/tmp/tmphle7z6s3/grub2_theme_demo.img'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 7835m free
Added to ISO image: directory '/'='/tmp/grub.ss5g5w'
xorriso : UPDATE :     375 files added in 1 seconds
Added to ISO image: file '/boot/grub/grub.cfg'='/tmp/tmphle7z6s3/grub.cfg'
Added to ISO image: directory '/boot/grub/themes/DEMO'='/usr/share/grub/themes/Graphite'
xorriso : UPDATE :     473 files added in 1 seconds
ISO image produced: 10131 sectors
Written to medium : 10131 sectors at LBA 0
Writing to 'stdio:/tmp/tmphle7z6s3/grub2_theme_demo.img' completed successfully.

INFO: Please give GRUB a moment to show up in QEMU...
# qemu-system-x86_64 -m 256 -drive file=/tmp/tmphle7z6s3/grub2_theme_demo.img,index=0,media=disk,format=raw -enable-kvm -drive if=pflash,format=raw,readonly,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd
qemu-system-x86_64: -drive if=pflash,format=raw,readonly,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd: warning: short-form boolean option 'readonly' deprecated
Please use readonly=on instead
VNC server running on ::1:5900

Use 'qemu-system-x86_64 -display help'

Available display backend types:
none
odinhaknet commented 1 year ago

Okay, now I understand, the mistake was mine, I didn't really have qemu GUI installed. Install sudo pacman -S qemu-full and it works fine

2023-10-23_135127_443043696

thanks for helping me understand friend

hartwork commented 1 year ago

@reichikita-haknet I'm glad we could figure things out together, thanks for the update!