Preview a GRUB 2.x theme using KVM/QEMU
Project description
About
grub2-theme-preview came into life when I was looking around for available GRUB 2.x themes and wanted a way to quickly see a theme in action without rebooting real hardware.
It takes a theme folder (or just a single picture),
creates a temporary bootable image using grub2-mkrescue
and launches
that image in a virtual machine using KVM/QEMU, all without root privileges.
(Showing theme gutsblack-archlinux)
Installation
To install the latest release from PyPI:
# pip install --user grub2-theme-preview
To install from a Git clone for development:
# pip install --user --editable .
Please make sure to install these non-PyPI dependencies as well:
grub-mkrescue
of GRUB 2 (packagegrub-common
on Debian and Ubuntu)- QEMU — hypervisor that performs hardware virtualization
- OVMF — EFI bios image for use with QEMU
- mtools — collection of utilities to access MS-DOS
xorriso
of libisoburn — frontend which enables creation and expansion of the ISO format
Usage
# grub2-theme-preview --help
usage: grub2-theme-preview [-h] [--grub-cfg PATH] [--verbose]
[--resolution WxH] [--timeout SECONDS]
[--add TARGET=/SOURCE] [--version]
[--grub2-mkrescue COMMAND] [--qemu COMMAND]
[--xorriso COMMAND] [--no-kvm] [--debug]
[--plain-rescue-image]
PATH
positional arguments:
PATH path of theme directory (or PNG/TGA image file) to
preview
optional arguments:
-h, --help show this help message and exit
--grub-cfg PATH path of custom grub.cfg file to use (default:
/boot/grub{2,}/grub.cfg)
--verbose increase verbosity
--resolution WxH set a custom resolution, e.g. 800x600
--timeout SECONDS set GRUB timeout in whole seconds or -1 to disable
(default: 30 seconds)
--add TARGET=/SOURCE make grub2-mkrescue add file(s) from /SOURCE to
/TARGET in the rescue image (can be passed multiple
times)
--version show program's version number and exit
command location arguments:
--grub2-mkrescue COMMAND
grub2-mkrescue command (default: auto-detect)
--qemu COMMAND KVM/QEMU command (default: qemu-system-<machine>)
--xorriso COMMAND xorriso command (default: xorriso)
arguments related to invokation of QEMU/KVM:
--display DISPLAY pass "-display DISPLAY" to QEMU, see "man qemu" for
details (default: use QEMU's default display)
--full-screen pass "-full-screen" to QEMU
--no-kvm do not pass -enable-kvm to QEMU (and hence fall back
to acceleration "tcg" which is significantly slower
than KVM)
--vga CARD pass "-vga CARD" to QEMU, see "man qemu" for details
(default: use QEMU's default VGA card)
debugging arguments:
--debug enable debugging output
--plain-rescue-image use unprocessed GRUB rescue image with no theme
patched in; useful for checking if a plain GRUB rescue
image shows up a GRUB shell, successfully.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
grub2-theme-preview-2.8.0.tar.gz
(207.7 kB
view hashes)
Built Distribution
Close
Hashes for grub2-theme-preview-2.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdf8b164ced79d9ae5efb096e720e52e236d486745fbcb5dc1aa7ad341284b5a |
|
MD5 | 8f4e1625275027f891fa77f53225a5f0 |
|
BLAKE2b-256 | 428c8c6cf7e847173ad2788c4ca28e1d76af55a25000634b9d8dc79c2735d44e |
Close
Hashes for grub2_theme_preview-2.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6557f6e73c35266767848b35a552773b47bbb0b953081334b7bf3f2408617f66 |
|
MD5 | 69610d338c32b1fd4886377543ea92d6 |
|
BLAKE2b-256 | 05e4dd00114e0675178c0aded7a64f83312f70353a09b1cfc61b71bf464bd50d |